refactor: replace RegisterWalletRPCCommands with GetWalletRPCCommands

This commit is contained in:
Russell Yanofsky
2020-05-28 02:13:19 -04:00
parent 55b4c65bd1
commit e783197bf0
3 changed files with 10 additions and 9 deletions

View File

@@ -4263,7 +4263,7 @@ UniValue removeprunedfunds(const JSONRPCRequest& request);
UniValue importmulti(const JSONRPCRequest& request);
UniValue importdescriptors(const JSONRPCRequest& request);
void RegisterWalletRPCCommands(interfaces::Chain& chain, std::vector<std::unique_ptr<interfaces::Handler>>& handlers)
Span<const CRPCCommand> GetWalletRPCCommands()
{
// clang-format off
static const CRPCCommand commands[] =
@@ -4329,9 +4329,7 @@ static const CRPCCommand commands[] =
{ "wallet", "walletprocesspsbt", &walletprocesspsbt, {"psbt","sign","sighashtype","bip32derivs"} },
};
// clang-format on
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
handlers.emplace_back(chain.handleRpc(commands[vcidx]));
return MakeSpan(commands);
}
interfaces::Chain* g_rpc_chain = nullptr;