Add NetworkOPs::isValidate functions to check if a ledger is fully validated.

This commit is contained in:
JoelKatz
2013-02-15 19:01:48 -08:00
parent fd009a750a
commit 862dbd7234
4 changed files with 27 additions and 3 deletions

View File

@@ -119,6 +119,19 @@ bool NetworkOPs::haveLedger(uint32 seq)
return mLedgerMaster->haveLedger(seq);
}
bool NetworkOPs::isValidated(uint32 seq, const uint256& hash)
{
if (!isValidated(seq))
return false;
return mLedgerMaster->getHashBySeq(seq) == hash;
}
bool NetworkOPs::isValidated(uint32 seq)
{ // use when ledger was retrieved by seq
return haveLedger(seq) && (seq <= mLedgerMaster->getValidatedLedger()->getLedgerSeq());
}
bool NetworkOPs::addWantedHash(const uint256& h)
{
boost::recursive_mutex::scoped_lock sl(mWantedHashLock);