diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-14 12:05:06 -0800 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-14 12:05:06 -0800 |
commit | 9980d118eebb584187b2e7a6cbcaeba2ffd56cfd (patch) | |
tree | a197c4fbaee82a53eb7027cb253a3049b14c6f33 /src | |
parent | 1eca3a0f0dfb31d57a7d2b0a43cc14b67f501c44 (diff) | |
parent | d7836552e64b1f949385f7b11836ece99f7c3d67 (diff) |
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 c07adff6c6..37b86c35b5 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; |