Merge #21572: Fix wrong wallet RPC context set after #21366

937fd4a66f048780bffc5e714d0c800de987ce93 Fix wrong wallet RPC context set after #21366 (Russell Yanofsky)

Pull request description:

  This bug doesn't have any effects currently because it only affects
  external signer RPCs which aren't currently using the wallet context,
  but it does cause an appveyor failure in a upcoming PR:

  https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/38512882

  This bug is subtle and could have been avoided if JSONRPCRequest didn't
  have constructors that were so loose with type checking.  Suggested
  change
  https://github.com/bitcoin/bitcoin/pull/21366#issuecomment-792044351
  eliminates these and would be a good followup for a future PR.

  This PR just implements the simplest possible fix.

ACKs for top commit:
  theStack:
    Code-review ACK 937fd4a66f048780bffc5e714d0c800de987ce93
  meshcollider:
    Code review ACK 937fd4a66f048780bffc5e714d0c800de987ce93

Tree-SHA512: 53e6265ed6c7abb47d2b3e77d1604edfeb993c3a2440f0c19679cfeb23516965e6707ff486196a0acfbeff21c79a9a08b5cd33bae9a232d33d0134bca1bd0ff3
This commit is contained in:
MarcoFalke 2021-04-07 10:53:20 +02:00 committed by Konstantin Akimov
parent 2f7814acdd
commit c0cdb0488b
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -573,7 +573,7 @@ public:
{ {
for (const CRPCCommand& command : GetWalletRPCCommands()) { for (const CRPCCommand& command : GetWalletRPCCommands()) {
m_rpc_commands.emplace_back(command.category, command.name, [this, &command](const JSONRPCRequest& request, UniValue& result, bool last_handler) { m_rpc_commands.emplace_back(command.category, command.name, [this, &command](const JSONRPCRequest& request, UniValue& result, bool last_handler) {
return command.actor({request, m_context}, result, last_handler); return command.actor({request, &m_context}, result, last_handler);
}, command.argNames, command.unique_id); }, command.argNames, command.unique_id);
m_rpc_handlers.emplace_back(m_context.chain->handleRpc(m_rpc_commands.back())); m_rpc_handlers.emplace_back(m_context.chain->handleRpc(m_rpc_commands.back()));
} }