diff options
| author | Gavin Andresen <[email protected]> | 2013-01-14 12:05:06 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-01-14 12:05:06 -0800 |
| commit | 9980d118eebb584187b2e7a6cbcaeba2ffd56cfd (patch) | |
| tree | a197c4fbaee82a53eb7027cb253a3049b14c6f33 /src | |
| parent | Merge branch 'macdeployqt_fix' of git://github.com/themighty1/bitcoin (diff) | |
| parent | If the prio. will be enough after the next block don't force fees. (diff) | |
| download | discoin-9980d118eebb584187b2e7a6cbcaeba2ffd56cfd.tar.xz discoin-9980d118eebb584187b2e7a6cbcaeba2ffd56cfd.zip | |
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]
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index c07adff6c..37b86c35b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1154,7 +1154,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins) { int64 nCredit = pcoin.first->vout[pcoin.second].nValue; - dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain(); + //The priority after the next block (depth+1) is used instead of the current, + //reflecting an assumption the user would accept a bit more delay for + //a chance at a free transaction. + dPriority += (double)nCredit * (pcoin.first->GetDepthInMainChain()+1); } int64 nChange = nValueIn - nValue - nFeeRet; |