Copilot review feedback

This commit is contained in:
Bart
2026-03-01 15:10:57 -05:00
parent ddc15ad612
commit ebf336f472
3 changed files with 4 additions and 4 deletions

View File

@@ -486,7 +486,7 @@ SHAMap::addRootNode(
intr_ptr::SharedPtr<SHAMapTreeNode> rootNode,
SHAMapSyncFilter const* filter)
{
XRPL_ASSERT(rootNode, "xrpl::SHAMap::addKnownNode : non-null root node");
XRPL_ASSERT(rootNode, "xrpl::SHAMap::addRootNode : non-null root node");
if (!rootNode)
{
JLOG(journal_.error()) << "Null node received";

View File

@@ -1,5 +1,3 @@
#include <test/jtx.h>
#include <test/jtx/Env.h>
#include <test/shamap/common.h>
#include <xrpld/app/ledger/detail/LedgerNodeHelpers.h>

View File

@@ -3252,6 +3252,8 @@ PeerImp::processLedgerRequest(std::shared_ptr<protocol::TMGetLedger> const& m)
try
{
auto const useLedgerNodeDepth = supportsFeature(ProtocolFeature::LedgerNodeDepth);
if (map->getNodeFat(*shaMapNodeId, data, fatLeaves, queryDepth))
{
JLOG(p_journal_.trace())
@@ -3271,7 +3273,7 @@ PeerImp::processLedgerRequest(std::shared_ptr<protocol::TMGetLedger> const& m)
// we always set the node ID. However, when it is supported then we only set
// it for inner nodes, while for leaf nodes we set the node depth instead.
auto const& nodeID = std::get<0>(d);
if (!supportsFeature(ProtocolFeature::LedgerNodeDepth))
if (!useLedgerNodeDepth)
node->set_nodeid(nodeID.getRawString());
else if (std::get<2>(d))
node->set_depth(nodeID.getDepth());