Skip to content

Commit

Permalink
Remove use of IsRBFOptIn in wallet code
Browse files Browse the repository at this point in the history
This commit does not change behavior.
  • Loading branch information
ryanofsky committed Jul 31, 2017
1 parent 83be2e6 commit 8931629
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/ipc/interfaces.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef BITCOIN_IPC_INTERFACES_H
#define BITCOIN_IPC_INTERFACES_H

#include "policy/rbf.h" // For RBFTransactionState
#include "primitives/transaction.h"

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

//! Check if transaction is RBF opt in.
virtual RBFTransactionState isRBFOptIn(const CTransaction& tx) = 0;

//! Interface to let node manage chain clients (wallets, or maybe tools for
//! monitoring and analysis in the future).
class Client
Expand Down
5 changes: 5 additions & 0 deletions src/ipc/local/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ class ChainImpl : public Chain
return true;
}
int64_t getVirtualTransactionSize(const CTransaction& tx) override { return GetVirtualTransactionSize(tx); }
RBFTransactionState isRBFOptIn(const CTransaction& tx) override
{
LOCK(::mempool.cs);
return IsRBFOptIn(tx, ::mempool);
}
};

} // namespace
Expand Down
3 changes: 1 addition & 2 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ void WalletTxToJSON(ipc::Chain& ipc_chain, ipc::Chain::LockedState& ipc_locked,
// Add opt-in RBF status
std::string rbfStatus = "no";
if (confirms <= 0) {
LOCK(mempool.cs);
RBFTransactionState rbfState = IsRBFOptIn(wtx, mempool);
RBFTransactionState rbfState = ipc_chain.isRBFOptIn(wtx);
if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)
rbfStatus = "unknown";
else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)
Expand Down

0 comments on commit 8931629

Please sign in to comment.