/// Finds unknown transactions in the block and persists transactions along
/// with other info as a pending block.
///
///  # Panics
///
/// - Already there is an incomplete block.
/// - Received block has already committed transaction.
/// - Block contains a transaction that is incorrect.
Finds unknown transactions in the block and persists transactions along
with other info as a pending block.

Panics

Already there is an incomplete block.
Received block has already committed transaction.
Block contains a transaction that is incorrect.
Finds unknown transactions in the block and persists transactions along with other info as a pending block . Panics Already there is an incomplete block . Received block has already committed transaction . Block contains a transaction that is incorrect .
pub(super) fn create_incomplete_block<S: RawAccess>(
        &mut self,
        msg: &Verified<BlockResponse>,
        txs: &MapIndex<S, Hash, Verified<AnyTx>>,
        txs_pool: &KeySetIndex<S, Hash>,
    ) -> &IncompleteBlock {
        assert!(self.incomplete_block().is_none());
        let mut unknown_txs = HashSet::new();
        for hash in &msg.payload().transactions {
            if contains_transaction(hash, &txs, &self.tx_cache) {
                if !self.tx_cache.contains_key(hash) && !txs_pool.contains(hash) {
                    panic!(
                        "Received block with already \
                         committed transaction"
                    )
                }
            } else if self.invalid_txs.contains(hash) {
                panic!("Received a block with transaction known as invalid")
            } else {
                unknown_txs.insert(*hash);
            }
        }
        self.incomplete_block = Some(IncompleteBlock {
            msg: msg.clone(),
            unknown_txs,
        });
        self.incomplete_block().unwrap()
    }
pub ( super ) fn create_incomplete_block < S : RawAccess > ( & mut self , msg : & Verified < BlockResponse > , txs : & MapIndex < S , Hash , Verified < AnyTx > > , txs_pool : & KeySetIndex < S , Hash > , ) -> & IncompleteBlock { assert ! ( self incomplete_block ( ) is_none ( ) ) ; let mut unknown_txs = HashSet :: new ( ) ; for hash in & msg . payload ( ) . transactions { if contains_transaction ( hash , & txs , & self . tx_cache ) { if ! self . tx_cache . contains_key ( hash ) && ! txs_pool . contains ( hash ) { panic ! ( " \
 " ) } } else if self . invalid_txs . contains ( hash ) { panic ! ( " " ) } else { unknown_txs . insert ( * hash ) ; } } self . incomplete_block = Some ( IncompleteBlock { msg : msg . clone ( ) , unknown_txs , } ) ; self . incomplete_block ( ) . unwrap ( ) }
Finds unknown transactions in the block and persists transactions along
with other info as a pending block.
Finds unknown transactions in the block and persists transactions along with other info as a pending block .
&mut self
msg
&Verified<BlockResponse>
txs
&MapIndex<S, Hash, Verified<AnyTx>>
txs_pool
&KeySetIndex<S, Hash>