URI: 
       tQt tx dialog: handle "empty" locktime field - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 7b91da9966fcef4b2c9b743e38178cd2fd8c20ca
   DIR parent 9380b331e472e00d9870eb4f57c0319c1da123c5
  HTML Author: SomberNight <somber.night@protonmail.com>
       Date:   Wed, 23 Sep 2020 13:31:39 +0200
       
       Qt tx dialog: handle "empty" locktime field
       
       fix https://github.com/spesmilo/electrum/issues/5486#issuecomment-696276020
       
       Diffstat:
         M electrum/gui/qt/transaction_dialog… |       4 +++-
         M electrum/transaction.py             |       3 ++-
       
       2 files changed, 5 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py
       t@@ -875,7 +875,9 @@ class PreviewTxDialog(BaseTxDialog, TxEditor):
                assert self.tx
                self.finalized = True
                self.tx.set_rbf(self.rbf_cb.isChecked())
       -        self.tx.locktime = self.locktime_e.get_locktime()
       +        locktime = self.locktime_e.get_locktime()
       +        if locktime is not None:
       +            self.tx.locktime = self.locktime_e.get_locktime()
                for widget in [self.fee_slider, self.fee_combo, self.feecontrol_fields, self.rbf_cb,
                               self.locktime_setter_widget, self.locktime_e]:
                    widget.setEnabled(False)
   DIR diff --git a/electrum/transaction.py b/electrum/transaction.py
       t@@ -546,7 +546,8 @@ class Transaction:
                return self._locktime
        
            @locktime.setter
       -    def locktime(self, value):
       +    def locktime(self, value: int):
       +        assert isinstance(value, int), f"locktime must be int, not {value!r}"
                self._locktime = value
                self.invalidate_ser_cache()