Skip to main content

InboundTxDownloads

Type Alias InboundTxDownloads 

Source
type InboundTxDownloads = Downloads<Timeout<Buffer<BoxService<Request, Response, BoxError>, Request>>, Timeout<Buffer<BoxService<Request, Response, TransactionError>, Request>>, 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<Request, Response, TransactionError>, Request>>,
    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<SocketAddr, 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<Request, Response, TransactionError>, Request>>

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<SocketAddr, usize>

The number of currently in-flight download tasks per advertising peer.

Invariant: a peer is present here iff some entry in Self::cancel_handles has it as the third tuple element. 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