Skip to content

Commit 494afee

Browse files
author
evan82
committed
Merge pull request #439 from UdjinM6/v0.12.0.x_revert_lower_fee
V0.12.0.x revert attempts to lower fee
2 parents 45cd565 + 990e32f commit 494afee

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

src/wallet.cpp

+4-18
Original file line numberDiff line numberDiff line change
@@ -2036,8 +2036,6 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
20362036
if(useIX && nFeePay < CENT) nFeePay = CENT;
20372037

20382038
CAmount nValue = 0;
2039-
CAmount nFeeDelta = 0;
2040-
int nAttemptsToLowerFee = 0;
20412039

20422040
BOOST_FOREACH (const PAIRTYPE(CScript, CAmount)& s, vecSend)
20432041
{
@@ -2069,7 +2067,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
20692067
txNew.vout.clear();
20702068
wtxNew.fFromMe = true;
20712069

2072-
CAmount nTotalValue = nValue + nFeeRet + nFeeDelta;
2070+
CAmount nTotalValue = nValue + nFeeRet;
20732071
double dPriority = 0;
20742072
// vouts to the payees
20752073
BOOST_FOREACH (const PAIRTYPE(CScript, CAmount)& s, vecSend)
@@ -2163,10 +2161,8 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
21632161
CTxOut newTxOut(nChange, scriptChange);
21642162

21652163
// Never create dust outputs; if we would, just
2166-
// add the dust to the fee
2167-
// OR if we didn't try to lower fees yet,
2168-
// let's see what fee we can get if there is no change
2169-
if (newTxOut.IsDust(::minRelayTxFee) || nAttemptsToLowerFee == 0)
2164+
// add the dust to the fee.
2165+
if (newTxOut.IsDust(::minRelayTxFee))
21702166
{
21712167
nFeeRet += nChange;
21722168
nChange = 0;
@@ -2231,19 +2227,9 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
22312227
return false;
22322228
}
22332229

2234-
if (nFeeRet == nFeeNeeded || // Done, enough fee included
2235-
(nFeeRet > nFeeNeeded && (nAttemptsToLowerFee > 1 || coin_type == ONLY_DENOMINATED)))
2230+
if (nFeeRet >= nFeeNeeded) // Done, enough fee included
22362231
break;
22372232

2238-
if (nFeeRet > nFeeNeeded) {
2239-
// Try to lower fee
2240-
nAttemptsToLowerFee++;
2241-
nFeeDelta = nFeeRet - nFeeNeeded;
2242-
}
2243-
else {
2244-
nFeeDelta = 0; //not enough fee so no delta too
2245-
}
2246-
22472233
// Include more fee and try again.
22482234
nFeeRet = nFeeNeeded;
22492235
continue;

0 commit comments

Comments
 (0)