diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-03-17 15:31:21 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-03-17 15:31:52 +0100 |
commit | 9c7b7cf0bb579714b35f7c88db20a407dfc716bd (patch) | |
tree | b664a39dcd4e2e6f26e923f963af14a7386529fe /src/wallet | |
parent | a387d3a807f86cbe97a3ed8c073ee34eb1d5dbb1 (diff) | |
parent | c4e4792c537bae6228fc3438dd971634985922f4 (diff) |
Merge #9592: [Qt] Add checkbox in the GUI to opt-in to RBF when creating a transaction
c4e4792 [Qt] Change RBF checkbox to reflect -walletrbf setting (Russell Yanofsky)
838a58e [Qt] Add simple optin-RBF checkbox and confirmation info (Jonas Schnelli)
568c05a Allow to opt-into RBF when creating a transaction (Jonas Schnelli)
Tree-SHA512: 3d52dcd4e44da8aed4d631748074afef78d38c860f2a8b95323f4801a989d6599a3498a753fc10daba4098c527ef5a0eb942e5b3f1bfd656e1a6bd272b8e6c57
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/coincontrol.h | 4 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index eaf4ff8062..4e93e929be 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 9e3c8be3f2..445e40b043 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2517,9 +2517,10 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT // to avoid conflicting with other possible uses of nSequence, // and in the spirit of "smallest possible 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. if (!DummySignTx(txNew, setCoins)) { |