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>,
pending: FuturesUnordered<JoinHandle<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>>,
cancel_handles: HashMap<UnminedTxId, (Sender<CancelDownloadAndVerify>, Gossip, Option<SocketAddr>)>,
pending_per_peer: HashMap<IpAddr, usize>,
}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.
pending: FuturesUnordered<JoinHandle<Result<Result<(VerifiedUnminedTx, Vec<OutPoint>, Option<Height>, Option<Sender<Result<(), Box<dyn Error + Send + Sync>>>>), Box<(TransactionDownloadVerifyError, UnminedTxId)>>, (UnminedTxId, Elapsed)>>>A list of pending transaction download and verify 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.
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: 344 bytes