Track blocks we requested, always broadcast otherwise (#2349)

This commit is contained in:
Ignotus Peverell
2019-01-12 09:28:03 -08:00
committed by GitHub
parent cf8f9d609a
commit f9a20aef0d
6 changed files with 69 additions and 46 deletions
+1 -1
View File
@@ -355,7 +355,7 @@ pub trait ChainAdapter: Sync + Send {
/// block could be handled properly and is not deemed defective by the
/// chain. Returning false means the block will never be valid and
/// may result in the peer being banned.
fn block_received(&self, b: core::Block, addr: SocketAddr) -> bool;
fn block_received(&self, b: core::Block, addr: SocketAddr, was_requested: bool) -> bool;
fn compact_block_received(&self, cb: core::CompactBlock, addr: SocketAddr) -> bool;