Return actNotFound for non-existent account in traverseOwnedNodes (#382)

This commit is contained in:
CJ Cobb
2022-11-08 09:28:43 -05:00
committed by GitHub
parent 4bf3a228dc
commit ffa5c58b32
2 changed files with 7 additions and 1 deletions

View File

@@ -663,6 +663,10 @@ traverseOwnedNodes(
boost::asio::yield_context& yield,
std::function<void(ripple::SLE&&)> atOwnedNode)
{
if (!backend.fetchLedgerObject(
ripple::keylet::account(accountID).key, sequence, yield))
return Status{Error::rpcACT_NOT_FOUND};
auto parsedCursor =
parseAccountCursor(backend, sequence, jsonCursor, accountID, yield);

View File

@@ -138,7 +138,7 @@ doGatewayBalances(Context const& context)
return true;
};
traverseOwnedNodes(
auto result = traverseOwnedNodes(
*context.backend,
accountID,
lgrInfo.seq,
@@ -146,6 +146,8 @@ doGatewayBalances(Context const& context)
{},
context.yield,
addToResponse);
if (auto status = std::get_if<RPC::Status>(&result))
return *status;
if (!sums.empty())
{