Ava Chow daca51bf80
Merge bitcoin/bitcoin#32750: refactor: CFeeRate encapsulates FeeFrac internally
d3b8a54a81209420ef6447dd4581e1b6b8550647 Refactor CFeeRate to use FeeFrac internally (Pol Espinasa)

Pull request description:

  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] https://github.com/bitcoin/bitcoin/pull/30535
  [2] https://github.com/bitcoin/bitcoin/issues/32093

ACKs for top commit:
  achow101:
    ACK d3b8a54a81209420ef6447dd4581e1b6b8550647
  murchandamus:
    code review, lightly tested ACK d3b8a54a81209420ef6447dd4581e1b6b8550647
  ismaelsadeeq:
    re-ACK d3b8a54a81209420ef6447dd4581e1b6b8550647 📦
  theStack:
    Code-review ACK d3b8a54a81209420ef6447dd4581e1b6b8550647

Tree-SHA512: 5a8149d81e82ad4e60a0e76ff6a82a5b1c4e212cf5156c1cdd16bf9acbb351e7be458eac3f0a2ae89107f331062b299c1d9ca649d3b820ad0b68e6d1a14292e5
2025-08-08 18:11:05 -07:00
..
2025-05-19 16:40:33 +01:00
2023-11-21 13:15:44 +00:00
2025-05-06 16:53:16 -07:00
2025-05-06 16:53:16 -07:00
2025-05-09 15:06:51 +02:00