mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Validate compact block header before hydrating
This commit is contained in:
parent
1e7e312cf3
commit
a6af94a76f
1 changed files with 6 additions and 1 deletions
|
@ -119,7 +119,12 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||||
// push the freshly hydrated block through the chain pipeline
|
// push the freshly hydrated block through the chain pipeline
|
||||||
self.process_block(block, addr)
|
self.process_block(block, addr)
|
||||||
} else {
|
} else {
|
||||||
// TODO - do we need to validate the header here?
|
|
||||||
|
// check at least the header is valid before hydrating
|
||||||
|
if let Err(e) = w(&self.chain).process_block_header(&cb.header, self.chain_opts()) {
|
||||||
|
debug!(LOGGER, "Invalid compact block header {}: {}", cb.hash(), e);
|
||||||
|
return !e.is_bad_data();
|
||||||
|
}
|
||||||
|
|
||||||
let txs = {
|
let txs = {
|
||||||
let tx_pool = self.tx_pool.read().unwrap();
|
let tx_pool = self.tx_pool.read().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue