From 4a8ee1818a43d2ae7b1972fab48fe47849a49eb3 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 24 Feb 2020 18:52:33 +0100 Subject: [PATCH] follow-up prev E/W | lnwatcher.LNWalletWatcher | Exception in on_network_update: AssertionError('None') Traceback (most recent call last): File "...\electrum\electrum\util.py", line 1035, in wrapper return await func(*args, **kwargs) File "...\electrum\electrum\lnwatcher.py", line 174, in on_network_update await self.check_onchain_situation(address, outpoint) File "...\electrum\electrum\lnwatcher.py", line 184, in check_onchain_situation closing_height = self.get_tx_height(closing_txid) File "...\electrum\electrum\address_synchronizer.py", line 597, in get_tx_height verified_tx_mined_info = self.db.get_verified_tx(tx_hash) File "...\electrum\electrum\json_db.py", line 44, in wrapper return func(self, *args, **kwargs) File "...\electrum\electrum\wallet_db.py", line 859, in get_verified_tx assert isinstance(txid, str), f"{repr(txid)}" AssertionError: None --- electrum/address_synchronizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/address_synchronizer.py b/electrum/address_synchronizer.py index bd3ab309c..14a2248ce 100644 --- a/electrum/address_synchronizer.py +++ b/electrum/address_synchronizer.py @@ -584,7 +584,7 @@ class AddressSynchronizer(Logger): return cached_local_height return self.network.get_local_height() if self.network else self.db.get('stored_height', 0) - def add_future_tx(self, tx: Transaction, num_blocks: int) -> None: + def add_future_tx(self, tx: Transaction, num_blocks: int) -> bool: assert num_blocks > 0, num_blocks with self.lock: tx_was_added = self.add_transaction(tx) @@ -593,6 +593,8 @@ class AddressSynchronizer(Logger): return tx_was_added def get_tx_height(self, tx_hash: str) -> TxMinedInfo: + if tx_hash is None: # ugly backwards compat... + return TxMinedInfo(height=TX_HEIGHT_LOCAL, conf=0) with self.lock: verified_tx_mined_info = self.db.get_verified_tx(tx_hash) if verified_tx_mined_info: