mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-07 18:56:41 +00:00
return no offers when an owner directory is not found (#176)
This commit is contained in:
@@ -764,7 +764,7 @@ traverseOwnedNodes(
|
||||
backend.fetchLedgerObject(currentIndex.key, sequence, yield);
|
||||
|
||||
if (!ownerDir)
|
||||
return Status(ripple::rpcACT_NOT_FOUND);
|
||||
break;
|
||||
|
||||
ripple::SerialIter it{ownerDir->data(), ownerDir->size()};
|
||||
ripple::SLE sle{it, currentIndex.key};
|
||||
|
||||
@@ -58,6 +58,12 @@ doAccountChannels(Context const& context)
|
||||
if (auto const status = getAccount(request, accountID); status)
|
||||
return status;
|
||||
|
||||
auto rawAcct = context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield);
|
||||
|
||||
if (!rawAcct)
|
||||
return Status{Error::rpcACT_NOT_FOUND, "accountNotFound"};
|
||||
|
||||
ripple::AccountID destAccount;
|
||||
if (auto const status =
|
||||
getAccount(request, destAccount, JS(destination_account));
|
||||
|
||||
@@ -28,6 +28,12 @@ doAccountCurrencies(Context const& context)
|
||||
if (auto const status = getAccount(request, accountID); status)
|
||||
return status;
|
||||
|
||||
auto rawAcct = context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield);
|
||||
|
||||
if (!rawAcct)
|
||||
return Status{Error::rpcACT_NOT_FOUND, "accountNotFound"};
|
||||
|
||||
std::set<std::string> send, receive;
|
||||
auto const addToResponse = [&](ripple::SLE const& sle) {
|
||||
if (sle.getType() == ripple::ltRIPPLE_STATE)
|
||||
|
||||
@@ -103,6 +103,12 @@ doAccountLines(Context const& context)
|
||||
if (auto const status = getAccount(request, accountID); status)
|
||||
return status;
|
||||
|
||||
auto rawAcct = context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield);
|
||||
|
||||
if (!rawAcct)
|
||||
return Status{Error::rpcACT_NOT_FOUND, "accountNotFound"};
|
||||
|
||||
ripple::AccountID peerAccount;
|
||||
if (auto const status = getAccount(request, peerAccount, JS(peer)); status)
|
||||
return status;
|
||||
|
||||
@@ -47,9 +47,10 @@ doAccountNFTs(Context const& context)
|
||||
if (!accountID)
|
||||
return Status{Error::rpcINVALID_PARAMS, "malformedAccount"};
|
||||
|
||||
// TODO: just check for existence without pulling
|
||||
if (!context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield))
|
||||
auto rawAcct = context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield);
|
||||
|
||||
if (!rawAcct)
|
||||
return Status{Error::rpcACT_NOT_FOUND, "accountNotFound"};
|
||||
|
||||
// limit controls the number of pages being returned. each page could have
|
||||
|
||||
@@ -80,6 +80,12 @@ doAccountOffers(Context const& context)
|
||||
if (auto const status = getAccount(request, accountID); status)
|
||||
return status;
|
||||
|
||||
auto rawAcct = context.backend->fetchLedgerObject(
|
||||
ripple::keylet::account(accountID).key, lgrInfo.seq, context.yield);
|
||||
|
||||
if (!rawAcct)
|
||||
return Status{Error::rpcACT_NOT_FOUND, "accountNotFound"};
|
||||
|
||||
std::uint32_t limit = 200;
|
||||
if (auto const status = getLimit(request, limit); status)
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user