mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-19 18:48:03 +01:00
itest: adopt itests for the new behavior
Now outgoing dust-htlcs are canceled back before the commitment is confirmed onchain.
This commit is contained in:
@@ -250,6 +250,10 @@ func runMultiHopHtlcLocalTimeout(ht *lntest.HarnessTest,
|
|||||||
op := ht.OutPointFromChannelPoint(bobChanPoint)
|
op := ht.OutPointFromChannelPoint(bobChanPoint)
|
||||||
closeTx := ht.AssertOutpointInMempool(op)
|
closeTx := ht.AssertOutpointInMempool(op)
|
||||||
|
|
||||||
|
// Dust HTLCs are immediately canceled backwards as soon as the local
|
||||||
|
// commitment tx is successfully broadcasted to the local mempool.
|
||||||
|
ht.AssertActiveHtlcs(alice, payHash)
|
||||||
|
|
||||||
// Bob's anchor output should be offered to his sweep since Bob has
|
// Bob's anchor output should be offered to his sweep since Bob has
|
||||||
// time-sensitive HTLCs - we expect both anchors are offered.
|
// time-sensitive HTLCs - we expect both anchors are offered.
|
||||||
ht.AssertNumPendingSweeps(bob, 2)
|
ht.AssertNumPendingSweeps(bob, 2)
|
||||||
@@ -257,11 +261,6 @@ func runMultiHopHtlcLocalTimeout(ht *lntest.HarnessTest,
|
|||||||
// Mine a block to confirm the closing transaction.
|
// Mine a block to confirm the closing transaction.
|
||||||
ht.MineBlocksAndAssertNumTxes(1, 1)
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
|
||||||
// At this point, Bob should have canceled backwards the dust HTLC
|
|
||||||
// that we sent earlier. This means Alice should now only have a single
|
|
||||||
// HTLC on her channel.
|
|
||||||
ht.AssertActiveHtlcs(alice, payHash)
|
|
||||||
|
|
||||||
// With the closing transaction confirmed, we should expect Bob's HTLC
|
// With the closing transaction confirmed, we should expect Bob's HTLC
|
||||||
// timeout transaction to be offered to the sweeper due to the expiry
|
// timeout transaction to be offered to the sweeper due to the expiry
|
||||||
// being reached. we also expect Bon and Carol's anchor sweeps.
|
// being reached. we also expect Bon and Carol's anchor sweeps.
|
||||||
|
|||||||
Reference in New Issue
Block a user