mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 07:25:51 +00:00
More fetch fixes.
This commit is contained in:
@@ -109,7 +109,7 @@ LedgerAcquire::LedgerAcquire(const uint256& hash, uint32 seq) : PeerSet(hash, LE
|
||||
void LedgerAcquire::checkLocal()
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
if (mComplete)
|
||||
if (isDone())
|
||||
return;
|
||||
|
||||
if (tryLocal())
|
||||
|
||||
@@ -265,7 +265,7 @@ bool LedgerMaster::acquireMissingLedger(Ledger::ref origLedger, const uint256& l
|
||||
{
|
||||
typedef std::pair<uint32, uint256> u_pair;
|
||||
std::vector<u_pair> vec = origLedger->getLedgerHashes();
|
||||
BOOST_FOREACH(const u_pair& it, vec)
|
||||
BOOST_REVERSE_FOREACH(const u_pair& it, vec)
|
||||
{
|
||||
if ((fetchCount < fetchMax) && (it.first < ledgerSeq) &&
|
||||
!mCompleteLedgers.hasValue(it.first) && !theApp->getMasterLedgerAcquire().find(it.second))
|
||||
@@ -277,7 +277,8 @@ bool LedgerMaster::acquireMissingLedger(Ledger::ref origLedger, const uint256& l
|
||||
setFullLedger(acq->getLedger());
|
||||
mLedgerHistory.addAcceptedLedger(acq->getLedger(), false);
|
||||
}
|
||||
else ++fetchCount;
|
||||
else
|
||||
++fetchCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,6 +733,8 @@ SHAMapTreeNode::pointer SHAMap::fetchNodeExternal(const SHAMapNode& id, const ui
|
||||
|
||||
void SHAMap::fetchRoot(const uint256& hash, SHAMapSyncFilter* filter)
|
||||
{
|
||||
if (hash == root->getNodeHash())
|
||||
return;
|
||||
if (sLog(lsTRACE))
|
||||
{
|
||||
if (mType == smtTRANSACTION)
|
||||
|
||||
@@ -136,13 +136,13 @@ std::vector<uint256> SHAMap::getNeededHashes(int max, SHAMapSyncFilter* filter)
|
||||
if (!node->isEmptyBranch(branch))
|
||||
{
|
||||
const uint256& childHash = node->getChildHash(branch);
|
||||
SHAMapNode childID = node->getChildNodeID(branch);
|
||||
if (!fullBelowCache.isPresent(childHash))
|
||||
{
|
||||
SHAMapNode childID = node->getChildNodeID(branch);
|
||||
SHAMapTreeNode* d = NULL;
|
||||
try
|
||||
{
|
||||
d = getNodePointer(node->getChildNodeID(branch), childHash);
|
||||
d = getNodePointer(childID, childHash);
|
||||
assert(d);
|
||||
}
|
||||
catch (SHAMapMissingNode&)
|
||||
|
||||
Reference in New Issue
Block a user