twallet_db.get_transaction: tolerate if tx_hash is None - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 02fcc6f570ae60a47f9f29b4d375059d6621dd31 DIR parent f8ba66058308afc73109d4b59b587a38733e1d3a HTML Author: SomberNight <somber.night@protonmail.com> Date: Fri, 28 Feb 2020 20:23:50 +0100 wallet_db.get_transaction: tolerate if tx_hash is None Traceback (most recent call last): File "...\electrum\electrum\gui\qt\main_window.py", line 1503, in do_pay self.do_pay_invoice(invoice) File "...\electrum\electrum\gui\qt\main_window.py", line 1516, in do_pay_invoice self.pay_onchain_dialog(self.get_coins(), outputs) File "...\electrum\electrum\gui\qt\main_window.py", line 1570, in pay_onchain_dialog self.preview_tx_dialog(make_tx=make_tx, File "...\electrum\electrum\gui\qt\main_window.py", line 1574, in preview_tx_dialog d = PreviewTxDialog(make_tx=make_tx, external_keypairs=external_keypairs, File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 654, in __init__ self.update() File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 392, in update tx_details = self.wallet.get_tx_info(self.tx) File "...\electrum\electrum\wallet.py", line 486, in get_tx_info tx_we_already_have_in_db = self.db.get_transaction(tx_hash) File "...\electrum\electrum\json_db.py", line 44, in wrapper return func(self, *args, **kwargs) File "...\electrum\electrum\wallet_db.py", line 822, in get_transaction assert isinstance(tx_hash, str) AssertionError Traceback (most recent call last): File "...\electrum\electrum\gui\qt\confirm_tx_dialog.py", line 65, in timer_actions self.update() File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 392, in update tx_details = self.wallet.get_tx_info(self.tx) File "...\electrum\electrum\wallet.py", line 486, in get_tx_info tx_we_already_have_in_db = self.db.get_transaction(tx_hash) File "...\electrum\electrum\json_db.py", line 44, in wrapper return func(self, *args, **kwargs) File "...\electrum\electrum\wallet_db.py", line 822, in get_transaction if tx_hash is None: AssertionError Diffstat: M electrum/wallet_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/wallet_db.py b/electrum/wallet_db.py t@@ -818,7 +818,9 @@ class WalletDB(JsonDB): return self.transactions.pop(tx_hash, None) @locked - def get_transaction(self, tx_hash: str) -> Optional[Transaction]: + def get_transaction(self, tx_hash: Optional[str]) -> Optional[Transaction]: + if tx_hash is None: + return None assert isinstance(tx_hash, str) return self.transactions.get(tx_hash)