From 03f0d632af9e1d98a0adf0c04b8fdbcefab338f2 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 5 Apr 2023 14:57:52 +0200 Subject: [PATCH] wallet.sign_transaction: return tx if signed by swap manager This fixes bumping swap fee in the qml GUI, because it expects the value returned by this method to be None if the transaction could not be signed. --- electrum/wallet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/wallet.py b/electrum/wallet.py index 7c3fc5d75..b545ac54f 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -2318,6 +2318,7 @@ class Abstract_Wallet(ABC, Logger, EventListener): self._add_txinout_derivation_info(txout, address, only_der_suffix=only_der_suffix) def sign_transaction(self, tx: Transaction, password) -> Optional[PartialTransaction]: + """ returns tx if successful else None """ if self.is_watching_only(): return if not isinstance(tx, PartialTransaction): @@ -2326,7 +2327,7 @@ class Abstract_Wallet(ABC, Logger, EventListener): swap = self.get_swap_by_claim_tx(tx) if swap: self.lnworker.swap_manager.sign_tx(tx, swap) - return + return tx # add info to a temporary tx copy; including xpubs # and full derivation paths as hw keystores might want them tmp_tx = copy.deepcopy(tx)