Improve ledger replay logic

Build a replay structure holding the transactions
in execution order along with the close time. Use
this structure when replaying a ledger close.
This commit is contained in:
JoelKatz
2015-09-03 10:51:16 -07:00
committed by Nik Bougalis
parent 0c7a7903b6
commit 8f09d3449d
5 changed files with 85 additions and 18 deletions

View File

@@ -96,6 +96,9 @@ public:
CanonicalTXSet mHeldTransactions;
// A set of transactions to replay during the next close
std::unique_ptr<LedgerReplay> replayData;
LockType mCompleteLock;
RangeSet mCompleteLedgers;
@@ -1538,6 +1541,16 @@ public:
mLedgerHistory.clearLedgerCachePrior (seq);
}
void takeReplay (std::unique_ptr<LedgerReplay> replay) override
{
replayData = std::move (replay);
}
std::unique_ptr<LedgerReplay> releaseReplay () override
{
return std::move (replayData);
}
// Fetch packs:
void gotFetchPack (
bool progress,