@@ -1940,23 +1940,52 @@ func runExtraPreimageFromRemoteCommit(ht *lntest.HarnessTest,
1940
1940
numBlocks = htlc .ExpirationHeight - uint32 (height ) -
1941
1941
lncfg .DefaultOutgoingBroadcastDelta
1942
1942
1943
- // Mine empty blocks so Carol's htlc success tx stays in mempool. Once
1944
- // the height is reached, Bob's timeout resolver will resolve the htlc
1945
- // by extracing the preimage from the mempool.
1946
- ht .MineEmptyBlocks (int (numBlocks ))
1943
+ // We should now have Carol's htlc suucess tx in the mempool.
1944
+ numTxesMempool := 1
1947
1945
1948
1946
// For neutrino backend, the timeout resolver needs to extract the
1949
1947
// preimage from the blocks.
1950
1948
if ht .IsNeutrinoBackend () {
1951
1949
// Mine a block to confirm Carol's 2nd level success tx.
1952
1950
ht .MineBlocksAndAssertNumTxes (1 , 1 )
1951
+ numTxesMempool --
1953
1952
}
1953
+ // Mine empty blocks so Carol's htlc success tx stays in mempool. Once
1954
+ // the height is reached, Bob's timeout resolver will resolve the htlc
1955
+ // by extracing the preimage from the mempool.
1956
+ ht .MineEmptyBlocks (int (numBlocks ))
1954
1957
1955
1958
// Finally, check that the Alice's payment is marked as succeeded as
1956
1959
// Bob has settled the htlc using the preimage extracted from Carol's
1957
1960
// 2nd level success tx.
1958
1961
ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_SUCCEEDED )
1959
1962
1963
+ switch c {
1964
+ // For non-anchor channel type, we should expect to see Bob's commit
1965
+ // sweep in the mempool.
1966
+ case lnrpc .CommitmentType_LEGACY :
1967
+ numTxesMempool ++
1968
+
1969
+ // For non-anchor channel type, we should expect to see Bob's commit
1970
+ // sweep and his anchor sweep tx in the mempool.
1971
+ case lnrpc .CommitmentType_ANCHORS :
1972
+ numTxesMempool += 2
1973
+
1974
+ // For script-enforced leased channel, we should expect to see Bob's
1975
+ // anchor sweep tx in the mempool.
1976
+ case lnrpc .CommitmentType_SCRIPT_ENFORCED_LEASE :
1977
+ numTxesMempool ++
1978
+
1979
+ // For neutrino backend, because of the additional block mined,
1980
+ // Bob's output is now mature.
1981
+ if ht .IsNeutrinoBackend () {
1982
+ numTxesMempool ++
1983
+ }
1984
+ }
1985
+
1986
+ // Mine a block to clean the mempool.
1987
+ ht .MineBlocksAndAssertNumTxes (1 , numTxesMempool )
1988
+
1960
1989
// NOTE: for non-standby nodes there's no need to clean up the force
1961
1990
// close as long as the mempool is cleaned.
1962
1991
ht .CleanShutDown ()
0 commit comments