mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Range of validated ledgers.
This commit is contained in:
@@ -141,6 +141,22 @@ bool LedgerMaster::haveLedger(uint32 seq)
|
||||
return mCompleteLedgers.hasValue(seq);
|
||||
}
|
||||
|
||||
bool LedgerMaster::getValidatedRange(uint32& minVal, uint32& maxVal)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
if (!mValidLedger)
|
||||
return false;
|
||||
maxVal = mValidLedger->getLedgerSeq();
|
||||
if (maxVal == 0)
|
||||
return false;
|
||||
minVal = mCompleteLedgers.prevMissing(maxVal);
|
||||
if (minVal == RangeSet::RangeSetAbsent)
|
||||
minVal = 0;
|
||||
else
|
||||
++minVal;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LedgerMaster::asyncAccept(Ledger::pointer ledger)
|
||||
{
|
||||
uint32 seq = ledger->getLedgerSeq();
|
||||
|
||||
@@ -143,6 +143,7 @@ public:
|
||||
|
||||
bool haveLedgerRange(uint32 from, uint32 to);
|
||||
bool haveLedger(uint32 seq);
|
||||
bool getValidatedRange(uint32& minVal, uint32& maxVal);
|
||||
|
||||
void resumeAcquiring();
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ public:
|
||||
bool isValidated(uint32 seq);
|
||||
bool isValidated(uint32 seq, const uint256& hash);
|
||||
bool isValidated(Ledger::ref l) { return isValidated(l->getLedgerSeq(), l->getHash()); }
|
||||
bool getValidatedRange(uint32& minVal, uint32& maxVal) { return mLedgerMaster->getValidatedRange(minVal, maxVal); }
|
||||
|
||||
SerializedValidation::ref getLastValidation() { return mLastValidation; }
|
||||
void setLastValidation(SerializedValidation::ref v) { mLastValidation = v; }
|
||||
|
||||
Reference in New Issue
Block a user