fix verification in ethcore-sync collect_blocks (#9135)
This commit is contained in:
parent
8b6eb0c62b
commit
984674f39e
@ -477,18 +477,19 @@ impl BlockDownloader {
|
|||||||
for block_and_receipts in blocks {
|
for block_and_receipts in blocks {
|
||||||
let block = block_and_receipts.block;
|
let block = block_and_receipts.block;
|
||||||
let receipts = block_and_receipts.receipts;
|
let receipts = block_and_receipts.receipts;
|
||||||
|
|
||||||
|
// Perform basic block verification
|
||||||
|
if !Block::is_good(&block) {
|
||||||
|
debug!(target: "sync", "Bad block rlp: {:?}", block);
|
||||||
|
bad = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
let (h, number, parent) = {
|
let (h, number, parent) = {
|
||||||
let header = view!(BlockView, &block).header_view();
|
let header = view!(BlockView, &block).header_view();
|
||||||
(header.hash(), header.number(), header.parent_hash())
|
(header.hash(), header.number(), header.parent_hash())
|
||||||
};
|
};
|
||||||
|
|
||||||
// Perform basic block verification
|
|
||||||
if !Block::is_good(&block) {
|
|
||||||
debug!(target: "sync", "Bad block rlp {:?} : {:?}", h, block);
|
|
||||||
bad = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.target_hash.as_ref().map_or(false, |t| t == &h) {
|
if self.target_hash.as_ref().map_or(false, |t| t == &h) {
|
||||||
self.state = State::Complete;
|
self.state = State::Complete;
|
||||||
trace!(target: "sync", "Sync target reached");
|
trace!(target: "sync", "Sync target reached");
|
||||||
|
Loading…
Reference in New Issue
Block a user