diff options
| author | Gregory Maxwell <[email protected]> | 2012-12-26 12:45:42 -0500 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2012-12-26 14:16:45 -0500 |
| commit | d7836552e64b1f949385f7b11836ece99f7c3d67 (patch) | |
| tree | 57fcff4a76e431d71754248eb2365ed3aa121715 /src/wallet.cpp | |
| parent | Merge pull request #2116 from sipa/importrescanbool (diff) | |
| download | discoin-d7836552e64b1f949385f7b11836ece99f7c3d67.tar.xz discoin-d7836552e64b1f949385f7b11836ece99f7c3d67.zip | |
If the prio. will be enough after the next block don't force fees.
If the user was really after the fastest possible confirmation times
they would be manually setting a fee. In cases where the wallet builds
a transaction with a priority that is too low to qualify as free until
the next block, go ahead without a fee. Confirmation frequently takes
multiple blocks even when a minimum fee is provided.
Diffstat (limited to 'src/wallet.cpp')
| -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; |