mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
interfaces: Change getUnspentOutput return type to avoid multiprocess segfault
Coin serialize method segfaults if IsSpent condition is true. This caused multiprocess code to segfault when serializing the Coin& output argument to of the Node::getUnspentOutput method if the coin was not found. Segfault could be triggered by double clicking and viewing transaction details in the GUI transaction list. Fix this by replacing Coin& output argument with optional<Coin> return value to avoid trying to serializing spent coins.
This commit is contained in:
@@ -204,8 +204,8 @@ public:
|
||||
//! Unset RPC timer interface.
|
||||
virtual void rpcUnsetTimerInterface(RPCTimerInterface* iface) = 0;
|
||||
|
||||
//! Get unspent outputs associated with a transaction.
|
||||
virtual bool getUnspentOutput(const COutPoint& output, Coin& coin) = 0;
|
||||
//! Get unspent output associated with a transaction.
|
||||
virtual std::optional<Coin> getUnspentOutput(const COutPoint& output) = 0;
|
||||
|
||||
//! Broadcast transaction.
|
||||
virtual TransactionError broadcastTransaction(CTransactionRef tx, CAmount max_tx_fee, std::string& err_string) = 0;
|
||||
|
||||
Reference in New Issue
Block a user