@glozow
probably FeeFrac
would be better? CFeeRate
loses precision and can be inferred from the fee and size
We will be using the package size to calculate the percentile package and select its fee rate as an estimate to return to the user.
We then have to convert the fee and size to fee rate either by CFeeRate(const CAmount& nFeePaid, uint32_t num_bytes).GetFeePerK
or introduce and use a similar GetFeeRate
method for the FeeFrac
struct.
So, I think using CFeeRate
is okay for getting MEMPOOL_FORECAST
estimate.
I think the place we could benefit from changing this to FeeFrac
is when comparing forecasters’ estimates.
But this can’t be done now because the BLOCK_POLICY_ESTIMATOR
forecaster performs its operations in nSatoshiPerK
and returns a CFeeRate
value as an estimate.
It will require a refactor to change BLOCK_POLICY_ESTIMATOR
to use and return FeeFrac
as an estimate.
But the forecasters estimates are values greater than 1 s/vb.
Given this, I think using CFeeRate
is okay and will avoid the conversions, or adding duplicate GetFeePerK
method for FeeFrac
and refactoring CBlockPolicyEstimator
to use FeeFrac
?