contractcourt+itest: fix lingering pending channel after breach

This fixes an issue where the contract court could leave a completely
swept commit tx unresolved if it was swept by the remote party.

This could happen if (our) commit tx just published was actually a
previously revoked state, in which case the remote party would claim the
funds via a justice transaction.

This manifested itself in the testRevokedCloseRetribution integration
test where at the end of the test Bob was left with a pending channel
that never resolved itself.
This commit is contained in:
Matheus Degiovani committed 2020-05-12 07:46:14 -03:00
1 parent 338e12ecd0
commit d71a4ee033
2 files changed
+30 -5

No files matched your search

+9
View File
@@ -7586,6 +7586,15 @@ func testRevokedCloseRetribution(net *lntest.NetworkHarness, t *harnessTest) {
}
assertNodeNumChannels(t, carol, 0)
// Mine enough blocks for Bob's channel arbitrator to wrap up the
// references to the breached channel. The chanarb waits for commitment
// tx's confHeight+CSV-1 blocks and since we've already mined one that
// included the justice tx we only need to mine extra DefaultCSV-2
// blocks to unlock it.
mineBlocks(t, net, lntest.DefaultCSV-2, 0)
assertNumPendingChannels(t, net.Bob, 0, 0)
}
// testRevokedCloseRetributionZeroValueRemoteOutput tests that Dave is able