itest: wait for active channels before replaying payments
What changed, and why it matters
This commit only changes integration tests for the LND Lightning node software. It replaces a brief wait with an explicit check that both sides of a payment channel are active before sending test payments. There is no change to production code, no user-facing behavior change, and no security fix.
No security action needed. Treat as a normal test-flake fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies two Go integration test files (itest/lnd_revocation_test.go and itest/lnd_watchtower_test.go). In two test helper functions, after reconnecting nodes Dave and Carol, the code previously waited for the channel to appear in the graph and then implicitly relied on a short delay. The patch adds explicit ht.AssertChannelActive(dave, chanPoint) and ht.AssertChannelActive(carol, chanPoint) calls for both peers before replaying payments. This is a test reliability improvement, not a runtime security patch.
Changed components
itest/lnd_revocation_test.goitest/lnd_watchtower_test.goInspect captured patch +9 / −3
diff --git a/itest/lnd_revocation_test.go b/itest/lnd_revocation_test.go
index 54d718f..90c802a 100644
--- a/itest/lnd_revocation_test.go
+++ b/itest/lnd_revocation_test.go
@@ -279,8 +279,10 @@ func revokedCloseRetributionZeroValueRemoteOutputCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)
- // Once connected, give Dave some time to enable the channel again.
+ // Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
+ ht.AssertChannelActive(dave, chanPoint)
+ ht.AssertChannelActive(carol, chanPoint)
// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
@@ -507,8 +509,10 @@ func revokedCloseRetributionRemoteHodlCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)
- // Once connected, give Dave some time to enable the channel again.
+ // Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
+ ht.AssertChannelActive(dave, chanPoint)
+ ht.AssertChannelActive(carol, chanPoint)
// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
diff --git a/itest/lnd_watchtower_test.go b/itest/lnd_watchtower_test.go
index 77781ce..a930e01 100644
--- a/itest/lnd_watchtower_test.go
+++ b/itest/lnd_watchtower_test.go
@@ -448,8 +448,10 @@ func testRevokedCloseRetributionAltruistWatchtowerCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)
- // Once connected, give Dave some time to enable the channel again.
+ // Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
+ ht.AssertChannelActive(dave, chanPoint)
+ ht.AssertChannelActive(carol, chanPoint)
// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.