X-Git-Url: https://git.novaco.in/?p=electrum-nvc.git;a=blobdiff_plain;f=gui%2Fqt%2Fmain_window.py;h=cc61f4237098d67afe97914be705df02757d48a9;hp=51a7c357b64bfaa71bca8fdecb9e913bfc08a9e8;hb=029e0b8b0d788463feb56cb34540d9dcc9f31e93;hpb=05dba32315d7d9ec7a50c7ea3c8d5dcc69462f0d diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 51a7c35..cc61f42 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -876,16 +876,21 @@ class ElectrumWindow(QMainWindow): amount = self.amount_e.get_amount() fee = self.fee_e.get_amount() + outputs = self.payto_e.get_outputs() + + if not is_fee: + fee = None - if not is_fee: fee = None if amount is None: self.fee_e.setAmount(None) - return - # assume that there will be 2 outputs (one for change) - inputs, total, fee = self.wallet.choose_tx_inputs(amount, fee, 2, coins = self.get_coins()) - if not is_fee: - self.fee_e.setAmount(fee) - if inputs: + not_enough_funds = False + else: + inputs, total, fee = self.wallet.choose_tx_inputs(amount, fee, len(outputs), coins = self.get_coins()) + not_enough_funds = len(inputs) == 0 + if not is_fee: + self.fee_e.setAmount(fee) + + if not not_enough_funds: palette = QPalette() palette.setColor(self.amount_e.foregroundRole(), QColor('black')) text = ""