regtests: rm sleep from "swapserver_forceclose" test
less reliance on timing (OTOH it hardcodes the output index of the commitment tx... meh)
This commit is contained in:
@@ -1639,7 +1639,8 @@ class Commands(Logger):
|
||||
@command('wnpl')
|
||||
async def close_channel(self, channel_point, force=False, password=None, wallet: Abstract_Wallet = None):
|
||||
"""
|
||||
Close a lightning channel
|
||||
Close a lightning channel.
|
||||
Returns txid of closing tx.
|
||||
|
||||
arg:str:channel_point:channel point
|
||||
arg:bool:force:Force closes (broadcast local commitment transaction)
|
||||
|
||||
@@ -2288,6 +2288,9 @@ class LNWallet(LNWorker):
|
||||
def save_preimage(self, payment_hash: bytes, preimage: bytes, *, write_to_disk: bool = True):
|
||||
if sha256(preimage) != payment_hash:
|
||||
raise Exception("tried to save incorrect preimage for payment_hash")
|
||||
if self._preimages.get(payment_hash.hex()) is not None:
|
||||
return # we already have this preimage
|
||||
self.logger.debug(f"saving preimage for {payment_hash.hex()}")
|
||||
self._preimages[payment_hash.hex()] = preimage.hex()
|
||||
if write_to_disk:
|
||||
self.wallet.save_db()
|
||||
|
||||
Reference in New Issue
Block a user