type InboundTxDownloads = Downloads<Timeout<Buffer<BoxService<Request, Response, BoxError>, Request>>, Timeout<Buffer<BoxService<MempoolRequest, MempoolResponse, TransactionError>, MempoolRequest>>, Buffer<BoxService<Request, Response, BoxError>, Request>>;Aliased Type§
struct InboundTxDownloads {
network: Timeout<Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>>,
verifier: Timeout<Buffer<BoxService<MempoolRequest, MempoolResponse, TransactionError>, MempoolRequest>>,
state: Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>,
max_datacarrier_bytes: u32,
pending: FuturesUnordered<JoinHandle<()>>,
results: UnboundedReceiver<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>,
results_sender: UnboundedSender<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>,
in_flight: usize,
cancel_handles: HashMap<UnminedTxId, (Sender<CancelDownloadAndVerify>, Gossip, Option<SocketAddr>)>,
pending_per_peer: HashMap<IpAddr, usize>,
transaction_verified: Arc<Notify>,
}Fields§
§network: Timeout<Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>>A service that forwards requests to connected peers, and returns their responses.
verifier: Timeout<Buffer<BoxService<MempoolRequest, MempoolResponse, TransactionError>, MempoolRequest>>A service that verifies downloaded transactions.
state: Buffer<BoxService<Request, Response, Box<dyn Error + Send + Sync>>, Request>A service that manages cached blockchain state.
max_datacarrier_bytes: u32The maximum OP_RETURN script size for the standard output checks.
pending: FuturesUnordered<JoinHandle<()>>Pending tasks, retained to reap finished tasks and propagate panics.
results: UnboundedReceiver<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>The results of finished download and verify tasks.
results_sender: UnboundedSender<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>The sender each task uses to queue its result.
in_flight: usizeTransactions whose results have not been consumed, including cancelled tasks.
cancel_handles: HashMap<UnminedTxId, (Sender<CancelDownloadAndVerify>, Gossip, Option<SocketAddr>)>A list of channels that can be used to cancel pending transaction
download and verify tasks. Each entry also stores the corresponding
gossip request and the announcing peer (when known), so completion can
release the per-peer slot by UnminedTxId lookup.
pending_per_peer: HashMap<IpAddr, usize>The number of currently in-flight download tasks per advertising host,
keyed on the peer’s IpAddr.
Keyed on the host IP rather than the full SocketAddr so that all
connections from one host share a single budget: the source is a
transient (IP, ephemeral port), so per-SocketAddr keying would give
each connection its own bucket. This matches the inbound-block download
cap (in_flight_ips). See #10685.
Invariant: an IP is present here with count n iff exactly n entries in
Self::cancel_handles have a source with that IP. Enforces
MAX_INBOUND_CONCURRENCY_PER_PEER. See GHSA-4fc2-h7jh-287c.
transaction_verified: Arc<Notify>Wakes the queue checker to store and announce verified transactions.
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 384 bytes