mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 13:05:53 +00:00
Fix a bug where a node doesn't get a chance to finish acquiring a TX set
before all nodes forget it because they're done with it, leaving a node behind the consensus.
This commit is contained in:
@@ -906,11 +906,32 @@ void NetworkOPs::processTrustedProposal(LedgerProposal::pointer proposal,
|
||||
|
||||
SHAMap::pointer NetworkOPs::getTXMap(const uint256& hash)
|
||||
{
|
||||
std::map<uint256, std::pair<int, SHAMap::pointer> >::iterator it = mRecentPositions.find(hash);
|
||||
if (it != mRecentPositions.end())
|
||||
return it->second.second;
|
||||
if (!haveConsensusObject())
|
||||
return SHAMap::pointer();
|
||||
return mConsensus->getTransactionTree(hash, false);
|
||||
}
|
||||
|
||||
void NetworkOPs::takePosition(int seq, SHAMap::ref position)
|
||||
{
|
||||
mRecentPositions[position->getHash()] = std::make_pair(seq, position);
|
||||
if (mRecentPositions.size() > 4)
|
||||
{
|
||||
std::map<uint256, std::pair<int, SHAMap::pointer> >::iterator it = mRecentPositions.begin();
|
||||
while (it != mRecentPositions.end())
|
||||
{
|
||||
if (it->second.first < (seq - 2))
|
||||
{
|
||||
mRecentPositions.erase(it);
|
||||
return;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SMAddNode NetworkOPs::gotTXData(const boost::shared_ptr<Peer>& peer, const uint256& hash,
|
||||
const std::list<SHAMapNode>& nodeIDs, const std::list< std::vector<unsigned char> >& nodeData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user