diff options
| author | Gavin Andresen <[email protected]> | 2013-10-19 23:05:04 -0700 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-10-19 23:05:04 -0700 |
| commit | bd48a4fe492b46708a0397c6330f06fcc80aee0b (patch) | |
| tree | 1bac0297ba887a4b65499ca1d92f388687de2e4c /src/wallet.cpp | |
| parent | Merge pull request #2884 from gavinandresen/canonicalsizes2 (diff) | |
| parent | [Fee logic] Don't count txins for priority to encourage sweeping. (diff) | |
| download | discoin-bd48a4fe492b46708a0397c6330f06fcc80aee0b.tar.xz discoin-bd48a4fe492b46708a0397c6330f06fcc80aee0b.zip | |
Merge pull request #2945 from gmaxwell/fee-logic_encourage_sweeping
[Fee logic] Don't count txins for priority to encourage sweeping.
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 03d79406d..6f61cfc73 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1300,7 +1300,15 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, strFailReason = _("Transaction too large"); return false; } - dPriority /= nBytes; + unsigned int nTxSizeMod = nBytes; + // See miner.c's dPriority logic for the matching network-node side code. + BOOST_FOREACH(const CTxIn& txin, (*(CTransaction*)&wtxNew).vin) + { + unsigned int offset = 41U + min(110U, (unsigned int)txin.scriptSig.size()); + if (nTxSizeMod > offset) + nTxSizeMod -= offset; + } + dPriority /= nTxSizeMod; // Check that enough fee is included int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000); |