Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 5d5b75a

Browse files
debris5chdn
authored andcommitted
fix verification in ethcore-sync collect_blocks (#9135)
1 parent af16371 commit 5d5b75a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ethcore/sync/src/block_sync.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,19 @@ impl BlockDownloader {
477477
for block_and_receipts in blocks {
478478
let block = block_and_receipts.block;
479479
let receipts = block_and_receipts.receipts;
480-
let (h, number, parent) = {
481-
let header = view!(BlockView, &block).header_view();
482-
(header.hash(), header.number(), header.parent_hash())
483-
};
484480

485481
// Perform basic block verification
486482
if !Block::is_good(&block) {
487-
debug!(target: "sync", "Bad block rlp {:?} : {:?}", h, block);
483+
debug!(target: "sync", "Bad block rlp: {:?}", block);
488484
bad = true;
489485
break;
490486
}
491487

488+
let (h, number, parent) = {
489+
let header = view!(BlockView, &block).header_view();
490+
(header.hash(), header.number(), header.parent_hash())
491+
};
492+
492493
if self.target_hash.as_ref().map_or(false, |t| t == &h) {
493494
self.state = State::Complete;
494495
trace!(target: "sync", "Sync target reached");

0 commit comments

Comments
 (0)