1
0

Prepare to calculate tx fee given a tx size

This commit is contained in:
Neil Booth
2015-11-29 12:41:54 +09:00
parent 39af17bc23
commit a4dd5acc48
3 changed files with 20 additions and 10 deletions

View File

@@ -927,11 +927,14 @@ class Abstract_Wallet(PrintError):
else:
change_addrs = [address]
fee_per_kb = self.fee_per_kb(config)
def fee_estimator(tx):
if fixed_fee is not None:
# Fee estimator
if fixed_fee is None:
fee_per_kb = self.fee_per_kb(config)
def fee_estimator(tx):
return tx.estimated_fee(fee_per_kb)
else:
def fee_estimator(tx):
return fixed_fee
return tx.estimated_fee(fee_per_kb)
# Change <= dust threshold is added to the tx fee
dust_threshold = 182 * 3 * MIN_RELAY_TX_FEE / 1000