Browse Source

lnwatcher: unwatch deeply mined channels

reduces log spam generated by "REDEEMED" channels...
hard-fail-on-bad-server-string
SomberNight 5 years ago
parent
commit
ec6be665d5
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/lnwatcher.py

8
electrum/lnwatcher.py

@ -160,7 +160,8 @@ class LNWatcher(AddressSynchronizer):
self.channels[address] = outpoint
async def unwatch_channel(self, address, funding_outpoint):
pass
self.logger.info(f'unwatching {funding_outpoint}')
self.channels.pop(address, None)
@log_exceptions
async def on_network_update(self, event, *args):
@ -170,7 +171,8 @@ class LNWatcher(AddressSynchronizer):
if not self.synchronizer:
self.logger.info("synchronizer not set yet")
return
for address, outpoint in self.channels.items():
channels_items = list(self.channels.items()) # copy
for address, outpoint in channels_items:
await self.check_onchain_situation(address, outpoint)
async def check_onchain_situation(self, address, funding_outpoint):
@ -315,7 +317,7 @@ class WatchTower(LNWatcher):
return self.network.run_from_another_thread(f())
async def unwatch_channel(self, address, funding_outpoint):
self.logger.info(f'unwatching {funding_outpoint}')
await super().unwatch_channel(address, funding_outpoint)
await self.sweepstore.remove_sweep_tx(funding_outpoint)
await self.sweepstore.remove_channel(funding_outpoint)
if funding_outpoint in self.tx_progress:

Loading…
Cancel
Save