aboutsummaryrefslogtreecommitdiff
path: root/src/policy/fees.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-01-04 12:25:26 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-01-04 12:33:56 +0100
commit1ce7ede2a9df446bc56c966f28f295b5973bbeeb (patch)
tree70a31a36faaefd9965a882cb46e0113222d04c92 /src/policy/fees.cpp
parent869781c51cc1b6ee0a8635bcefbcbe11db7f5b25 (diff)
parentf8d43b8081eef080ebb4514d1493c0c8d81d27ab (diff)
Merge #9288: Fix a bug if the min fee is 0 for FeeFilterRounder
f8d43b8 Avoid rollingMinimumFeeRate never being able to decay below half (Alex Morcos) eab8e1b fix a bug if the min fee is 0 for FeeFilterRounder (Alex Morcos)
Diffstat (limited to 'src/policy/fees.cpp')
-rw-r--r--src/policy/fees.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index 0f2e3c100d..a1b785e3e7 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -299,6 +299,7 @@ void CBlockPolicyEstimator::removeTx(uint256 hash)
CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
: nBestSeenHeight(0)
{
+ static_assert(MIN_FEERATE > 0, "Min feerate must be nonzero");
minTrackedFee = _minRelayFee < CFeeRate(MIN_FEERATE) ? CFeeRate(MIN_FEERATE) : _minRelayFee;
std::vector<double> vfeelist;
for (double bucketBoundary = minTrackedFee.GetFeePerK(); bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
@@ -485,7 +486,7 @@ void CBlockPolicyEstimator::Read(CAutoFile& filein, int nFileVersion)
FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)
{
- CAmount minFeeLimit = minIncrementalFee.GetFeePerK() / 2;
+ CAmount minFeeLimit = std::max(CAmount(1), minIncrementalFee.GetFeePerK() / 2);
feeset.insert(0);
for (double bucketBoundary = minFeeLimit; bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
feeset.insert(bucketBoundary);