From b25d03c8d4b78df4bdf3b1ffbd6315c7f00599f8 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Sat, 5 Jun 2021 17:23:41 +0100 Subject: [PATCH] Fixes bug introduced in ad8cd74ee96587d838e726ddf191e83646e550fe The above commit added custom change addresses, however it introduced a bug for multiple transaction schedules on the same Taker object, as happens with tumbler for example: a new change address would not be created for new transactions. This commit fixes that and ensures a new change address is always chosen when a custom change address was not specified for the Taker object instantiation (which is always the case for tumbler). --- jmclient/jmclient/taker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jmclient/jmclient/taker.py b/jmclient/jmclient/taker.py index 839e27d..79c28d6 100644 --- a/jmclient/jmclient/taker.py +++ b/jmclient/jmclient/taker.py @@ -85,7 +85,7 @@ class Taker(object): self.schedule = schedule self.order_chooser = order_chooser self.max_cj_fee = max_cj_fee - self.my_change_addr = custom_change_address + self.custom_change_address = custom_change_address #List (which persists between transactions) of makers #who have not responded or behaved maliciously at any @@ -291,7 +291,9 @@ class Taker(object): #previously used for donations; TODO reimplement? raise NotImplementedError if self.cjamount != 0: - if self.my_change_addr is None: + if self.custom_change_address: + self.my_change_addr = self.custom_change_address + else: try: self.my_change_addr = self.wallet_service.get_internal_addr(self.mixdepth) except: