Persist LNWatcher transactions in wallet file:
- separate AddressSynchronizer from Wallet and LNWatcher - the AddressSynchronizer class is referred to as 'adb' (address database) - Use callbacks to replace overloaded methods
This commit is contained in:
@@ -957,7 +957,7 @@ class ElectrumWindow(App, Logger):
|
||||
server_height = self.network.get_server_height()
|
||||
server_lag = self.num_blocks - server_height
|
||||
if not self.wallet.is_up_to_date() or server_height == 0:
|
||||
num_sent, num_answered = self.wallet.get_history_sync_state_details()
|
||||
num_sent, num_answered = self.wallet.adb.get_history_sync_state_details()
|
||||
status = ("{} [size=18dp]({}/{})[/size]"
|
||||
.format(_("Synchronizing..."), num_answered, num_sent))
|
||||
elif server_lag > 1:
|
||||
@@ -1164,7 +1164,7 @@ class ElectrumWindow(App, Logger):
|
||||
def show_transaction(self, txid):
|
||||
tx = self.wallet.db.get_transaction(txid)
|
||||
if not tx and self.wallet.lnworker:
|
||||
tx = self.wallet.lnworker.lnwatcher.db.get_transaction(txid)
|
||||
tx = self.wallet.adb.get_transaction(txid)
|
||||
if tx:
|
||||
self.tx_dialog(tx)
|
||||
else:
|
||||
|
||||
@@ -264,7 +264,7 @@ class AddressesDialog(Factory.Popup):
|
||||
for address in _list:
|
||||
label = wallet.get_label(address)
|
||||
balance = sum(wallet.get_addr_balance(address))
|
||||
is_used_and_empty = wallet.is_used(address) and balance == 0
|
||||
is_used_and_empty = wallet.adb.is_used(address) and balance == 0
|
||||
if self.show_used == 1 and (balance or is_used_and_empty):
|
||||
continue
|
||||
if self.show_used == 2 and balance == 0:
|
||||
|
||||
@@ -168,7 +168,7 @@ class RequestDialog(Factory.Popup):
|
||||
address = req.get_address()
|
||||
if not address:
|
||||
warning = _('Warning') + ': ' + _('This request cannot be paid on-chain')
|
||||
elif self.app.wallet.is_used(address):
|
||||
elif self.app.wallet.adb.is_used(address):
|
||||
warning = _('Warning') + ': ' + _('This address is being reused')
|
||||
self.warning = warning
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class HistoryScreen(CScreen):
|
||||
self.app.lightning_tx_dialog(tx_item)
|
||||
return
|
||||
if tx_item.get('lightning'):
|
||||
tx = self.app.wallet.lnworker.lnwatcher.db.get_transaction(key)
|
||||
tx = self.app.wallet.adb.get_transaction(key)
|
||||
else:
|
||||
tx = self.app.wallet.db.get_transaction(key)
|
||||
if not tx:
|
||||
|
||||
Reference in New Issue
Block a user