mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +00:00
Charge peers for invalid data
This commit is contained in:
@@ -1088,12 +1088,22 @@ InboundLedger::processData(std::shared_ptr<Peer> peer, protocol::TMLedgerData& p
|
||||
!takeAsRootNode(packet.nodes(1).nodedata(), san))
|
||||
{
|
||||
JLOG(journal_.warn()) << "Included AS root invalid";
|
||||
if (san.isInvalid())
|
||||
{
|
||||
peer->charge(Resource::kFeeInvalidData, "ledger_data invalid AS root");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!haveTransactions_ && (packet.nodes().size() > 2) &&
|
||||
!takeTxRootNode(packet.nodes(2).nodedata(), san))
|
||||
{
|
||||
JLOG(journal_.warn()) << "Included TX root invalid";
|
||||
if (san.isInvalid())
|
||||
{
|
||||
peer->charge(Resource::kFeeInvalidData, "ledger_data invalid TX root");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
|
||||
Reference in New Issue
Block a user