File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ void CBlockPolicyEstimator::removeTx(uint256 hash)
299
299
CBlockPolicyEstimator::CBlockPolicyEstimator (const CFeeRate& _minRelayFee)
300
300
: nBestSeenHeight(0 )
301
301
{
302
+ static_assert (MIN_FEERATE > 0 , " Min feerate must be nonzero" );
302
303
minTrackedFee = _minRelayFee < CFeeRate (MIN_FEERATE) ? CFeeRate (MIN_FEERATE) : _minRelayFee;
303
304
std::vector<double > vfeelist;
304
305
for (double bucketBoundary = minTrackedFee.GetFeePerK (); bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
@@ -485,7 +486,7 @@ void CBlockPolicyEstimator::Read(CAutoFile& filein, int nFileVersion)
485
486
486
487
FeeFilterRounder::FeeFilterRounder (const CFeeRate& minIncrementalFee)
487
488
{
488
- CAmount minFeeLimit = minIncrementalFee.GetFeePerK () / 2 ;
489
+ CAmount minFeeLimit = std::max ( CAmount ( 1 ), minIncrementalFee.GetFeePerK () / 2 ) ;
489
490
feeset.insert (0 );
490
491
for (double bucketBoundary = minFeeLimit; bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
491
492
feeset.insert (bucketBoundary);
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ static const double MIN_SUCCESS_PCT = .95;
179
179
static const double SUFFICIENT_FEETXS = 1 ;
180
180
181
181
// Minimum and Maximum values for tracking feerates
182
- static const double MIN_FEERATE = 10 ;
182
+ static constexpr double MIN_FEERATE = 10 ;
183
183
static const double MAX_FEERATE = 1e7 ;
184
184
static const double INF_FEERATE = MAX_MONEY;
185
185
static const double INF_PRIORITY = 1e9 * MAX_MONEY;
You can’t perform that action at this time.
0 commit comments