diff --git a/src/ripple/protocol/jss.h b/src/ripple/protocol/jss.h index 74571fb96..05152ac6a 100644 --- a/src/ripple/protocol/jss.h +++ b/src/ripple/protocol/jss.h @@ -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. diff --git a/src/ripple/rpc/handlers/LedgerEntry.cpp b/src/ripple/rpc/handlers/LedgerEntry.cpp index 12696abb3..9c075e6b9 100644 --- a/src/ripple/rpc/handlers/LedgerEntry.cpp +++ b/src/ripple/rpc/handlers/LedgerEntry.cpp @@ -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";