Merge bitcoin/bitcoin#27914: feerate: For GetFeePerK() return nSatoshisPerK instead of round trip through GetFee

11d650060aed25273d860baa4e03168a778832bb feerate: For GetFeePerK() return nSatoshisPerK instead of round trip through GetFee (Andrew Chow)

Pull request description:

  Returning the sats/kvb does not need to round trip through GetFee(1000) since the feerate is already stored as sats/kvb.

  Fixes #27913, although this does bring up a larger question of how we should handle such large feerates in fuzzing.

ACKs for top commit:
  furszy:
    Code ACK 11d65006

Tree-SHA512: bec1a0d4b572a0c810cf7eb4e97d729d67e96835c2d576a909f755b053a9707c2f1b3df9adb8f08a9c4d310cdbb8b1e1b42b9c004bd1ade02a07d8ce9e902138
This commit is contained in:
fanquake 2023-06-26 09:38:34 +01:00 committed by pasta
parent ba5f4c0332
commit ece625c754
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -53,7 +53,7 @@ public:
/** /**
* Return the fee in satoshis for a size of 1000 bytes * Return the fee in satoshis for a size of 1000 bytes
*/ */
CAmount GetFeePerK() const { return GetFee(1000); } CAmount GetFeePerK() const { return nSatoshisPerK; }
friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; }
friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; }
friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; }