As part of our migration to sat/vB feerates that began with #20305, this pull should resolve #20534 and improve/reduce the size of #20391 that adds a setfeerate
RPC in sat/vB, as well as for a future estimatefeerate
RPC in sat/vB. The code changes are less than 40 lines. Most of the diff is test coverage, as these changes touch a number of RPCs.
Changes:
- add
CFeeRate::FromSatB
andCFeeRate::FromBtcKb
named constructors - add a
CFeeRate::IsZero()
class member helper to replace== CFeeRate(0)
conditionals and avoid object allocations/constructions - add a
FeeRateFromValueInSatB()
utility function that callsAmountFromValue()
and then performs an additional check for non-representableCFeeRate
values in the range between 0 and 0.001 sat/vB - add unit and functional tests and fill some current fee rate gaps in the functional test coverage