diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 9bfcc17fd..3e7fc482e 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -874,7 +874,7 @@ class TxEditor(WindowModalDialog, QtEventListener, Logger): self.update_submarine_tab() @qt_event_listener - def on_event_channels_updated(self, wallet): + def on_event_channel(self, wallet, _channel): # useful e.g. if the user quickly opens the tab after startup before the channels are initialized if wallet == self.wallet and self.swap_manager and self.swap_manager.is_initialized.is_set(): self.update_submarine_tab() diff --git a/electrum/plugins/psbt_nostr/psbt_nostr.py b/electrum/plugins/psbt_nostr/psbt_nostr.py index fed2a8a01..929984457 100644 --- a/electrum/plugins/psbt_nostr/psbt_nostr.py +++ b/electrum/plugins/psbt_nostr/psbt_nostr.py @@ -40,7 +40,8 @@ from electrum.logging import Logger from electrum.plugin import BasePlugin from electrum.transaction import PartialTransaction, tx_from_any from electrum.util import ( - log_exceptions, OldTaskGroup, ca_path, trigger_callback, event_listener, json_decode, make_aiohttp_proxy_connector + log_exceptions, OldTaskGroup, ca_path, trigger_callback, event_listener, json_decode, + make_aiohttp_proxy_connector, run_sync_function_on_asyncio_thread, ) from electrum.wallet import Multisig_Wallet @@ -73,7 +74,7 @@ class PsbtNostrPlugin(BasePlugin): self.cosigner_wallets.pop(wallet) -class CosignerWallet(Logger): +class CosignerWallet(Logger): # children have to inherit EventListener and register callbacks # one for each open window (Qt) / open wallet (QML) # if user signs a tx, we have the password # if user receives a dm? needs to enter password first @@ -123,6 +124,7 @@ class CosignerWallet(Logger): @event_listener async def on_event_proxy_set(self, *args): + # note: the callbacks get registered in the child classes of CosignerWallet if not (self.network and self.nostr_pubkey): return await self.stop() @@ -250,7 +252,7 @@ class CosignerWallet(Logger): def mark_pending_event_rcvd(self, event_id): self.logger.debug('marking event rcvd') self.known_events[event_id] = now() - self.pending.set() + run_sync_function_on_asyncio_thread(self.pending.set, block=False) def prepare_messages(self, tx: Union[Transaction, PartialTransaction], label: str = None) -> List[Tuple[str, dict]]: messages = []