Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions itest/lnd_revocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ func revokedCloseRetributionZeroValueRemoteOutputCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)

// Once connected, give Dave some time to enable the channel again.
// Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
ht.AssertChannelActive(dave, chanPoint)
ht.AssertChannelActive(carol, chanPoint)

// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
Expand Down Expand Up @@ -507,8 +509,10 @@ func revokedCloseRetributionRemoteHodlCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)

// Once connected, give Dave some time to enable the channel again.
// Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
ht.AssertChannelActive(dave, chanPoint)
ht.AssertChannelActive(carol, chanPoint)

// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
Expand Down
4 changes: 3 additions & 1 deletion itest/lnd_watchtower_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,10 @@ func testRevokedCloseRetributionAltruistWatchtowerCase(ht *lntest.HarnessTest,
// backup.
ht.EnsureConnected(dave, carol)

// Once connected, give Dave some time to enable the channel again.
// Once connected, wait for both channel links to be active again.
ht.AssertChannelInGraph(dave, chanPoint)
ht.AssertChannelActive(dave, chanPoint)
ht.AssertChannelActive(carol, chanPoint)

// Finally, send payments from Dave to Carol, consuming Carol's
// remaining payment hashes.
Expand Down
28 changes: 22 additions & 6 deletions lntest/miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,29 @@ func (h *HarnessMiner) AssertOutpointInMempool(op wire.OutPoint) *wire.MsgTx {
// GetNumTxsFromMempool polls until finding the desired number of transactions
// in the miner's mempool and returns the full transactions to the caller.
func (h *HarnessMiner) GetNumTxsFromMempool(n int) []*wire.MsgTx {
txids := h.AssertNumTxsInMempool(n)

var txes []*wire.MsgTx
for _, txid := range txids {
tx := h.GetRawTransaction(txid)
txes = append(txes, tx.MsgTx())
}

err := wait.NoError(func() error {
Comment thread
yyforyongyu marked this conversation as resolved.
txids := h.AssertNumTxsInMempool(n)

txes = nil
for _, txid := range txids {
// The mempool can change between listing its txids
// and fetching a transaction. For example, sweep
// tests may RBF-replace a tx while we iterate over
// the snapshot. Retry with a fresh snapshot when
// that happens.
tx, err := h.backend.GetRawTransaction(&txid)
if err != nil {
return err
}

txes = append(txes, tx.MsgTx())
}

return nil
}, wait.MinerMempoolTimeout)
require.NoError(h, err, "get txs from mempool")

return txes
}
Expand Down
Loading