mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
skip hydrate if missing kernels, just request full block (#3090)
This commit is contained in:
parent
8f4a1cba67
commit
da2e752991
1 changed files with 6 additions and 5 deletions
|
@ -189,15 +189,16 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"adapter: txs from tx pool - {}, (unknown kern_ids: {})",
|
"compact_block_received: txs from tx pool - {}, (unknown kern_ids: {})",
|
||||||
txs.len(),
|
txs.len(),
|
||||||
missing_short_ids.len(),
|
missing_short_ids.len(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO - 3 scenarios here -
|
// If we have missing kernels then we know we cannot hydrate this compact block.
|
||||||
// 1) we hydrate a valid block (good to go)
|
if missing_short_ids.len() > 0 {
|
||||||
// 2) we hydrate an invalid block (txs legit missing from our pool)
|
self.request_block(&cb.header, peer_info, chain::Options::NONE);
|
||||||
// 3) we hydrate an invalid block (peer sent us a "bad" compact block) - [TBD]
|
return Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
let block = match core::Block::hydrate_from(cb.clone(), txs) {
|
let block = match core::Block::hydrate_from(cb.clone(), txs) {
|
||||||
Ok(block) => {
|
Ok(block) => {
|
||||||
|
|
Loading…
Reference in a new issue