From b1542c6d1ef8e8c3507a476089f426d6f839b361 Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Tue, 1 Mar 2022 22:12:09 +0100 Subject: [PATCH] fix: update taker state after fee config check This commit fixes an issue regarding a wrong taker state caused by initiating a taker operation when no `max_cj_fee` value is present. Before this change the taker state switches to `running` indefinitely. After this change the config check is made before updating the state. --- jmclient/jmclient/wallet_rpc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jmclient/jmclient/wallet_rpc.py b/jmclient/jmclient/wallet_rpc.py index b7fa560..4597cf4 100644 --- a/jmclient/jmclient/wallet_rpc.py +++ b/jmclient/jmclient/wallet_rpc.py @@ -985,9 +985,6 @@ class JMWalletDaemon(Service): rounding, completion_flag]] except ValueError: raise InvalidRequestFormat() - # Before actual start, update our coinjoin state: - if not self.activate_coinjoin_state(CJ_TAKER_RUNNING): - raise ServiceAlreadyStarted() # Instantiate a Taker. # `order_chooser` is whatever is default for Taker. # max_cj_fee is to be set based on config values. @@ -1000,6 +997,9 @@ class JMWalletDaemon(Service): raise ConfigNotPresent() max_cj_fee= get_max_cj_fee_values(jm_single().config, None, user_callback=dummy_user_callback) + # Before actual start, update our coinjoin state: + if not self.activate_coinjoin_state(CJ_TAKER_RUNNING): + raise ServiceAlreadyStarted() self.taker = Taker(self.services["wallet"], schedule, max_cj_fee = max_cj_fee, callbacks=(self.filter_orders_callback,