forked from Qortal/qortal
Skip trimming while performing synchronization
This commit is contained in:
parent
38a64bdd9e
commit
0389007491
@ -30,6 +30,10 @@ public class AtStatesTrimmer implements Runnable {
|
|||||||
if (chainTip == null || NTP.getTime() == null)
|
if (chainTip == null || NTP.getTime() == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Don't even attempt if we're mid-sync as our repository requests will be delayed for ages
|
||||||
|
if (Controller.getInstance().isSynchronizing())
|
||||||
|
continue;
|
||||||
|
|
||||||
long currentTrimmableTimestamp = NTP.getTime() - Settings.getInstance().getAtStatesMaxLifetime();
|
long currentTrimmableTimestamp = NTP.getTime() - Settings.getInstance().getAtStatesMaxLifetime();
|
||||||
// We want to keep AT states near the tip of our copy of blockchain so we can process/orphan nearby blocks
|
// We want to keep AT states near the tip of our copy of blockchain so we can process/orphan nearby blocks
|
||||||
long chainTrimmableTimestamp = chainTip.getTimestamp() - Settings.getInstance().getAtStatesMaxLifetime();
|
long chainTrimmableTimestamp = chainTip.getTimestamp() - Settings.getInstance().getAtStatesMaxLifetime();
|
||||||
|
@ -32,6 +32,10 @@ public class OnlineAccountsSignaturesTrimmer implements Runnable {
|
|||||||
if (chainTip == null || NTP.getTime() == null)
|
if (chainTip == null || NTP.getTime() == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Don't even attempt if we're mid-sync as our repository requests will be delayed for ages
|
||||||
|
if (Controller.getInstance().isSynchronizing())
|
||||||
|
continue;
|
||||||
|
|
||||||
// Trim blockchain by removing 'old' online accounts signatures
|
// Trim blockchain by removing 'old' online accounts signatures
|
||||||
long upperTrimmableTimestamp = NTP.getTime() - BlockChain.getInstance().getOnlineAccountSignaturesMaxLifetime();
|
long upperTrimmableTimestamp = NTP.getTime() - BlockChain.getInstance().getOnlineAccountSignaturesMaxLifetime();
|
||||||
int upperTrimmableHeight = repository.getBlockRepository().getHeightFromTimestamp(upperTrimmableTimestamp);
|
int upperTrimmableHeight = repository.getBlockRepository().getHeightFromTimestamp(upperTrimmableTimestamp);
|
||||||
|
Loading…
Reference in New Issue
Block a user