itest: fix testMultiHopHtlcLocalChainClaim
This commit is contained in:
1 file changed
+16
-11
@@ -1146,8 +1146,8 @@ func testMultiHopHtlcLocalChainClaim(ht *lntemp.HarnessTest,
|
|||||||
|
|
||||||
// We'll now mine enough blocks so Carol decides that she needs to go
|
// 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.
|
// on-chain to claim the HTLC as Bob has been inactive.
|
||||||
numBlocks := padCLTV(uint32(invoiceReq.CltvExpiry -
|
numBlocks := padCLTV(uint32(invoiceReq.CltvExpiry-
|
||||||
lncfg.DefaultIncomingBroadcastDelta))
|
lncfg.DefaultIncomingBroadcastDelta) - 1)
|
||||||
ht.MineBlocksAssertNodesSync(numBlocks)
|
ht.MineBlocksAssertNodesSync(numBlocks)
|
||||||
|
|
||||||
// Carol's commitment transaction should now be in the mempool. If
|
// Carol's commitment transaction should now be in the mempool. If
|
||||||
@@ -1185,10 +1185,10 @@ func testMultiHopHtlcLocalChainClaim(ht *lntemp.HarnessTest,
|
|||||||
case lnrpc.CommitmentType_ANCHORS:
|
case lnrpc.CommitmentType_ANCHORS:
|
||||||
expectedTxes = 3
|
expectedTxes = 3
|
||||||
|
|
||||||
// Carol will broadcast her second level HTLC transaction and anchor
|
// Carol will broadcast her second level HTLC transaction, and Bob will
|
||||||
// sweep, and Bob will sweep his anchor output. Bob can't sweep his
|
// sweep his anchor output. Bob can't sweep his commitment output yet
|
||||||
// commitment output yet as it has incurred an additional CLTV due to
|
// as it has incurred an additional CLTV due to being the initiator of
|
||||||
// being the initiator of a script-enforced leased channel.
|
// a script-enforced leased channel.
|
||||||
case lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE:
|
case lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE:
|
||||||
expectedTxes = 2
|
expectedTxes = 2
|
||||||
|
|
||||||
@@ -1235,13 +1235,18 @@ func testMultiHopHtlcLocalChainClaim(ht *lntemp.HarnessTest,
|
|||||||
|
|
||||||
// At this point, Bob should have broadcast his second layer success
|
// At this point, Bob should have broadcast his second layer success
|
||||||
// transaction, and should have sent it to the nursery for incubation.
|
// transaction, and should have sent it to the nursery for incubation.
|
||||||
numPendingChans := 1
|
|
||||||
if c == lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE {
|
|
||||||
numPendingChans++
|
|
||||||
}
|
|
||||||
ht.AssertNumPendingForceClose(bob, numPendingChans)
|
|
||||||
ht.AssertNumHTLCsAndStage(bob, aliceChanPoint, 1, 1)
|
ht.AssertNumHTLCsAndStage(bob, aliceChanPoint, 1, 1)
|
||||||
|
|
||||||
|
// The channel between Bob and Carol will still be pending force close
|
||||||
|
// if this is a leased channel. In that case, we'd also check the HTLC
|
||||||
|
// stages are correct in that channel.
|
||||||
|
if c == lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE {
|
||||||
|
ht.AssertNumPendingForceClose(bob, 2)
|
||||||
|
ht.AssertNumHTLCsAndStage(bob, bobChanPoint, 1, 1)
|
||||||
|
} else {
|
||||||
|
ht.AssertNumPendingForceClose(bob, 1)
|
||||||
|
}
|
||||||
|
|
||||||
// We'll now mine a block which should confirm Bob's second layer
|
// We'll now mine a block which should confirm Bob's second layer
|
||||||
// transaction.
|
// transaction.
|
||||||
block = ht.Miner.MineBlocksAndAssertNumTxes(1, 1)[0]
|
block = ht.Miner.MineBlocksAndAssertNumTxes(1, 1)[0]
|
||||||
|
|||||||
Reference in new issue
Block a user