Skip to content

Commit 8931629

Browse files
committed
Remove use of IsRBFOptIn in wallet code
This commit does not change behavior.
1 parent 83be2e6 commit 8931629

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/ipc/interfaces.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef BITCOIN_IPC_INTERFACES_H
22
#define BITCOIN_IPC_INTERFACES_H
33

4+
#include "policy/rbf.h" // For RBFTransactionState
45
#include "primitives/transaction.h"
56

67
#include <memory>
@@ -117,6 +118,9 @@ class Chain
117118
//! Get virtual transaction size.
118119
virtual int64_t getVirtualTransactionSize(const CTransaction& tx) = 0;
119120

121+
//! Check if transaction is RBF opt in.
122+
virtual RBFTransactionState isRBFOptIn(const CTransaction& tx) = 0;
123+
120124
//! Interface to let node manage chain clients (wallets, or maybe tools for
121125
//! monitoring and analysis in the future).
122126
class Client

src/ipc/local/bitcoind.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ class ChainImpl : public Chain
124124
return true;
125125
}
126126
int64_t getVirtualTransactionSize(const CTransaction& tx) override { return GetVirtualTransactionSize(tx); }
127+
RBFTransactionState isRBFOptIn(const CTransaction& tx) override
128+
{
129+
LOCK(::mempool.cs);
130+
return IsRBFOptIn(tx, ::mempool);
131+
}
127132
};
128133

129134
} // namespace

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ void WalletTxToJSON(ipc::Chain& ipc_chain, ipc::Chain::LockedState& ipc_locked,
109109
// Add opt-in RBF status
110110
std::string rbfStatus = "no";
111111
if (confirms <= 0) {
112-
LOCK(mempool.cs);
113-
RBFTransactionState rbfState = IsRBFOptIn(wtx, mempool);
112+
RBFTransactionState rbfState = ipc_chain.isRBFOptIn(wtx);
114113
if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)
115114
rbfStatus = "unknown";
116115
else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)

0 commit comments

Comments
 (0)