allow fractional feerates (#4324)
This commit is contained in:
@@ -3,6 +3,7 @@ import threading
|
||||
import time
|
||||
import os
|
||||
import stat
|
||||
from decimal import Decimal
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
@@ -473,12 +474,9 @@ class SimpleConfig(PrintError):
|
||||
|
||||
@classmethod
|
||||
def estimate_fee_for_feerate(cls, fee_per_kb, size):
|
||||
# note: We only allow integer sat/byte values atm.
|
||||
# The GUI for simplicity reasons only displays integer sat/byte,
|
||||
# and for the sake of consistency, we thus only use integer sat/byte in
|
||||
# the backend too.
|
||||
fee_per_byte = int(fee_per_kb / 1000)
|
||||
return int(fee_per_byte * size)
|
||||
fee_per_kb = Decimal(fee_per_kb)
|
||||
fee_per_byte = fee_per_kb / 1000
|
||||
return round(fee_per_byte * size)
|
||||
|
||||
def update_fee_estimates(self, key, value):
|
||||
self.fee_estimates[key] = value
|
||||
|
||||
Reference in New Issue
Block a user