Rework the way the results of ledger and TX map acquisition is passed up and down the

call chain so that the peer logic will know how helpful peers are being, not just whether
they're sending invalid data.
This commit is contained in:
JoelKatz
2012-11-21 09:28:09 -08:00
parent f98741af3c
commit 89d54999c9
11 changed files with 155 additions and 84 deletions

View File

@@ -813,13 +813,13 @@ SHAMap::pointer NetworkOPs::getTXMap(const uint256& hash)
return mConsensus->getTransactionTree(hash, false);
}
bool NetworkOPs::gotTXData(const boost::shared_ptr<Peer>& peer, const uint256& hash,
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)
{
if (!haveConsensusObject())
{
cLog(lsWARNING) << "Got TX data with no consensus object";
return false;
return SMAddNode();
}
return mConsensus->peerGaveNodes(peer, hash, nodeIDs, nodeData);
}