mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +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
|
// out: WalletAccounts
|
||||||
JSS ( accounts_proposed ); // in: Subscribe, Unsubscribe
|
JSS ( accounts_proposed ); // in: Subscribe, Unsubscribe
|
||||||
JSS ( action );
|
JSS ( action );
|
||||||
|
JSS ( acquiring ); // out: LedgerRequest
|
||||||
JSS ( address ); // out: PeerImp
|
JSS ( address ); // out: PeerImp
|
||||||
JSS ( affected ); // out: AcceptedLedgerTx
|
JSS ( affected ); // out: AcceptedLedgerTx
|
||||||
JSS ( age ); // out: UniqueNodeList, NetworkOPs, Peers
|
JSS ( age ); // out: UniqueNodeList, NetworkOPs, Peers
|
||||||
|
|||||||
@@ -89,13 +89,20 @@ Json::Value doLedgerRequest (RPC::Context& context)
|
|||||||
|
|
||||||
if (auto il = context.app.getInboundLedgers().acquire (
|
if (auto il = context.app.getInboundLedgers().acquire (
|
||||||
*refHash, refIndex, InboundLedger::fcGENERIC))
|
*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))
|
if (auto il = context.app.getInboundLedgers().find (*refHash))
|
||||||
{
|
{
|
||||||
Json::Value jvResult = il->getJson (0);
|
Json::Value jvResult = RPC::make_error(
|
||||||
|
rpcLGR_NOT_FOUND,
|
||||||
jvResult[jss::error] = "ledgerNotFound";
|
"acquiring ledger containing requested index");
|
||||||
|
jvResult[jss::acquiring] = il->getJson (0);
|
||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user