aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ark/ln-e2e-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ark/ln-e2e-test.js')
-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) + '…');