[][src]Function grin_chain::txhashset::extending

pub fn extending<'a, F, T>(
    header_pmmr: &'a mut PMMRHandle<BlockHeader>,
    trees: &'a mut TxHashSet,
    batch: &'a mut Batch,
    inner: F
) -> Result<T, Error> where
    F: FnOnce(&mut ExtensionPair) -> Result<T, Error>, 

Starts a new unit of work to extend the chain with additional blocks, accepting a closure that will work within that unit of work. The closure has access to an Extension object that allows the addition of blocks to the txhashset and the checking of the current tree roots.

If the closure returns an error, modifications are canceled and the unit of work is abandoned. Otherwise, the unit of work is permanently applied.