pub fn queue(&mut self, new: QueuedBlock) {
        let new_hash = new.0.hash;
        let new_height = new.0.height;
        let parent_hash = new.0.block.header.previous_block_hash;

        // Track known UTXOs in queued blocks.
        for (outpoint, ordered_utxo) in new.0.new_outputs.iter() {
            self.known_utxos
                .insert(*outpoint, ordered_utxo.utxo.clone());
        }

        let replaced = self.blocks.insert(new_hash, new);
        assert!(replaced.is_none(), "hashes must be unique");
        let inserted = self
            .by_height
            .entry(new_height)
            .or_default()
            .insert(new_hash);
        assert!(inserted, "hashes must be unique");
        let inserted = self
            .by_parent
            .entry(parent_hash)
            .or_default()
            .insert(new_hash);
        assert!(inserted, "hashes must be unique");

        tracing::trace!(%parent_hash, queued = %self.blocks.len(), "queued block");
        self.update_metrics();
    }
/// Queue a block for eventual verification and commit.
///
/// # Panics
///
/// - if a block with the same `block::Hash` has already been queued.
Queue a block for eventual verification and commit.
Queue a block for eventual verification and commit .
pub fn queue(&mut self, new: QueuedBlock) {
        let new_hash = new.0.hash;
        let new_height = new.0.height;
        let parent_hash = new.0.block.header.previous_block_hash;
        // Track known UTXOs in queued blocks.
        for (outpoint, ordered_utxo) in new.0.new_outputs.iter() {
            self.known_utxos
                .insert(*outpoint, ordered_utxo.utxo.clone());
        }
        let replaced = self.blocks.insert(new_hash, new);
        assert!(replaced.is_none(), "hashes must be unique");
        let inserted = self
            .by_height
            .entry(new_height)
            .or_default()
            .insert(new_hash);
        assert!(inserted, "hashes must be unique");
        let inserted = self
            .by_parent
            .entry(parent_hash)
            .or_default()
            .insert(new_hash);
        assert!(inserted, "hashes must be unique");
        tracing::trace!(%parent_hash, queued = %self.blocks.len(), "queued block");
        self.update_metrics();
    }
pub fn queue ( & mut self , new : QueuedBlock ) { let new_hash = new . 0 . hash ; let new_height = new . 0 . height ; let parent_hash = new . 0 . block . header . previous_block_hash ; // Track known UTXOs in queued blocks. for ( outpoint , ordered_utxo ) in new . 0 . new_outputs . iter ( ) { self . known_utxos . insert ( * outpoint , ordered_utxo . utxo . clone ( ) ) ; } let replaced = self . blocks . insert ( new_hash , new ) ; assert ! ( replaced is_none ( ) " " ) ; let inserted = self . by_height . entry ( new_height ) . or_default ( ) . insert ( new_hash ) ; assert ! ( inserted " " ) ; let inserted = self . by_parent . entry ( parent_hash ) . or_default ( ) . insert ( new_hash ) ; assert ! ( inserted " " ) ; tracing :: trace ! ( parent_hash queued self blocks len ( ) " " ) ; self . update_metrics ( ) ; }
Queue a block for eventual verification and commit.
Queue a block for eventual verification and commit .
&mut self
new
QueuedBlock
panics
if a block with the same `block::Hash` has already been queued.
if a block with the same ` block :: Hash ` has already been queued .