Skip to content

Commit 753f944

Browse files
authored
Merge pull request #602 from Syn-McJ/fix/transaction-cashing
fix: don't cache recent transactions during syncing
2 parents b6a82ef + a93b104 commit 753f944

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

DashSync/shared/Models/Transactions/Base/DSTransaction.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ - (uint64_t)dashAmount {
360360
amount = 0;
361361
}
362362

363-
self.cachedDashAmount = amount;
363+
BOOL isChainSynced = self.chain.chainManager.syncPhase == DSChainSyncPhase_Synced;
364+
365+
if (isChainSynced || self.timestamp + (30 * 60) < [[NSDate date] timeIntervalSince1970]) {
366+
// Don't cache recent transactions if still syncing
367+
self.cachedDashAmount = amount;
368+
}
364369

365370
return amount;
366371
}

0 commit comments

Comments
 (0)