Skip to content

Commit 9980d11

Browse files
committed
Merge pull request #2129 from gmaxwell/wallet_less_frequent_fees
If the prio. will be enough after the next block don't force fees. [wallet]
2 parents 1eca3a0 + d783655 commit 9980d11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
11541154
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
11551155
{
11561156
int64 nCredit = pcoin.first->vout[pcoin.second].nValue;
1157-
dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain();
1157+
//The priority after the next block (depth+1) is used instead of the current,
1158+
//reflecting an assumption the user would accept a bit more delay for
1159+
//a chance at a free transaction.
1160+
dPriority += (double)nCredit * (pcoin.first->GetDepthInMainChain()+1);
11581161
}
11591162

11601163
int64 nChange = nValueIn - nValue - nFeeRet;

0 commit comments

Comments
 (0)