aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 09:12:43 -0700
committerAdam Soltys <[email protected]>2026-10-07 09:12:43 -0700
commitdf87bd84560fec4b085b6f0f4785b61502ffd480 (patch)
tree904581d1beb703c7cbeb734e7196d961d21fdbdf /tools
parent014cf755cc330529c5fa1dedb321b27750b150b1 (diff)
downloadcoinosv3-df87bd84560fec4b085b6f0f4785b61502ffd480.tar.gz
coinosv3-df87bd84560fec4b085b6f0f4785b61502ffd480.zip
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 <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/ark/ln-e2e-test.js5
1 files changed, 5 insertions, 0 deletions
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) + '…');