multi: add new method FeePerVByte to avoid manual conversion

This commit is contained in:
yyforyongyu committed 2023-10-13 17:00:53 +08:00
1 parent a46168e669
commit 0532b82dd5
6 files changed
+17 -16

No files matched your search

+5
View File
@@ -70,6 +70,11 @@ func (s SatPerKWeight) FeePerKVByte() SatPerKVByte {
return SatPerKVByte(s * blockchain.WitnessScaleFactor)
}
// FeePerVByte converts the current fee rate from sat/kw to sat/vb.
func (s SatPerKWeight) FeePerVByte() SatPerVByte {
return SatPerVByte(s * blockchain.WitnessScaleFactor / 1000)
}
// String returns a human-readable string of the fee rate.
func (s SatPerKWeight) String() string {
return fmt.Sprintf("%v sat/kw", int64(s))