aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-08-26 12:13:48 +0200
committerWladimir J. van der Laan <[email protected]>2016-08-26 12:57:28 +0200
commit05fa823bf60d21049caebc64dd5c5add8ba4ee10 (patch)
treead2cc4a0aad3ecae659158affa6a98cd2d3a8091 /src/wallet/wallet.cpp
parentAdd option to opt into full-RBF when sending funds (diff)
downloaddiscoin-05fa823bf60d21049caebc64dd5c5add8ba4ee10.tar.xz
discoin-05fa823bf60d21049caebc64dd5c5add8ba4ee10.zip
wallet: Add BIP125 comment for MAXINT-1/-2 behavior
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index c804d79c2..5542a536e 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2358,6 +2358,12 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
//
// Note how the sequence number is set to non-maxint so that
// the nLockTime set above actually works.
+ //
+ // BIP125 defines opt-in RBF as any nSequence < maxint-1, so
+ // we use the highest possible value in that range (maxint-2)
+ // to avoid conflicting with other possible uses of nSequence,
+ // and in the spirit of "smallest posible change from prior
+ // behavior."
BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(),
std::numeric_limits<unsigned int>::max() - (fOptIntoFullRbf ? 2 : 1)));