mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-28 17:53:30 +02:00
lntest+itest: remove assertion while iterating mempool
This commit is contained in:
parent
28203fc77c
commit
17f08a87db
@ -477,7 +477,14 @@ func testRevokedCloseRetributionRemoteHodl(ht *lntest.HarnessTest) {
|
|||||||
for _, txid := range mempool {
|
for _, txid := range mempool {
|
||||||
// Check that the justice tx has the appropriate number
|
// Check that the justice tx has the appropriate number
|
||||||
// of inputs.
|
// of inputs.
|
||||||
tx := ht.Miner.GetRawTransaction(txid)
|
//
|
||||||
|
// NOTE: We don't use `ht.Miner.GetRawTransaction`
|
||||||
|
// which asserts a txid must be found as the HTLC
|
||||||
|
// spending txes might be aggregated.
|
||||||
|
tx, err := ht.Miner.Client.GetRawTransaction(txid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
exNumInputs := 2 + numInvoices
|
exNumInputs := 2 + numInvoices
|
||||||
if len(tx.MsgTx().TxIn) == exNumInputs {
|
if len(tx.MsgTx().TxIn) == exNumInputs {
|
||||||
|
@ -372,9 +372,17 @@ func (h *HarnessMiner) AssertOutpointInMempool(op wire.OutPoint) *wire.MsgTx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, txid := range mempool {
|
for _, txid := range mempool {
|
||||||
// We require the RPC call to be succeeded and won't
|
// We don't use `ht.Miner.GetRawTransaction` which
|
||||||
// wait for it as it's an unexpected behavior.
|
// asserts a txid must be found. While iterating here,
|
||||||
tx := h.GetRawTransaction(txid)
|
// the actual mempool state might have been changed,
|
||||||
|
// causing a given txid being removed and cannot be
|
||||||
|
// found. For instance, the aggregation logic used in
|
||||||
|
// sweeping HTLC outputs will update the mempool by
|
||||||
|
// replacing the HTLC spending txes with a single one.
|
||||||
|
tx, err := h.Client.GetRawTransaction(txid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
msgTx = tx.MsgTx()
|
msgTx = tx.MsgTx()
|
||||||
for _, txIn := range msgTx.TxIn {
|
for _, txIn := range msgTx.TxIn {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user