From df87bd84560fec4b085b6f0f4785b61502ffd480 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Oct 2026 09:12:43 -0700 Subject: ln-e2e-test: wait for both CLN nodes to reach the chain tip before the hold receive Run right after tests that mine, cln-ark could trail by a block or two and the receive failed with final_incorrect_cltv_expiry. Co-Authored-By: Claude Opus 5.5 --- tools/ark/ln-e2e-test.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools') diff --git a/tools/ark/ln-e2e-test.js b/tools/ark/ln-e2e-test.js index 088dcb0..f4b5856 100644 --- a/tools/ark/ln-e2e-test.js +++ b/tools/ark/ln-e2e-test.js @@ -99,6 +99,11 @@ check('alice +100 from tiny send', aliceAfter === aliceBefore + 100, `${aliceBef // --------------------------------------------------------------------------- console.log('\n[2] RECEIVE: clc pays a 4000-sat invoice minted by hal (hold flow)'); +// both CLN nodes must have caught up with blocks earlier tests mined, or the +// HTLC's cltv disagrees with the hold invoice (final_incorrect_cltv_expiry) +const tip = Number(sh('docker exec bc bitcoin-cli getblockcount')); +const synced = (node) => JSON.parse(sh(`docker exec ${node} lightning-cli --regtest getinfo`)).blockheight >= tip; +for (let i = 0; i < 40 && !(synced('clc') && synced('cln-ark')); i++) await sleep(500); const balBefore = mgr.balance().spendableSat; const recv = await mgr.createLnInvoice(4000, 'ark-e2e-receive'); console.log(' hal invoice:', recv.invoice.slice(0, 50) + '…'); -- cgit v1.2.3