pub(crate) struct InflightBlock {
pub peer: u32,
pub block: Block,
pub aux_data: Option<(Vec<CompactLeafData>, Proof, u32)>,
}Expand description
A block that is currently being downloaded or pending processing
To download a block, we first request the block itself, and then we
request the proof and leaf data for it. This struct holds the data
we already have. We may also keep it around, as we may receive blocks
out of order, so while we wait for the previous blocks to finish download,
we keep the blocks that are already downloaded as an InflightBlock.
Fields§
§peer: u32The peer that sent the block.
block: BlockThe block itself.
aux_data: Option<(Vec<CompactLeafData>, Proof, u32)>Auxiliary data needed for validating this block. Currently, it includes utreexo leaf data (previous UTXOs spent in the block), the corresponding accumulator inclusion proof, and the peer id that provided them.
Implementations§
Source§impl InflightBlock
impl InflightBlock
Sourcefn new(block: Block, peer: u32) -> Self
fn new(block: Block, peer: u32) -> Self
Creates a new InflightBlock from a block and the associated peer id.
If the block doesn’t spend any output (i.e., coinbase transaction only) this method adds
empty auxiliary data, which marks this inflight block as ready to process. Blocks with
transactions require UtreexoData (see InflightBlock::add_utreexo_data).
Sourcefn add_utreexo_data(
&mut self,
leaf_data: Vec<CompactLeafData>,
proof: Proof,
peer: u32,
)
fn add_utreexo_data( &mut self, leaf_data: Vec<CompactLeafData>, proof: Proof, peer: u32, )
Attaches the auxiliary utreexo data to this InflightBlock.