mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
wallet: Add BIP125 comment for MAXINT-1/-2 behavior
This commit is contained in:
parent
152f45ba58
commit
05fa823bf6
@ -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
|
// Note how the sequence number is set to non-maxint so that
|
||||||
// the nLockTime set above actually works.
|
// 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)
|
BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
|
||||||
txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(),
|
txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(),
|
||||||
std::numeric_limits<unsigned int>::max() - (fOptIntoFullRbf ? 2 : 1)));
|
std::numeric_limits<unsigned int>::max() - (fOptIntoFullRbf ? 2 : 1)));
|
||||||
|
Loading…
Reference in New Issue
Block a user