mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
Ignore blocks that are sent to us which we never requested. Updates issue 180.
This commit is contained in:
parent
1b1457449a
commit
2081c2234b
1 changed files with 4 additions and 0 deletions
|
@ -334,6 +334,10 @@ public class Peer {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!downloadData) {
|
||||
log.warn("Received block we did not ask for: {}", m.getHashAsString());
|
||||
return;
|
||||
}
|
||||
// Otherwise it's a block sent to us because the peer thought we needed it, so add it to the block chain.
|
||||
// This call will synchronize on blockChain.
|
||||
if (blockChain.add(m)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue