1
0
This commit is contained in:
ThomasV
2025-06-06 12:17:21 +02:00
parent ba0c58e5d9
commit 5610a94537
3 changed files with 9 additions and 1 deletions

View File

@@ -224,6 +224,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
if wallet == self.wallet:
self._logger.debug('wallet_updated')
self.balanceChanged.emit()
self.historyModel.setDirty()
self.synchronizing = not wallet.is_up_to_date()
if not self.synchronizing:
self.historyModel.initModel() # refresh if dirty

View File

@@ -4,6 +4,7 @@
from typing import TYPE_CHECKING
from . import util
from .util import TxMinedInfo, BelowDustLimit
from .util import EventListener, event_listener, log_exceptions, ignore_exceptions
from .transaction import Transaction, TxOutpoint
@@ -54,13 +55,15 @@ class LNWatcher(Logger, EventListener):
return
for address, callback in list(self.callbacks.items()):
await callback()
# send callback to GUI
util.trigger_callback('wallet_updated', self.lnworker.wallet)
@event_listener
async def on_event_blockchain_updated(self, *args):
await self.trigger_callbacks()
@event_listener
async def on_event_wallet_updated(self, wallet):
async def on_event_adb_added_tx(self, wallet):
# called if we add local tx
if wallet.adb != self.adb:
return

View File

@@ -1897,6 +1897,10 @@ class CallbackManager(Logger):
# callbacks set by the GUI or any thread
# guarantee: the callbacks will always get triggered from the asyncio thread.
# FIXME: There should be a way to prevent circular callbacks.
# At the very least, we need a distinction between callbacks that
# are for the GUI and callbacks between wallet components
def __init__(self):
Logger.__init__(self)
self.callback_lock = threading.Lock()