1
0

wallet.bump_fee: add new strategy: decrease payment amounts

- Rename bump_fee "methods" to "strategies".
- Refactor strategies so that bump_fee can use any subset of them in any permutation.
- Adds a new strategy which decreases the payment outputs (instead of change).
This commit is contained in:
SomberNight
2021-02-15 10:03:08 +01:00
parent 8fe7d750f7
commit 058d9ab6bb
5 changed files with 222 additions and 26 deletions

View File

@@ -238,7 +238,7 @@ class CoinChooserBase(Logger):
assert is_address(change_addrs[0])
# This takes a count of change outputs and returns a tx fee
output_weight = 4 * Transaction.estimated_output_size(change_addrs[0])
output_weight = 4 * Transaction.estimated_output_size_for_address(change_addrs[0])
fee_estimator_numchange = lambda count: fee_estimator_w(tx_weight + count * output_weight)
change = self._change_outputs(tx, change_addrs, fee_estimator_numchange, dust_threshold)
tx.add_outputs(change)