3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 02:35:52 +00:00

Peer: Bug fix for the case where we don't want to download even block headers.

This commit is contained in:
Mike Hearn 2015-03-05 13:43:11 -08:00
parent 6c733b2f22
commit c30df6ca25

View File

@ -1216,7 +1216,6 @@ public class Peer extends PeerSocketHandler {
public void setDownloadParameters(long secondsSinceEpoch, boolean useFilteredBlocks) {
lock.lock();
try {
Preconditions.checkNotNull(blockChain);
if (secondsSinceEpoch == 0) {
fastCatchupTimeSecs = params.getGenesisBlock().getTimeSeconds();
downloadBlockBodies = true;
@ -1224,9 +1223,8 @@ public class Peer extends PeerSocketHandler {
fastCatchupTimeSecs = secondsSinceEpoch;
// If the given time is before the current chains head block time, then this has no effect (we already
// downloaded everything we need).
if (fastCatchupTimeSecs > blockChain.getChainHead().getHeader().getTimeSeconds()) {
if (blockChain != null && fastCatchupTimeSecs > blockChain.getChainHead().getHeader().getTimeSeconds())
downloadBlockBodies = false;
}
}
this.useFilteredBlocks = useFilteredBlocks;
} finally {