diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index 5fa38faf0c..66b1c48a63 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -833,7 +833,7 @@ InboundLedger::receiveNode(protocol::TMLedgerData& packet, SHAMapAddNode& san) auto const nodeKey = static_cast(treeNode.get())->peekItem()->key(); SHAMapNodeID nodeID; - if (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth)) + if (app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth)) { nodeID = SHAMapNodeID::createID(ledgerNode.nodedepth(), nodeKey); } @@ -1081,8 +1081,8 @@ InboundLedger::processData(std::shared_ptr peer, protocol::TMLedgerData& p for (auto const& ledgerNode : packet.nodes()) { if (!ledgerNode.has_nodedata() || - (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodedepth()) || - (!app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodeid())) + (app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth) && !ledgerNode.has_nodedepth()) || + (!app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth) && !ledgerNode.has_nodeid())) { JLOG(journal_.warn()) << "Got malformed ledger node"; peer->charge(Resource::feeMalformedRequest, "ledger_node"); diff --git a/src/xrpld/app/ledger/detail/InboundLedgers.cpp b/src/xrpld/app/ledger/detail/InboundLedgers.cpp index f19ef5db5d..7889927d0c 100644 --- a/src/xrpld/app/ledger/detail/InboundLedgers.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedgers.cpp @@ -219,10 +219,7 @@ public: for (int i = 0; i < packet_ptr->nodes().size(); ++i) { auto const& ledgerNode = packet_ptr->nodes(i); - - if (!ledgerNode.has_nodedata() || - (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodedepth()) || - (!app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodeid())) + if (!ledgerNode.has_nodedata()) return; auto treeNode = SHAMapTreeNode::makeFromWire(makeSlice(ledgerNode.nodedata())); diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index 6be03e7ab4..61b5f9484b 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -134,8 +134,8 @@ public: for (auto const& ledgerNode : packet.nodes()) { if (!ledgerNode.has_nodedata() || - (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodedepth()) || - (!app_.getAmendmentTable().isSupported(fixLedgerNodeDepth) && !ledgerNode.has_nodeid())) + (app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth) && !ledgerNode.has_nodedepth()) || + (!app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth) && !ledgerNode.has_nodeid())) { JLOG(j_.warn()) << "Got malformed ledger node"; peer->charge(Resource::feeMalformedRequest, "ledger_node"); @@ -153,7 +153,7 @@ public: auto const nodeKey = static_cast(treeNode.get())->peekItem()->key(); SHAMapNodeID nodeID; - if (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth)) + if (app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth)) { nodeID = SHAMapNodeID::createID(ledgerNode.nodedepth(), nodeKey); } diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index ba26b45fa4..2c371aba7e 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -3154,7 +3154,7 @@ PeerImp::processLedgerRequest(std::shared_ptr const& m) break; protocol::TMLedgerNode* node{ledgerData.add_nodes()}; node->set_nodedata(d.second.data(), d.second.size()); - if (app_.getAmendmentTable().isSupported(fixLedgerNodeDepth)) + if (app_.getAmendmentTable().isEnabled(fixLedgerNodeDepth)) node->set_nodedepth(d.first.getDepth()); else node->set_nodeid(d.first.getRawString());