Skip to content

Commit 6a4530d

Browse files
committed
ln send update: try/catch in case of error
1 parent 243d4cd commit 6a4530d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

resources/scenarios/ln_init.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,15 @@ def ln_all_chs(self, ln):
311311

312312
def update_policy(self, ln, txid_hex, policy, capacity):
313313
self.log.info(f"Sending update from {ln.name} for channel with outpoint: {txid_hex}:0")
314-
res = ln.update(txid_hex, policy, capacity)
315-
assert len(res["failed_updates"]) == 0, (
316-
f" Failed updates: {res['failed_updates']}\n txid: {txid_hex}\n policy:{policy}"
317-
)
314+
while True:
315+
try:
316+
res = ln.update(txid_hex, policy, capacity)
317+
assert len(res["failed_updates"]) == 0, (
318+
f" Failed updates: {res['failed_updates']}\n txid: {txid_hex}\n policy:{policy}"
319+
)
320+
break
321+
except Exception:
322+
sleep(1)
318323

319324
update_threads = []
320325
for ch in self.channels:

0 commit comments

Comments
 (0)