diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2014-07-03 14:25:32 -0400 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2014-07-03 14:42:16 -0400 |
commit | 13fc83c77bb9108c00dd7709ce17719edb763273 (patch) | |
tree | 4d9397d208b3c74bea11056ec9402fdfc81a36f5 /src/wallet.cpp | |
parent | 4b7b1bb1ac54e067d889170757a8c45f0baaae3d (diff) |
Move fee policy out of core
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index d9187e4be3..318a1388d2 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -21,6 +21,9 @@ CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; +/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ +CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee + ////////////////////////////////////////////////////////////////////////////// // // mapWallet @@ -1294,7 +1297,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend, BOOST_FOREACH (const PAIRTYPE(CScript, int64_t)& s, vecSend) { CTxOut txout(s.second, s.first); - if (txout.IsDust(CTransaction::minRelayTxFee)) + if (txout.IsDust(::minRelayTxFee)) { strFailReason = _("Transaction amount too small"); return false; @@ -1355,7 +1358,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend, // Never create dust outputs; if we would, just // add the dust to the fee. - if (newTxOut.IsDust(CTransaction::minRelayTxFee)) + if (newTxOut.IsDust(::minRelayTxFee)) { nFeeRet += nChange; reservekey.ReturnKey(); @@ -1537,7 +1540,7 @@ int64_t CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge // ... unless we don't have enough mempool data, in which case fall // back to a hard-coded fee if (nFeeNeeded == 0) - nFeeNeeded = CTransaction::minTxFee.GetFee(nTxBytes); + nFeeNeeded = minTxFee.GetFee(nTxBytes); return nFeeNeeded; } |