From ece625c754a4803658a9547251a7ac352260f96a Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 26 Jun 2023 09:38:34 +0100 Subject: [PATCH] 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 --- src/policy/feerate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/policy/feerate.h b/src/policy/feerate.h index 67b124d797..a51b540b05 100644 --- a/src/policy/feerate.h +++ b/src/policy/feerate.h @@ -53,7 +53,7 @@ public: /** * 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; }