Skip to content

Commit

Permalink
feerate: For GetFeePerK() return nSatoshisPerK instead of round trip …
Browse files Browse the repository at this point in the history
…through GetFee

Returning the sats/kvb does not need to round trip through
GetFee(1000) since the feerate is already stored as sats/kvb.
  • Loading branch information
achow101 committed Jun 19, 2023
1 parent 8f40271 commit 11d6500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/policy/feerate.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CFeeRate
/**
* Return the fee in satoshis for a vsize of 1000 vbytes
*/
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; }
Expand Down

0 comments on commit 11d6500

Please sign in to comment.