Bring 1.14 fees in line with 1.10 (#1425)

* Disable free transactions
* Updating remaining fee calculation constants
* Round up to the nearest 1k, not up 1k so the UI fee estimator is correct
This commit is contained in:
Ross Nicoll 2018-01-10 08:43:05 +00:00
parent 493f02ba2a
commit 3d363eccd4
5 changed files with 21 additions and 12 deletions

View file

@ -146,6 +146,17 @@ CAmount GetDogecoinBlockSubsidy(int nHeight, const Consensus::Params& consensusP
}
}
unsigned int GetDogecoinTxSize(const unsigned int nTxBytes)
{
// Dogecoin: Round TX bytes up to the next 1,000 bytes
unsigned int nMod = nTxBytes % 1000;
if (nMod > 0) {
return nTxBytes + 1000 - nMod;
} else {
return nTxBytes;
}
}
CAmount GetDogecoinMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree)
{
{
@ -179,9 +190,10 @@ CAmount GetDogecoinMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool
CAmount GetDogecoinDustFee(const std::vector<CTxOut> &vout, CFeeRate &baseFeeRate) {
CAmount nFee = 0;
// To limit dust spam, add base fee for each output less than DUST_SOFT_LIMIT
// To limit dust spam, add base fee for each output less than a COIN
BOOST_FOREACH(const CTxOut& txout, vout)
if (txout.IsDust(::minRelayTxFee))
// if (txout.IsDust(::minRelayTxFee))
if (txout.nValue < COIN)
nFee += baseFeeRate.GetFeePerK();
return nFee;

View file

@ -18,5 +18,6 @@ unsigned int CalculateDogecoinNextWorkRequired(const CBlockIndex* pindexLast, in
*/
bool CheckAuxPowProofOfWork(const CBlockHeader& block, const Consensus::Params& params);
unsigned int GetDogecoinTxSize(const unsigned int nTxBytes);
CAmount GetDogecoinMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree);
CAmount GetDogecoinDustFee(const std::vector<CTxOut> &vout, CFeeRate &baseFeeRate);

View file

@ -56,9 +56,9 @@ static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = COIN;
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 400 * COIN;
//! Discourage users to set fees higher than this amount (in satoshis) per kB
static const CAmount HIGH_TX_FEE_PER_KB = 10 * COIN;
static const CAmount HIGH_TX_FEE_PER_KB = 25 * COIN;
//! -maxtxfee will warn if called with a higher fee than this amount (in satoshis)
static const CAmount HIGH_MAX_TX_FEE = 100 * HIGH_TX_FEE_PER_KB;
static const CAmount HIGH_MAX_TX_FEE = 10 * HIGH_TX_FEE_PER_KB;
/** Default for -limitancestorcount, max number of in-mempool ancestors */
static const unsigned int DEFAULT_ANCESTOR_LIMIT = 25;
/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */

View file

@ -2808,18 +2808,14 @@ bool CWallet::AddAccountingEntry(const CAccountingEntry& acentry, CWalletDB *pwa
CAmount CWallet::GetRequiredFee(const CMutableTransaction& tx, unsigned int nTxBytes)
{
// Dogecoin: Round TX bytes up to the next 1,000 bytes
nTxBytes += 1000 - (nTxBytes % 1000);
nTxBytes = GetDogecoinTxSize(nTxBytes);
// Dogecoin: Add an increased fee for each dust output
return std::max(minTxFee.GetFee(nTxBytes) + GetDogecoinDustFee(tx.vout, minTxFee), ::minRelayTxFee.GetFee(nTxBytes));
}
CAmount CWallet::GetRequiredFee(unsigned int nTxBytes)
{
// Dogecoin: Round TX bytes up to the next 1,000 bytes
nTxBytes += 1000 - (nTxBytes % 1000);
nTxBytes = GetDogecoinTxSize(nTxBytes);
return std::max(minTxFee.GetFee(nTxBytes), ::minRelayTxFee.GetFee(nTxBytes));
}

View file

@ -47,7 +47,7 @@ static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
//! -paytxfee default
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
//! -fallbackfee default
static const CAmount DEFAULT_FALLBACK_FEE = COIN * 20;
static const CAmount DEFAULT_FALLBACK_FEE = COIN;
//! -mintxfee default
static const CAmount DEFAULT_TRANSACTION_MINFEE = COIN;
//! minimum recommended increment for BIP 125 replacement txs
@ -67,7 +67,7 @@ static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;
//! -walletrbf default
static const bool DEFAULT_WALLET_RBF = false;
//! Largest (in bytes) free transaction we're willing to create
static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000;
static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 0;
static const bool DEFAULT_WALLETBROADCAST = true;
static const bool DEFAULT_DISABLE_WALLET = false;
//! if set, all keys will be derived by using BIP32