itest: add new coop close rbf itest
This ensures that during the RBF process, if one confirms, a re-org occurs, then another confirms, that we'll properly detect this case.
This commit is contained in:
1 parent
8f5656e6e2
commit
bb781bbe84
3 files changed
+194
-2
No files matched your search
@@ -1272,8 +1272,17 @@ func testChannelFundingWithUnstableUtxos(ht *lntest.HarnessTest) {
|
||||
// Make sure Carol sees her to_remote output from the force close tx.
|
||||
ht.AssertNumPendingSweeps(carol, 1)
|
||||
|
||||
// We need to wait for carol initiating the sweep of the to_remote
|
||||
// output of chanPoint2.
|
||||
// Wait for Carol's sweep transaction to appear in the mempool. Due to
|
||||
// async confirmation notifications, there's a race between when the
|
||||
// sweep is registered and when the sweeper processes the next block.
|
||||
// The sweeper uses immediate=false, so it broadcasts on the next block
|
||||
// after registration. Mine an empty block to trigger the broadcast.
|
||||
ht.MineEmptyBlocks(1)
|
||||
|
||||
// Now the sweep should be in the mempool.
|
||||
ht.AssertNumTxsInMempool(1)
|
||||
|
||||
// Now we should see the unconfirmed UTXO from the sweep.
|
||||
utxo := ht.AssertNumUTXOsUnconfirmed(carol, 1)[0]
|
||||
|
||||
// We now try to open channel using the unconfirmed utxo.
|
||||
@@ -1329,6 +1338,11 @@ func testChannelFundingWithUnstableUtxos(ht *lntest.HarnessTest) {
|
||||
// Make sure Carol sees her to_remote output from the force close tx.
|
||||
ht.AssertNumPendingSweeps(carol, 1)
|
||||
|
||||
// Mine an empty block to trigger the sweep broadcast (same fix as
|
||||
// above).
|
||||
ht.MineEmptyBlocks(1)
|
||||
ht.AssertNumTxsInMempool(1)
|
||||
|
||||
// Wait for the to_remote sweep tx to show up in carol's wallet.
|
||||
ht.AssertNumUTXOsUnconfirmed(carol, 1)
|
||||
|
||||
|
||||
Reference in new issue
Block a user