mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +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()
|
void LedgerAcquire::checkLocal()
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||||
if (mComplete)
|
if (isDone())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tryLocal())
|
if (tryLocal())
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ bool LedgerMaster::acquireMissingLedger(Ledger::ref origLedger, const uint256& l
|
|||||||
{
|
{
|
||||||
typedef std::pair<uint32, uint256> u_pair;
|
typedef std::pair<uint32, uint256> u_pair;
|
||||||
std::vector<u_pair> vec = origLedger->getLedgerHashes();
|
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) &&
|
if ((fetchCount < fetchMax) && (it.first < ledgerSeq) &&
|
||||||
!mCompleteLedgers.hasValue(it.first) && !theApp->getMasterLedgerAcquire().find(it.second))
|
!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());
|
setFullLedger(acq->getLedger());
|
||||||
mLedgerHistory.addAcceptedLedger(acq->getLedger(), false);
|
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)
|
void SHAMap::fetchRoot(const uint256& hash, SHAMapSyncFilter* filter)
|
||||||
{
|
{
|
||||||
|
if (hash == root->getNodeHash())
|
||||||
|
return;
|
||||||
if (sLog(lsTRACE))
|
if (sLog(lsTRACE))
|
||||||
{
|
{
|
||||||
if (mType == smtTRANSACTION)
|
if (mType == smtTRANSACTION)
|
||||||
|
|||||||
@@ -136,13 +136,13 @@ std::vector<uint256> SHAMap::getNeededHashes(int max, SHAMapSyncFilter* filter)
|
|||||||
if (!node->isEmptyBranch(branch))
|
if (!node->isEmptyBranch(branch))
|
||||||
{
|
{
|
||||||
const uint256& childHash = node->getChildHash(branch);
|
const uint256& childHash = node->getChildHash(branch);
|
||||||
SHAMapNode childID = node->getChildNodeID(branch);
|
|
||||||
if (!fullBelowCache.isPresent(childHash))
|
if (!fullBelowCache.isPresent(childHash))
|
||||||
{
|
{
|
||||||
|
SHAMapNode childID = node->getChildNodeID(branch);
|
||||||
SHAMapTreeNode* d = NULL;
|
SHAMapTreeNode* d = NULL;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
d = getNodePointer(node->getChildNodeID(branch), childHash);
|
d = getNodePointer(childID, childHash);
|
||||||
assert(d);
|
assert(d);
|
||||||
}
|
}
|
||||||
catch (SHAMapMissingNode&)
|
catch (SHAMapMissingNode&)
|
||||||
|
|||||||
Reference in New Issue
Block a user