1
0

Move estimated_fee to Transaction class

It's not a function of the wallet but of the transaction
so it more naturally belongs there.
This commit is contained in:
Neil Booth
2015-11-28 21:28:54 +09:00
parent e9061ea371
commit 90dee43998
5 changed files with 14 additions and 16 deletions

View File

@@ -30,7 +30,7 @@ class CoinChooser(PrintError):
def fee(self, tx, fixed_fee, fee_per_kb):
if fixed_fee is not None:
return fixed_fee
return self.wallet.estimated_fee(tx, fee_per_kb)
return tx.estimated_fee(fee_per_kb)
def dust_threshold(self):
return 182 * 3 * MIN_RELAY_TX_FEE/1000
@@ -88,7 +88,7 @@ class CoinChooser(PrintError):
elif change_amount > self.dust_threshold():
tx.outputs.append(('address', change_addr, change_amount))
# recompute fee including change output
fee = self.wallet.estimated_fee(tx, fee_per_kb)
fee = tx.estimated_fee(fee_per_kb)
# remove change output
tx.outputs.pop()
# if change is still above dust threshold, re-add change output.