aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2015-12-03 09:53:23 +0100
committerRussell Yanofsky <[email protected]>2017-01-23 16:23:39 -0500
commit568c05a591705552b435d384e526f702e23a08c9 (patch)
tree59b00020770f1424e11508d630fbc239321d45de /src
parentMerge #9535: Split CNode::cs_vSend: message processing and message sending (diff)
downloaddiscoin-568c05a591705552b435d384e526f702e23a08c9.tar.xz
discoin-568c05a591705552b435d384e526f702e23a08c9.zip
Allow to opt-into RBF when creating a transaction
Diffstat (limited to 'src')
-rw-r--r--src/wallet/coincontrol.h4
-rw-r--r--src/wallet/wallet.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h
index eaf4ff806..4e93e929b 100644
--- a/src/wallet/coincontrol.h
+++ b/src/wallet/coincontrol.h
@@ -6,6 +6,7 @@
#define BITCOIN_WALLET_COINCONTROL_H
#include "primitives/transaction.h"
+#include "wallet/wallet.h"
/** Coin Control Features. */
class CCoinControl
@@ -24,6 +25,8 @@ public:
CFeeRate nFeeRate;
//! Override the default confirmation target, 0 = use default
int nConfirmTarget;
+ //! Signal BIP-125 replace by fee.
+ bool signalRbf;
CCoinControl()
{
@@ -40,6 +43,7 @@ public:
nFeeRate = CFeeRate(0);
fOverrideFeeRate = false;
nConfirmTarget = 0;
+ signalRbf = fWalletRbf;
}
bool HasSelected() const
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 625199809..1dddafb77 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2566,9 +2566,10 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
// to avoid conflicting with other possible uses of nSequence,
// and in the spirit of "smallest posible change from prior
// behavior."
+ bool rbf = coinControl ? coinControl->signalRbf : fWalletRbf;
for (const auto& coin : setCoins)
txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(),
- std::numeric_limits<unsigned int>::max() - (fWalletRbf ? 2 : 1)));
+ std::numeric_limits<unsigned int>::max() - (rbf ? 2 : 1)));
// Fill in dummy signatures for fee calculation.
int nIn = 0;