From 371772f288c5a114e49a9055f7771b7b2d58a2d8 Mon Sep 17 00:00:00 2001 From: AdamISZ Date: Mon, 21 Jan 2019 16:46:36 +0100 Subject: [PATCH] No coins fallback if mixdepth empty The code prior to this commit incorrectly only chose the no-coins fallback in PayJoin on receiver side if the call to wallet.get_utxos_by_mixdepth()[mixdepth] resulted in a raised exception, but of course it returns an empty dict, so after this commit the self.no_coins_fallback is called in case an empty dict is returned; note that the prior case still resulted in the same behaviour of publishing a non-CJ transaction, but now the info messages/prompts are clear. --- jmclient/jmclient/maker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jmclient/jmclient/maker.py b/jmclient/jmclient/maker.py index 67f444b..36e7c8d 100644 --- a/jmclient/jmclient/maker.py +++ b/jmclient/jmclient/maker.py @@ -570,9 +570,8 @@ class P2EPMaker(Maker): except Exception: # TODO probably not logical to always sweep here. self.user_info("Sweeping all coins in this mixdepth.") - try: - my_utxos = self.wallet.get_utxos_by_mixdepth()[self.mixdepth] - except: + my_utxos = self.wallet.get_utxos_by_mixdepth()[self.mixdepth] + if my_utxos == {}: return self.no_coins_fallback() if not_uih2: self.user_info("The proposed tx does not trigger UIH2, which "