1
0

persist_lnwatcher: split try_redeem into two methods:

- maybe_add_redeem_tx
 - maybe_broadcast

Before this commit, local tx that are now persisted
are bot broadcast
This commit is contained in:
ThomasV
2022-06-04 16:48:19 +02:00
parent c47057b484
commit 0ca3d66d15
2 changed files with 41 additions and 34 deletions

View File

@@ -639,12 +639,9 @@ class AddressSynchronizer(Logger):
return cached_local_height
return self.network.get_local_height() if self.network else self.db.get('stored_height', 0)
def add_future_tx(self, tx: Transaction, wanted_height: int) -> bool:
def set_future_tx(self, txid:str, wanted_height: int):
with self.lock:
tx_was_added = self.add_transaction(tx)
if tx_was_added:
self.future_tx[tx.txid()] = wanted_height
return tx_was_added
self.future_tx[txid] = wanted_height
def get_tx_height(self, tx_hash: str) -> TxMinedInfo:
if tx_hash is None: # ugly backwards compat...