3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Fix potential headers-first NPE race

This commit is contained in:
Matt Corallo 2014-10-01 17:39:04 -07:00 committed by Mike Hearn
parent b0b8eb28d3
commit 3398216449

View File

@ -157,6 +157,10 @@ public class BitcoindComparisonTool {
return null;
} else if (m instanceof GetHeadersMessage) {
try {
if (currentBlock.block == null) {
log.info("Got a request for a header before we had even begun processing blocks!");
return null;
}
LinkedList<Block> headers = new LinkedList<Block>();
Block it = blockList.hashHeaderMap.get(currentBlock.block.getHash());
while (it != null) {