1
0

allow fractional feerates (#4324)

This commit is contained in:
ghost43
2018-05-09 19:30:18 +02:00
committed by GitHub
parent 3337af0734
commit dae187bada
4 changed files with 52 additions and 22 deletions

View File

@@ -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