watchtower: add watch_channel rpc

This commit is contained in:
ThomasV 2018-10-27 13:51:04 +02:00 committed by SomberNight
parent 09a948c448
commit d74160bdca
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 2 additions and 0 deletions

View file

@ -131,6 +131,7 @@ class WatchTower(DaemonThread):
port = self.config.get('watchtower_port', 12345)
server = SimpleJSONRPCServer((host, port), logRequests=True)
server.register_function(self.lnwatcher.add_sweep_tx, 'add_sweep_tx')
server.register_function(self.lnwatcher.watch_channel, 'watch_channel')
server.timeout = 0.1
while self.is_running():
server.handle_request()

View file

@ -95,6 +95,7 @@ class LNWatcher(PrintError):
storage.put('sweepstore', sweepstore)
storage.write()
@with_watchtower
def watch_channel(self, address, outpoint):
self.watch_address(address)
with self.lock: