Skip to content

Commit a0267b9

Browse files
authored
Merge pull request #1998 from jamescowens/fix_contract_replay
contract: Double the lookback scope of contract replay
2 parents e48323d + d8743b7 commit a0267b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/gridcoin/contract/contract.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,12 @@ Contract GRC::MakeLegacyContract(
413413
void GRC::ReplayContracts(const CBlockIndex* pindex)
414414
{
415415
static BlockFinder blockFinder;
416-
pindex = blockFinder.FindByMinTime(pindex->nTime - Beacon::MAX_AGE);
416+
417+
// TODO:
418+
// We have to implement a contract cache to solve the contract replay
419+
// lookback scope issues for beacons. Until then use a lookback of
420+
// double the max beacon age.
421+
pindex = blockFinder.FindByMinTime(pindex->nTime - Beacon::MAX_AGE * 2);
417422

418423
LogPrint(BCLog::LogFlags::CONTRACT,
419424
"Replaying contracts from block %" PRId64 "...", pindex->nHeight);

0 commit comments

Comments
 (0)