mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user