Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

If the prio. will be enough after the next block don't force fees. [wallet] #2129

Merged
merged 1 commit into from

5 participants

@gmaxwell
Owner

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.

@gavinandresen

ACK, but there should be a comment in the code explaining the +1

@gmaxwell gmaxwell 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.
d783655
@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/d7836552e64b1f949385f7b11836ece99f7c3d67 for binaries and test log.

@sipa
Owner

ACK

@Diapolo Diapolo commented on the diff
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,
@Diapolo
Diapolo added a note

Can we keep a space after starting comments :)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@gavinandresen gavinandresen merged commit 9980d11 into bitcoin:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 26, 2012
  1. @gmaxwell

    If the prio. will be enough after the next block don't force fees.

    gmaxwell authored
      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.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/wallet.cpp
View
5 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,
@Diapolo
Diapolo added a note

Can we keep a space after starting comments :)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ //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;
Something went wrong with that request. Please try again.