aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2018-01-10 08:43:05 +0000
committerRoss Nicoll <[email protected]>2018-09-19 21:09:16 +0100
commit3d363eccd436df49bcdfccf01bcd5148ba3cfb87 (patch)
tree1f045afcb027093b6261f5e2ddd179664fd13d64 /src
parentAlways use parameters at block 0 to get genesis block hash (#1416) (diff)
downloaddiscoin-3d363eccd436df49bcdfccf01bcd5148ba3cfb87.tar.xz
discoin-3d363eccd436df49bcdfccf01bcd5148ba3cfb87.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/dogecoin.cpp16
-rw-r--r--src/dogecoin.h1
-rw-r--r--src/validation.h4
-rw-r--r--src/wallet/wallet.cpp8
-rw-r--r--src/wallet/wallet.h4
5 files changed, 21 insertions, 12 deletions
diff --git a/src/dogecoin.cpp b/src/dogecoin.cpp
index b34437ca0..3e57791fd 100644
--- a/src/dogecoin.cpp
+++ b/src/dogecoin.cpp
@@ -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;
diff --git a/src/dogecoin.h b/src/dogecoin.h
index 3bc63635d..45dc7fc79 100644
--- a/src/dogecoin.h
+++ b/src/dogecoin.h
@@ -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);
diff --git a/src/validation.h b/src/validation.h
index 707ada3ee..0d075ae3a 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -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 */
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index b34cbae3a..c61272c8b 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -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));
}
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 16588721c..5f77a31ea 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -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