mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 03:51:23 +00:00
Fix potential headers-first NPE race
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user