fn append_block(
        &mut self,
        block: &Block,
        block_contents: &BlockContents,
        signature: Option<&BlockSignature>,
    ) -> Result<(), Error> {
        // Note: This function must update every LMDB database managed by LedgerDB.
        let mut db_transaction = self.env.begin_rw_txn()?;

        self.validate_append_block(block, block_contents)?;

        self.write_key_images(block.index, &block_contents.key_images, &mut db_transaction)?;

        for tx_out in &block_contents.outputs {
            self.tx_out_store.push(tx_out, &mut db_transaction)?;
        }

        self.write_block(block, block_contents, signature, &mut db_transaction)?;
        db_transaction.commit()?;
        Ok(())
    }
/// Appends a block and its associated transactions to the blockchain.
///
/// # Arguments
/// * `block` - A block.
/// * `block_contents` - The contents of the block.
/// * `signature` - This node's signature over the block.
Appends a block and its associated transactions to the blockchain.
Appends a block and its associated transactions to the blockchain .
fn append_block(
        &mut self,
        block: &Block,
        block_contents: &BlockContents,
        signature: Option<&BlockSignature>,
    ) -> Result<(), Error> {
        // Note: This function must update every LMDB database managed by LedgerDB.
        let mut db_transaction = self.env.begin_rw_txn()?;
        self.validate_append_block(block, block_contents)?;
        self.write_key_images(block.index, &block_contents.key_images, &mut db_transaction)?;
        for tx_out in &block_contents.outputs {
            self.tx_out_store.push(tx_out, &mut db_transaction)?;
        }
        self.write_block(block, block_contents, signature, &mut db_transaction)?;
        db_transaction.commit()?;
        Ok(())
    }
fn append_block ( & mut self , block : & Block , block_contents : & BlockContents , signature : Option < & BlockSignature > , ) -> Result < ( ) , Error > { // Note: This function must update every LMDB database managed by LedgerDB. let mut db_transaction = self . env . begin_rw_txn ( ) ? ; self . validate_append_block ( block , block_contents ) ? ; self . write_key_images ( block . index , & block_contents . key_images , & mut db_transaction ) ? ; for tx_out in & block_contents . outputs { self . tx_out_store . push ( tx_out , & mut db_transaction ) ? ; } self . write_block ( block , block_contents , signature , & mut db_transaction ) ? ; db_transaction . commit ( ) ? ; Ok ( ( ) ) }
Appends a block and its associated transactions to the blockchain.
Appends a block and its associated transactions to the blockchain .
&mut self
block
&Block
block_contents
&BlockContents
signature
Option<&BlockSignature>
&mut self
block
&Block
block_contents
&BlockContents
signature
Option<&BlockSignature>