pass batch to process_block and process_block_header (#1594)
* use a batch consistently when processing blocks and headers * rustfmt
This commit is contained in:
@@ -270,20 +270,13 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||
return true;
|
||||
}
|
||||
|
||||
// try to add each header to our header chain
|
||||
for bh in bhs {
|
||||
let res = w(&self.chain).sync_block_header(&bh, self.chain_opts());
|
||||
if let &Err(ref e) = &res {
|
||||
debug!(
|
||||
LOGGER,
|
||||
"Block header {} refused by chain: {:?}",
|
||||
bh.hash(),
|
||||
e
|
||||
);
|
||||
// try to add headers to our header chain
|
||||
let res = w(&self.chain).sync_block_headers(&bhs, self.chain_opts());
|
||||
if let &Err(ref e) = &res {
|
||||
debug!(LOGGER, "Block headers refused by chain: {:?}", e);
|
||||
|
||||
if e.is_bad_data() {
|
||||
return false;
|
||||
}
|
||||
if e.is_bad_data() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
|
||||
@@ -397,6 +397,7 @@ impl Server {
|
||||
// for release
|
||||
let diff_stats = {
|
||||
let diff_iter = self.chain.difficulty_iter();
|
||||
|
||||
let last_blocks: Vec<Result<(u64, Difficulty), consensus::TargetError>> =
|
||||
global::difficulty_data_to_vector(diff_iter)
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user