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

@@ -1432,12 +1432,14 @@ void Peer::recvLedger(ripple::TMLedgerData& packet)
nodeIDs.push_back(SHAMapNode(node.nodeid().data(), node.nodeid().size()));
nodeData.push_back(std::vector<unsigned char>(node.nodedata().begin(), node.nodedata().end()));
}
if (!theApp->getOPs().gotTXData(shared_from_this(), hash, nodeIDs, nodeData))
SMAddNode san = theApp->getOPs().gotTXData(shared_from_this(), hash, nodeIDs, nodeData);
if (san.isInvalid())
punishPeer(PP_UNWANTED_DATA);
return;
}
if (!theApp->getMasterLedgerAcquire().gotLedgerData(packet, shared_from_this()))
SMAddNode san = theApp->getMasterLedgerAcquire().gotLedgerData(packet, shared_from_this());
if (san.isInvalid())
punishPeer(PP_UNWANTED_DATA);
}