mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-22 04:35:50 +00:00
error when marker does not exist (#167)
This commit is contained in:
@@ -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