mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-25 14:15:53 +00:00
error when marker does not exist (#167)
This commit is contained in:
@@ -145,7 +145,6 @@ static std::unordered_map<std::string, std::function<Result(Context const&)>>
|
||||
{"ledger_data", &doLedgerData},
|
||||
{"ledger_entry", &doLedgerEntry},
|
||||
{"ledger_range", &doLedgerRange},
|
||||
{"ledger_data", &doLedgerData},
|
||||
{"nft_buy_offers", &doNFTBuyOffers},
|
||||
{"nft_sell_offers", &doNFTSellOffers},
|
||||
{"subscribe", &doSubscribe},
|
||||
|
||||
@@ -73,6 +73,7 @@ doLedgerData(Context const& context)
|
||||
return *status;
|
||||
|
||||
auto lgrInfo = std::get<ripple::LedgerInfo>(v);
|
||||
|
||||
boost::json::object header;
|
||||
// no marker means this is the first call, so we return header info
|
||||
if (!marker)
|
||||
@@ -106,6 +107,13 @@ doLedgerData(Context const& context)
|
||||
response[JS(ledger)] = header;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!outOfOrder &&
|
||||
!context.backend->fetchLedgerObject(
|
||||
*marker, lgrInfo.seq, context.yield))
|
||||
return Status{Error::rpcINVALID_PARAMS, "markerDoesNotExist"};
|
||||
}
|
||||
|
||||
response[JS(ledger_hash)] = ripple::strHex(lgrInfo.hash);
|
||||
response[JS(ledger_index)] = lgrInfo.seq;
|
||||
|
||||
Reference in New Issue
Block a user