From 3f14ee587043c5fb156d94715397c8cbcf26df82 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 25 Oct 2022 14:48:09 +0800 Subject: [PATCH] itest: fix `testMultiHopHtlcRemoteChainClaim` and linters This commit makes sure the test `testMultiHopHtlcRemoteChainClaim` takes account of the one block mined while closing the channel. --- lntest/itest/lnd_multi-hop_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lntest/itest/lnd_multi-hop_test.go b/lntest/itest/lnd_multi-hop_test.go index 9781ef096..948edd801 100644 --- a/lntest/itest/lnd_multi-hop_test.go +++ b/lntest/itest/lnd_multi-hop_test.go @@ -1439,7 +1439,7 @@ func testMultiHopHtlcRemoteChainClaim(ht *lntemp.HarnessTest, // We'll now mine enough blocks so Carol decides that she needs to go // on-chain to claim the HTLC as Bob has been inactive. numBlocks := padCLTV(uint32( - invoiceReq.CltvExpiry - lncfg.DefaultIncomingBroadcastDelta, + invoiceReq.CltvExpiry - lncfg.DefaultIncomingBroadcastDelta - 1, )) if c != lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE { numBlocks -= defaultCSV @@ -1836,11 +1836,13 @@ func testMultiHopHtlcAggregation(ht *lntemp.HarnessTest, prevOp := tx.TxIn[i].PreviousOutPoint if _, ok := successOuts[prevOp]; ok { successTxs = append(successTxs, &txid) + break } if _, ok := timeoutOuts[prevOp]; ok { timeoutTxs = append(timeoutTxs, &txid) + break } }