diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index 2872263f1..9155dfb80 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -367,16 +367,16 @@ fn validate_block_via_txhashset(b: &Block, ext: &mut txhashset::Extension) -> Re } /// Officially adds the block to our chain. -fn add_block(b: &Block, store: Arc, batch: &mut store::Batch) -> Result<(), Error> { +fn add_block( + b: &Block, + store: Arc, + batch: &mut store::Batch, +) -> Result<(), Error> { batch .save_block(b) .map_err(|e| Error::StoreErr(e, "pipe save block".to_owned()))?; let bitmap = store.build_and_cache_block_input_bitmap(&b)?; - batch - .save_block_input_bitmap( - &b.hash(), - &bitmap - )?; + batch.save_block_input_bitmap(&b.hash(), &bitmap)?; Ok(()) } diff --git a/chain/src/store.rs b/chain/src/store.rs index b200cafd7..fa590c9bf 100644 --- a/chain/src/store.rs +++ b/chain/src/store.rs @@ -160,7 +160,6 @@ impl ChainStore { ) } - pub fn build_block_input_bitmap(&self, block: &Block) -> Result { let bitmap = block .inputs @@ -353,8 +352,10 @@ impl<'a> Batch<'a> { } pub fn save_block_input_bitmap(&self, bh: &Hash, bm: &Bitmap) -> Result<(), Error> { - self.db - .put(&to_key(BLOCK_INPUT_BITMAP_PREFIX, &mut bh.to_vec())[..], bm.serialize()) + self.db.put( + &to_key(BLOCK_INPUT_BITMAP_PREFIX, &mut bh.to_vec())[..], + bm.serialize(), + ) } pub fn delete_block_input_bitmap(&self, bh: &Hash) -> Result<(), Error> { diff --git a/chain/src/txhashset.rs b/chain/src/txhashset.rs index cf1513822..9151b5170 100644 --- a/chain/src/txhashset.rs +++ b/chain/src/txhashset.rs @@ -343,7 +343,10 @@ where match res { Err(e) => { - debug!(LOGGER, "Error returned, discarding txhashset extension: {:?}", e); + debug!( + LOGGER, + "Error returned, discarding txhashset extension: {:?}", e + ); trees.output_pmmr_h.backend.discard(); trees.rproof_pmmr_h.backend.discard(); trees.kernel_pmmr_h.backend.discard(); @@ -798,7 +801,8 @@ impl<'a> Extension<'a> { let rewind_rm_pos = input_pos_to_rewind(self.commit_index.clone(), block_header, head_header)?; if !rewind_rm_pos.0 { - self.batch.save_block_input_bitmap(&head_header.hash(), &rewind_rm_pos.1)?; + self.batch + .save_block_input_bitmap(&head_header.hash(), &rewind_rm_pos.1)?; } self.rewind_to_pos(