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:
@@ -214,7 +214,7 @@ Pane {
|
|||||||
Layout.preferredWidth: 1
|
Layout.preferredWidth: 1
|
||||||
text: qsTr('Lightning swap');
|
text: qsTr('Lightning swap');
|
||||||
visible: Daemon.currentWallet.isLightning
|
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')
|
icon.source: Qt.resolvedUrl('../../icons/update.png')
|
||||||
onClicked: app.startSwap()
|
onClicked: app.startSwap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,13 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
|||||||
self.balanceChanged.emit()
|
self.balanceChanged.emit()
|
||||||
self.peersUpdated.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
|
@qt_event_listener
|
||||||
def on_event_payment_succeeded(self, wallet, key):
|
def on_event_payment_succeeded(self, wallet, key):
|
||||||
if wallet == self.wallet:
|
if wallet == self.wallet:
|
||||||
|
|||||||
Reference in New Issue
Block a user