mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 08:51:32 +00:00
lnwatcher: unwatch deeply mined channels
reduces log spam generated by "REDEEMED" channels...
This commit is contained in:
parent
8897360a72
commit
ec6be665d5
1 changed files with 5 additions and 3 deletions
|
@ -160,7 +160,8 @@ class LNWatcher(AddressSynchronizer):
|
||||||
self.channels[address] = outpoint
|
self.channels[address] = outpoint
|
||||||
|
|
||||||
async def unwatch_channel(self, address, funding_outpoint):
|
async def unwatch_channel(self, address, funding_outpoint):
|
||||||
pass
|
self.logger.info(f'unwatching {funding_outpoint}')
|
||||||
|
self.channels.pop(address, None)
|
||||||
|
|
||||||
@log_exceptions
|
@log_exceptions
|
||||||
async def on_network_update(self, event, *args):
|
async def on_network_update(self, event, *args):
|
||||||
|
@ -170,7 +171,8 @@ class LNWatcher(AddressSynchronizer):
|
||||||
if not self.synchronizer:
|
if not self.synchronizer:
|
||||||
self.logger.info("synchronizer not set yet")
|
self.logger.info("synchronizer not set yet")
|
||||||
return
|
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)
|
await self.check_onchain_situation(address, outpoint)
|
||||||
|
|
||||||
async def check_onchain_situation(self, address, funding_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())
|
return self.network.run_from_another_thread(f())
|
||||||
|
|
||||||
async def unwatch_channel(self, address, funding_outpoint):
|
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_sweep_tx(funding_outpoint)
|
||||||
await self.sweepstore.remove_channel(funding_outpoint)
|
await self.sweepstore.remove_channel(funding_outpoint)
|
||||||
if funding_outpoint in self.tx_progress:
|
if funding_outpoint in self.tx_progress:
|
||||||
|
|
Loading…
Add table
Reference in a new issue