contractcourt: return htlcResolution when currentHeight has reached expiry

Only create the sweep tx when the height has reached, otherwise we will
get a broadcast error. Previously it wasn't caught by itest due to the
blocks were mined very fast, so the lock time was always reached.
This commit is contained in:
yyforyongyu
2022-10-13 07:01:03 +08:00
parent 2285bfdf9f
commit 5ed37166ef
2 changed files with 9 additions and 11 deletions

View File

@@ -33,7 +33,7 @@ func TestHtlcOutgoingResolverTimeout(t *testing.T) {
// Notify arrival of the block after which the timeout path of the htlc
// unlocks.
ctx.notifyEpoch(outgoingContestHtlcExpiry - 1)
ctx.notifyEpoch(outgoingContestHtlcExpiry)
// Assert that the resolver finishes without error and transforms in a
// timeout resolver.