multiprocess: Add interfaces::Node::broadCastTransaction method

This fixes a null pointer crash in the bitcoin-gui PSBT dialog. The
bitcoin-gui interfaces::Node object has a null NodeContext pointer, and
can't broadcast transactions directly. It needs to broadcast
transactions through the bitcoin-node process instead.
This commit is contained in:
Russell Yanofsky
2021-11-12 15:20:53 -05:00
parent c9dd5c8d6e
commit 0e0f4fdd89
3 changed files with 10 additions and 2 deletions

View File

@@ -261,6 +261,10 @@ public:
LOCK(::cs_main);
return chainman().ActiveChainstate().CoinsTip().GetCoin(output, coin);
}
TransactionError broadcastTransaction(CTransactionRef tx, CAmount max_tx_fee, std::string& err_string) override
{
return BroadcastTransaction(*m_context, std::move(tx), err_string, max_tx_fee, /*relay=*/ true, /*wait_callback=*/ false);
}
WalletClient& walletClient() override
{
return *Assert(m_context->wallet_client);