The FeeFrac
type represents a fraction, intended to be used for sats/vbyte
or sats/WU
. It was added to improve accuracy when evaluating fee rates in cluster mempool. [1]
But it can also be used to fix the precision issues that the current CFeeRate
class has now.
At the moment, CFeeRate
handles the fee rate as satoshis per kilovirtualbyte: CAmount / kvB
using an integer.
This PR fix CFeeRate
precision issues by encapsulating FeeFrac
internally keeping backwards compatibility.
This PR can also be used as a based to use multiple units on RPC calls as detailed in this issue [2].
Some previous discussions: [1] #30535 [2] https://github.com/bitcoin/bitcoin/issues/32093