mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-19 19:29:45 +02:00
wallet: Minimal fix to restore conflicted transaction notifications
This fix is a based on the fix by Antoine Riard <ariard@student.42.fr> in https://github.com/bitcoin/bitcoin/pull/18600. Unlike that PR, which implements some new behavior, this just restores previous wallet notification and status behavior for transactions removed from the mempool because they conflict with transactions in a block. The behavior was accidentally changed in two `CWallet::BlockConnected` updates:a31be09bfdand7e89994133from https://github.com/bitcoin/bitcoin/pull/16624, causing issue https://github.com/bitcoin/bitcoin/issues/18325. The change here could be improved and replaced with a more comprehensive cleanup, so it includes a detailed comment explaining future considerations. Fixes #18325 Co-authored-by: Antoine Riard <ariard@student.42.fr> Github-Pull: #18982 Rebased-From:b604c5c8b5
This commit is contained in:
committed by
fanquake
parent
febebc4ea6
commit
654420d6df
@@ -158,9 +158,9 @@ public:
|
||||
{
|
||||
m_notifications->transactionAddedToMempool(tx);
|
||||
}
|
||||
void TransactionRemovedFromMempool(const CTransactionRef& tx) override
|
||||
void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) override
|
||||
{
|
||||
m_notifications->transactionRemovedFromMempool(tx);
|
||||
m_notifications->transactionRemovedFromMempool(tx, reason);
|
||||
}
|
||||
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ class CRPCCommand;
|
||||
class CScheduler;
|
||||
class Coin;
|
||||
class uint256;
|
||||
enum class MemPoolRemovalReason;
|
||||
enum class RBFTransactionState;
|
||||
struct CBlockLocator;
|
||||
struct FeeCalculation;
|
||||
@@ -221,7 +222,7 @@ public:
|
||||
public:
|
||||
virtual ~Notifications() {}
|
||||
virtual void transactionAddedToMempool(const CTransactionRef& tx) {}
|
||||
virtual void transactionRemovedFromMempool(const CTransactionRef& ptx) {}
|
||||
virtual void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) {}
|
||||
virtual void blockConnected(const CBlock& block, int height) {}
|
||||
virtual void blockDisconnected(const CBlock& block, int height) {}
|
||||
virtual void updatedBlockTip() {}
|
||||
|
||||
Reference in New Issue
Block a user