Merge pull request #7681 from yyforyongyu/btcwallet-mempool

mod: update btcwallet's version
This commit is contained in:
Oliver Gugger authored and GitHub committed 2023-05-22 10:24:17 +02:00
commit 3d53d6909a
7 files changed
+56 -24

No files matched your search

+3
View File
@@ -296,6 +296,9 @@ func (m *mppTestScenario) openChannels(r *mppOpenChannelRequest) {
for _, cp := range m.channelPoints {
m.ht.AssertTopologyChannelOpen(hn, cp)
}
// Each node should have exactly 6 edges.
m.ht.AssertNumEdges(hn, len(m.channelPoints), false)
}
}
+33 -9
View File
@@ -1936,11 +1936,6 @@ func runExtraPreimageFromRemoteCommit(ht *lntest.HarnessTest,
// notice the force close from Carol.
require.NoError(ht, restartBob())
// For anchor channels, Bob should sweep his anchor output.
if lntest.CommitTypeHasAnchors(c) {
ht.Miner.AssertNumTxsInMempool(1)
}
// Get the current height to compute number of blocks to mine to
// trigger the htlc timeout resolver from Bob.
_, height := ht.Miner.GetBestBlock()
@@ -1949,23 +1944,52 @@ func runExtraPreimageFromRemoteCommit(ht *lntest.HarnessTest,
numBlocks = htlc.ExpirationHeight - uint32(height) -
lncfg.DefaultOutgoingBroadcastDelta
// Mine empty blocks so Carol's htlc success tx stays in mempool. Once
// the height is reached, Bob's timeout resolver will resolve the htlc
// by extracing the preimage from the mempool.
ht.MineEmptyBlocks(int(numBlocks))
// We should now have Carol's htlc suucess tx in the mempool.
numTxesMempool := 1
// For neutrino backend, the timeout resolver needs to extract the
// preimage from the blocks.
if ht.IsNeutrinoBackend() {
// Mine a block to confirm Carol's 2nd level success tx.
ht.MineBlocksAndAssertNumTxes(1, 1)
numTxesMempool--
}
// Mine empty blocks so Carol's htlc success tx stays in mempool. Once
// the height is reached, Bob's timeout resolver will resolve the htlc
// by extracing the preimage from the mempool.
ht.MineEmptyBlocks(int(numBlocks))
// Finally, check that the Alice's payment is marked as succeeded as
// Bob has settled the htlc using the preimage extracted from Carol's
// 2nd level success tx.
ht.AssertPaymentStatus(alice, preimage, lnrpc.Payment_SUCCEEDED)
switch c {
// For non-anchor channel type, we should expect to see Bob's commit
// sweep in the mempool.
case lnrpc.CommitmentType_LEGACY:
numTxesMempool++
// For non-anchor channel type, we should expect to see Bob's commit
// sweep and his anchor sweep tx in the mempool.
case lnrpc.CommitmentType_ANCHORS:
numTxesMempool += 2
// For script-enforced leased channel, we should expect to see Bob's
// anchor sweep tx in the mempool.
case lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE:
numTxesMempool++
// For neutrino backend, because of the additional block mined,
// Bob's output is now mature.
if ht.IsNeutrinoBackend() {
numTxesMempool++
}
}
// Mine a block to clean the mempool.
ht.MineBlocksAndAssertNumTxes(1, numTxesMempool)
// NOTE: for non-standby nodes there's no need to clean up the force
// close as long as the mempool is cleaned.
ht.CleanShutDown()
+4 -3
View File
@@ -264,6 +264,7 @@ func testSwitchOfflineDeliveryOutgoingOffline(ht *lntest.HarnessTest) {
// three channels. Note that we won't call the cleanUp function here as
// we will manually stop the node Carol and her channel.
s := setupScenarioFourNodes(ht)
defer s.cleanUp()
// Disconnect the two intermediaries, Alice and Dave, so that when carol
// restarts, the response will be held by Dave.
@@ -296,7 +297,7 @@ func testSwitchOfflineDeliveryOutgoingOffline(ht *lntest.HarnessTest) {
// Shutdown carol and leave her offline for the rest of the test. This
// is critical, as we wish to see if Dave can propragate settles even if
// the outgoing link is never revived.
ht.Shutdown(s.carol)
restartCarol := ht.SuspendNode(s.carol)
// Now restart Dave, ensuring he is both persisting the settles, and is
// able to reforward them to Alice after recovering from a restart.
@@ -339,8 +340,8 @@ func testSwitchOfflineDeliveryOutgoingOffline(ht *lntest.HarnessTest) {
amountPaid+(baseFee*numPayments)*2, int64(0),
)
ht.CloseChannel(s.alice, s.chanPointAliceBob)
ht.CloseChannel(s.dave, s.chanPointDaveAlice)
// Finally, restart Carol so the cleanup process can be finished.
require.NoError(ht, restartCarol())
}
// scenarioFourNodes specifies a scenario which we have a topology that has