electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit fa8c751abfbb83f16b4ef69d77b8ac05b424b2fb
parent 5f39a2f29c0529f3eed798240e6373bc18e2d650
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 17 Nov 2020 19:39:25 +0100

qt swap dialog: fix disabling "OK" btn if NotEnoughFunds

Diffstat:
Melectrum/gui/qt/swap_dialog.py | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/electrum/gui/qt/swap_dialog.py b/electrum/gui/qt/swap_dialog.py @@ -142,8 +142,8 @@ class SwapDialog(WindowModalDialog): self.recv_amount_e.setStyleSheet(ColorScheme.BLUE.as_stylesheet()) self.recv_amount_e.follows = False self.send_follows = False - self.update_fee() self.ok_button.setEnabled(recv_amount is not None) + self.update_fee() # note: this might disable the "OK" button def on_recv_edited(self): if self.recv_amount_e.follows: @@ -158,8 +158,8 @@ class SwapDialog(WindowModalDialog): self.send_amount_e.setStyleSheet(ColorScheme.BLUE.as_stylesheet()) self.send_amount_e.follows = False self.send_follows = True - self.update_fee() self.ok_button.setEnabled(send_amount is not None) + self.update_fee() # note: this might disable the "OK" button def update(self): sm = self.swap_manager @@ -233,7 +233,9 @@ class SwapDialog(WindowModalDialog): self.ok_button.setEnabled(False) def do_normal_swap(self, lightning_amount, onchain_amount, password): - coro = self.swap_manager.normal_swap(lightning_amount, onchain_amount, password, tx=self.tx) + tx = self.tx + assert tx + coro = self.swap_manager.normal_swap(lightning_amount, onchain_amount, password, tx=tx) self.window.run_coroutine_from_thread(coro) def get_description(self):