mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
Peer: Bug fix for the case where we don't want to download even block headers.
This commit is contained in:
@@ -1216,7 +1216,6 @@ public class Peer extends PeerSocketHandler {
|
|||||||
public void setDownloadParameters(long secondsSinceEpoch, boolean useFilteredBlocks) {
|
public void setDownloadParameters(long secondsSinceEpoch, boolean useFilteredBlocks) {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
Preconditions.checkNotNull(blockChain);
|
|
||||||
if (secondsSinceEpoch == 0) {
|
if (secondsSinceEpoch == 0) {
|
||||||
fastCatchupTimeSecs = params.getGenesisBlock().getTimeSeconds();
|
fastCatchupTimeSecs = params.getGenesisBlock().getTimeSeconds();
|
||||||
downloadBlockBodies = true;
|
downloadBlockBodies = true;
|
||||||
@@ -1224,9 +1223,8 @@ public class Peer extends PeerSocketHandler {
|
|||||||
fastCatchupTimeSecs = secondsSinceEpoch;
|
fastCatchupTimeSecs = secondsSinceEpoch;
|
||||||
// If the given time is before the current chains head block time, then this has no effect (we already
|
// If the given time is before the current chains head block time, then this has no effect (we already
|
||||||
// downloaded everything we need).
|
// downloaded everything we need).
|
||||||
if (fastCatchupTimeSecs > blockChain.getChainHead().getHeader().getTimeSeconds()) {
|
if (blockChain != null && fastCatchupTimeSecs > blockChain.getChainHead().getHeader().getTimeSeconds())
|
||||||
downloadBlockBodies = false;
|
downloadBlockBodies = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.useFilteredBlocks = useFilteredBlocks;
|
this.useFilteredBlocks = useFilteredBlocks;
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user