mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-18 13:07:58 +02:00
In this commit, we add three focused unit tests in contractcourt plus an itest that exercises the regression end-to-end. The chain watcher harness gains an opt-in early-dispatch capture that records every notifyEarlyCoopClose invocation so tests can assert how many fired and what summaries they carried. On top of that: TestEarlyDispatchCoopClose verifies the headline behavior. An async-path coop close fires exactly one early dispatch with IsPending=true and the post-N-conf flow still produces the regular CooperativeCloseInfo downstream. TestEarlyDispatchForceCloseNotInvoked guards the carve-out: force closes never fire the early dispatch since their CLOSED_CHANNEL event timing is intentionally unchanged. TestEarlyDispatchReorgRefiresOnReReplacement nails down the reorg path. Once a deep reorg removes the close, the early-dispatch flag is cleared and the next coop close re-fires the early event with its own summary, so a subscriber observes each distinct close attempt. testZeroConfCoopCloseSubscribeEvents brings up a zero-conf channel between Alice and Bob with --dev.force-channel-close-confs=3 so the chain watcher takes the async multi-confirmation path. Alice subscribes to channel events, initiates a cooperative close, and the test asserts that CLOSED_CHANNEL fires after only one confirmation of the close tx (not after the full three) and that FULLY_RESOLVED_CHANNEL arrives once the close has reached three confirmations. A quiet-window assertion at the end verifies that exactly one CLOSED_CHANNEL event is delivered. If the suppression in MarkChannelClosed broke and let it re-fire NotifyClosedChannel at N confs, this assertion would catch the duplicate. |
||
|---|---|---|
| .. | ||
| release-notes-0.13.1.md | ||
| release-notes-0.13.2.md | ||
| release-notes-0.13.3.md | ||
| release-notes-0.14.0.md | ||
| release-notes-0.14.1.md | ||
| release-notes-0.14.2.md | ||
| release-notes-0.14.3.md | ||
| release-notes-0.15.0.md | ||
| release-notes-0.15.1.md | ||
| release-notes-0.15.2.md | ||
| release-notes-0.15.3.md | ||
| release-notes-0.15.4.md | ||
| release-notes-0.15.5.md | ||
| release-notes-0.16.0.md | ||
| release-notes-0.16.1.md | ||
| release-notes-0.16.2.md | ||
| release-notes-0.16.3.md | ||
| release-notes-0.17.0.md | ||
| release-notes-0.17.1.md | ||
| release-notes-0.17.3.md | ||
| release-notes-0.17.4.md | ||
| release-notes-0.18.0.md | ||
| release-notes-0.18.1.md | ||
| release-notes-0.18.2.md | ||
| release-notes-0.18.3.md | ||
| release-notes-0.18.4.md | ||
| release-notes-0.18.5.md | ||
| release-notes-0.19.0.md | ||
| release-notes-0.19.1.md | ||
| release-notes-0.19.2.md | ||
| release-notes-0.19.3.md | ||
| release-notes-0.20.0.md | ||
| release-notes-0.20.1.md | ||
| release-notes-0.21.0.md | ||
| release-notes-0.22.0.md | ||
| release-notes-template.md | ||