Fix(qml): Real-time balance updates for confirmations and coinbase maturity

This commit fixes two critical balance update issues in the Android app:

1. Added balanceChanged.emit() on blockchain_updated event
   - Fixes coinbase outputs not showing when they mature (120 blocks)
   - Ensures balance updates when new blocks arrive
   - Resolves issue where only partial mining rewards were displayed

2. Fixed typo: satInt → satsInt in BalanceDetails.qml
   - Lightning swap button now works correctly

Related to previous fix on tx_height_changed event handler.
This commit is contained in:
2025-12-07 10:47:38 +01:00
parent a3b58cc631
commit 8448b2d697
2 changed files with 8 additions and 1 deletions

View File

@@ -214,7 +214,7 @@ Pane {
Layout.preferredWidth: 1
text: qsTr('Lightning swap');
visible: Daemon.currentWallet.isLightning
enabled: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satInt > 0
enabled: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satsInt > 0
icon.source: Qt.resolvedUrl('../../icons/update.png')
onClicked: app.startSwap()
}

View File

@@ -242,6 +242,13 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
self.balanceChanged.emit()
self.peersUpdated.emit()
@event_listener
def on_event_blockchain_updated(self):
# Emit balanceChanged when new block arrives because:
# 1. Coinbase outputs might have matured (COINBASE_MATURITY = 120 blocks)
# 2. Transaction confirmations increased
self.balanceChanged.emit()
@qt_event_listener
def on_event_payment_succeeded(self, wallet, key):
if wallet == self.wallet: