|
|
@ -77,11 +77,10 @@ class SweepStore(SqlDB): |
|
|
|
return set([r[0] for r in c.fetchall()]) |
|
|
|
|
|
|
|
@sql |
|
|
|
def add_sweep_tx(self, funding_outpoint, ctn, prevout, tx: Transaction): |
|
|
|
def add_sweep_tx(self, funding_outpoint, ctn, prevout, raw_tx): |
|
|
|
c = self.conn.cursor() |
|
|
|
assert tx.is_complete() |
|
|
|
raw_tx = bfh(tx.serialize()) |
|
|
|
c.execute("""INSERT INTO sweep_txs (funding_outpoint, ctn, prevout, tx) VALUES (?,?,?,?)""", (funding_outpoint, ctn, prevout, raw_tx)) |
|
|
|
assert Transaction(raw_tx).is_complete() |
|
|
|
c.execute("""INSERT INTO sweep_txs (funding_outpoint, ctn, prevout, tx) VALUES (?,?,?,?)""", (funding_outpoint, ctn, prevout, bfh(raw_tx))) |
|
|
|
self.conn.commit() |
|
|
|
|
|
|
|
@sql |
|
|
@ -298,11 +297,6 @@ class WatchTower(LNWatcher): |
|
|
|
return await self.sweepstore.get_num_tx(outpoint) |
|
|
|
return self.network.run_from_another_thread(f()) |
|
|
|
|
|
|
|
def add_sweep_tx(self, funding_outpoint: str, ctn:int, prevout: str, tx: str): |
|
|
|
async def f(): |
|
|
|
return await self.sweepstore.add_sweep_tx(funding_outpoint, ctn, prevout, tx) |
|
|
|
return self.network.run_from_another_thread(f()) |
|
|
|
|
|
|
|
def list_sweep_tx(self): |
|
|
|
async def f(): |
|
|
|
return await self.sweepstore.list_sweep_tx() |
|
|
|