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)
299299CBlockPolicyEstimator::CBlockPolicyEstimator (const CFeeRate& _minRelayFee)
300300 : nBestSeenHeight(0 )
301301{
302+ static_assert (MIN_FEERATE > 0 , " Min feerate must be nonzero" );
302303 minTrackedFee = _minRelayFee < CFeeRate (MIN_FEERATE) ? CFeeRate (MIN_FEERATE) : _minRelayFee;
303304 std::vector<double > vfeelist;
304305 for (double bucketBoundary = minTrackedFee.GetFeePerK (); bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
@@ -485,7 +486,7 @@ void CBlockPolicyEstimator::Read(CAutoFile& filein, int nFileVersion)
485486
486487FeeFilterRounder::FeeFilterRounder (const CFeeRate& minIncrementalFee)
487488{
488- CAmount minFeeLimit = minIncrementalFee.GetFeePerK () / 2 ;
489+ CAmount minFeeLimit = std::max ( CAmount ( 1 ), minIncrementalFee.GetFeePerK () / 2 ) ;
489490 feeset.insert (0 );
490491 for (double bucketBoundary = minFeeLimit; bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
491492 feeset.insert (bucketBoundary);
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ static const double MIN_SUCCESS_PCT = .95;
179179static const double SUFFICIENT_FEETXS = 1 ;
180180
181181// Minimum and Maximum values for tracking feerates
182- static const double MIN_FEERATE = 10 ;
182+ static constexpr double MIN_FEERATE = 10 ;
183183static const double MAX_FEERATE = 1e7 ;
184184static const double INF_FEERATE = MAX_MONEY;
185185static const double INF_PRIORITY = 1e9 * MAX_MONEY;
You can’t perform that action at this time.
0 commit comments