1
0

add watchtower class, send encumbered tx as json

This commit is contained in:
ThomasV
2018-10-13 12:11:10 +02:00
parent 7589bdc6a9
commit e761f5b876
3 changed files with 24 additions and 12 deletions

View File

@@ -63,7 +63,8 @@ class LNWatcher(PrintError):
name, args, kwargs = await self.watchtower_queue.get()
func = getattr(self.watchtower, name)
try:
func(*args, **kwargs)
r = func(*args, **kwargs)
self.print_error("watchtower answer", r)
except:
self.print_error('could not reach watchtower, will retry in 5s', name, args)
await asyncio.sleep(5)
@@ -179,7 +180,8 @@ class LNWatcher(PrintError):
return keep_watching_this
@with_watchtower
def add_sweep_tx(self, funding_outpoint: str, ctx_txid: str, encumbered_sweeptx: EncumberedTransaction):
def add_sweep_tx(self, funding_outpoint: str, ctx_txid: str, sweeptx):
encumbered_sweeptx = EncumberedTransaction.from_json(sweeptx)
if encumbered_sweeptx is None:
return
with self.lock: