add hook_hash to ledger_entry rpc

This commit is contained in:
Richard Holland
2022-03-14 11:41:24 +00:00
parent a63f1ba53e
commit 1bde126fbe
2 changed files with 15 additions and 0 deletions

View File

@@ -281,6 +281,7 @@ JSS(have_transactions); // out: InboundLedger
JSS(highest_sequence); // out: AccountInfo
JSS(highest_ticket); // out: AccountInfo
JSS(historical_perminute); // historical_perminute.
JSS(hook_hash); // in: LedgerEntry
JSS(hostid); // out: NetworkOPs
JSS(hotwallet); // in: GatewayBalances
JSS(id); // websocket.

View File

@@ -328,6 +328,20 @@ doLedgerEntry(RPC::JsonContext& context)
*id, context.params[jss::ticket][jss::ticket_seq].asUInt());
}
}
else if (context.params.isMember(jss::hook_hash))
{
expectedType = ltHOOK_DEFINITION;
if (context.params[jss::hook_hash].isObject() ||
(!uNodeIndex.parseHex(context.params[jss::hook_hash].asString())))
{
uNodeIndex = beast::zero;
jvResult[jss::error] = "malformedRequest";
}
else
{
uNodeIndex = keylet::hookDefinition(uNodeIndex).key;
}
}
else
{
jvResult[jss::error] = "unknownOption";