connect fee edits together
This commit is contained in:
@@ -253,7 +253,11 @@ class SimpleConfig(PrintError):
|
||||
return fee_rate
|
||||
|
||||
def estimate_fee(self, size):
|
||||
return int(self.fee_per_kb() * size / 1000.)
|
||||
return self.estimate_fee_for_feerate(self.fee_per_kb(), size)
|
||||
|
||||
@classmethod
|
||||
def estimate_fee_for_feerate(cls, fee_per_kb, size):
|
||||
return int(fee_per_kb * size / 1000.)
|
||||
|
||||
def update_fee_estimates(self, key, value):
|
||||
self.fee_estimates[key] = value
|
||||
|
||||
@@ -34,8 +34,12 @@ import time
|
||||
import json
|
||||
import copy
|
||||
import errno
|
||||
import traceback
|
||||
from functools import partial
|
||||
from collections import defaultdict
|
||||
from numbers import Number
|
||||
|
||||
import sys
|
||||
|
||||
from .i18n import _
|
||||
from .util import NotEnoughFunds, PrintError, UserCancelled, profiler, format_satoshis
|
||||
@@ -903,8 +907,12 @@ class Abstract_Wallet(PrintError):
|
||||
# Fee estimator
|
||||
if fixed_fee is None:
|
||||
fee_estimator = config.estimate_fee
|
||||
else:
|
||||
elif isinstance(fixed_fee, Number):
|
||||
fee_estimator = lambda size: fixed_fee
|
||||
elif callable(fixed_fee):
|
||||
fee_estimator = fixed_fee
|
||||
else:
|
||||
raise BaseException('Invalid argument fixed_fee: %s' % fixed_fee)
|
||||
|
||||
if i_max is None:
|
||||
# Let the coin chooser select the coins to spend
|
||||
|
||||
Reference in New Issue
Block a user