itest: fix flake in testAnchorThirdPartySpend

This commit is contained in:
yyforyongyu 2023-03-16 01:45:50 +08:00
parent 8a2999c789
commit c87da1ff01
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -430,6 +430,15 @@ func testAnchorThirdPartySpend(ht *lntest.HarnessTest) {
commitTxn := ht.Miner.GetRawTransaction(forceCloseTxID) commitTxn := ht.Miner.GetRawTransaction(forceCloseTxID)
ht.Miner.MineBlockWithTxes([]*btcutil.Tx{commitTxn}) ht.Miner.MineBlockWithTxes([]*btcutil.Tx{commitTxn})
// Assert that the channel is now in PendingForceClose.
//
// NOTE: We must do this check to make sure `lnd` node has updated its
// internal state regarding the closing transaction, otherwise the
// `SendCoins` below might fail since it involves a reserved value
// check, which requires a certain amount of coins to be reserved based
// on the number of anchor channels.
ht.AssertChannelPendingForceClose(alice, aliceChanPoint1)
// With the anchor output located, and the main commitment mined we'll // With the anchor output located, and the main commitment mined we'll
// instruct the wallet to send all coins in the wallet to a new address // instruct the wallet to send all coins in the wallet to a new address
// (to the miner), including unconfirmed change. // (to the miner), including unconfirmed change.