mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge pull request #2945 from gmaxwell/fee-logic_encourage_sweeping
[Fee logic] Don't count txins for priority to encourage sweeping.
This commit is contained in:
commit
bd48a4fe49
2 changed files with 23 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue