mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 19:25:51 +00:00
Improve ledger_request response
This commit is contained in:
committed by
Nik Bougalis
parent
4f40e94c99
commit
cb280b10c1
@@ -72,6 +72,7 @@ JSS ( accounts ); // in: LedgerEntry, Subscribe,
|
||||
// out: WalletAccounts
|
||||
JSS ( accounts_proposed ); // in: Subscribe, Unsubscribe
|
||||
JSS ( action );
|
||||
JSS ( acquiring ); // out: LedgerRequest
|
||||
JSS ( address ); // out: PeerImp
|
||||
JSS ( affected ); // out: AcceptedLedgerTx
|
||||
JSS ( age ); // out: UniqueNodeList, NetworkOPs, Peers
|
||||
|
||||
@@ -89,13 +89,20 @@ Json::Value doLedgerRequest (RPC::Context& context)
|
||||
|
||||
if (auto il = context.app.getInboundLedgers().acquire (
|
||||
*refHash, refIndex, InboundLedger::fcGENERIC))
|
||||
return getJson (LedgerFill (*il));
|
||||
{
|
||||
Json::Value jvResult = RPC::make_error(
|
||||
rpcLGR_NOT_FOUND,
|
||||
"acquiring ledger containing requested index");
|
||||
jvResult[jss::acquiring] = getJson (LedgerFill (*il));
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
if (auto il = context.app.getInboundLedgers().find (*refHash))
|
||||
{
|
||||
Json::Value jvResult = il->getJson (0);
|
||||
|
||||
jvResult[jss::error] = "ledgerNotFound";
|
||||
Json::Value jvResult = RPC::make_error(
|
||||
rpcLGR_NOT_FOUND,
|
||||
"acquiring ledger containing requested index");
|
||||
jvResult[jss::acquiring] = il->getJson (0);
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user