feat(units): add kvb constructor to `FeeRate`
Namely, the feefilter expresses the fee as sat per 1000 vbyte
This commit is contained in:
parent
73e33e5808
commit
b96501981f
|
@ -62,6 +62,9 @@ impl FeeRate {
|
|||
/// Constructs a new [`FeeRate`] from satoshis per virtual bytes without overflow check.
|
||||
pub const fn from_sat_per_vb_unchecked(sat_vb: u64) -> Self { FeeRate(sat_vb * (1000 / 4)) }
|
||||
|
||||
/// Constructs a new [`FeeRate`] from satoshis per kilo virtual bytes (1,000 vbytes).
|
||||
pub const fn from_sat_per_kvb(sat_kvb: u64) -> Self { FeeRate(sat_kvb / 4) }
|
||||
|
||||
/// Returns raw fee rate.
|
||||
///
|
||||
/// Can be used instead of `into()` to avoid inference issues.
|
||||
|
|
Loading…
Reference in New Issue