diff --git a/src/blockchaintree.rs b/src/blockchaintree.rs index 079d9ff..0add674 100644 --- a/src/blockchaintree.rs +++ b/src/blockchaintree.rs @@ -7,12 +7,11 @@ use crate::{ merkletree, static_values::{ self, AMOUNT_SUMMARY, BLOCKS_PER_EPOCH, BYTE_GAS_PRICE, COINS_PER_CYCLE, GAS_SUMMARY, - MAIN_CHAIN_PAYMENT, OLD_AMOUNT_SUMMARY, OLD_GAS_SUMMARY, ROOT_PUBLIC_ADDRESS, + OLD_AMOUNT_SUMMARY, OLD_GAS_SUMMARY, ROOT_PUBLIC_ADDRESS, }, tools, transaction::Transaction, transaction::Transactionable, - txpool, types::Hash, }; use error_stack::{Report, ResultExt}; diff --git a/src/chain.rs b/src/chain.rs index 1d0c2ab..6469012 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -162,7 +162,8 @@ impl MainChain { .change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig)) .attach_printable("failed to write height")?; - file.write_all(self.difficulty.read().as_ref()) + let difficulty = *self.difficulty.read(); + file.write_all(&difficulty) .await .change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig)) .attach_printable("failed to write difficulty")?; @@ -540,7 +541,8 @@ impl DerivativeChain { .change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig)) .attach_printable("failed to write height")?; - file.write_all(self.difficulty.read().as_ref()) + let difficulty = *self.difficulty.read(); + file.write_all(&difficulty) .await .change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig)) .attach_printable("failed to write difficulty")?;