Do not request a full block for invalid compact block during syncing (#1002)

This commit is contained in:
Ivan Sorokin 2018-08-01 22:09:03 +02:00 committed by Quentin Le Sceller
parent 06883e94e9
commit a638bd7499

View file

@ -157,12 +157,20 @@ impl p2p::ChainAdapter for NetToChainAdapter {
debug!(LOGGER, "adapter: successfully hydrated block from tx pool!"); debug!(LOGGER, "adapter: successfully hydrated block from tx pool!");
self.process_block(block, addr) self.process_block(block, addr)
} else { } else {
if self.sync_state.status() == SyncStatus::NoSync {
debug!( debug!(
LOGGER, LOGGER,
"adapter: block invalid after hydration, requesting full block" "adapter: block invalid after hydration, requesting full block"
); );
self.request_block(&cb.header, &addr); self.request_block(&cb.header, &addr);
true true
} else {
debug!(
LOGGER,
"adapter: block invalid after hydration, ignoring it, cause still syncing"
);
true
}
} }
} else { } else {
debug!( debug!(