twallet: RBF batching will now reuse the change address - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 8491a2d329dcf8cae9cc08cec4ff21a22bc7e944 DIR parent d0a43662bd91c3f0c04301ca8574e4840c7122ad HTML Author: SomberNight <somber.night@protonmail.com> Date: Thu, 20 Jun 2019 18:43:00 +0200 wallet: RBF batching will now reuse the change address Diffstat: M electrum/wallet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- DIR diff --git a/electrum/wallet.py b/electrum/wallet.py t@@ -721,10 +721,6 @@ class Abstract_Wallet(AddressSynchronizer): for item in coins: self.add_input_info(item) - # change address - # if empty, coin_chooser will set it - change_addrs = self.get_change_addresses_for_new_transaction(change_addr) - # Fee estimator if fixed_fee is None: fee_estimator = config.estimate_fee t@@ -757,9 +753,13 @@ class Abstract_Wallet(AddressSynchronizer): return max(lower_bound, original_fee_estimator(size)) txi = base_tx.inputs() txo = list(filter(lambda o: not self.is_change(o.address), base_tx.outputs())) + old_change_addrs = [o.address for o in base_tx.outputs() if self.is_change(o.address)] else: txi = [] txo = [] + old_change_addrs = [] + # change address. if empty, coin_chooser will set it + change_addrs = self.get_change_addresses_for_new_transaction(change_addr or old_change_addrs) tx = coin_chooser.make_tx(coins, txi, outputs[:] + txo, change_addrs, fee_estimator, self.dust_threshold()) else: