Ignore blocks that are sent to us which we never requested. Updates issue 180.

This commit is contained in:
Mike Hearn 2012-05-15 22:39:20 +02:00
parent 1b1457449a
commit 2081c2234b

View file

@ -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)) {