mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
multi: add itest testSweepAnchorCPFPLocalForceClose
This commit adds an itest case that focuses on validating the CPFP logic in anchor sweeping.
This commit is contained in:
@@ -508,7 +508,8 @@ func (t *TxPublisher) createAndCheckTx(req *BumpRequest, f FeeFunction) (
|
||||
return tx, fee, nil
|
||||
}
|
||||
|
||||
return nil, 0, err
|
||||
return nil, 0, fmt.Errorf("tx=%v failed mempool check: %w", tx.TxHash(),
|
||||
err)
|
||||
}
|
||||
|
||||
// broadcast takes a monitored tx and publishes it to the network. Prior to the
|
||||
@@ -852,7 +853,7 @@ func (t *TxPublisher) createAndPublishTx(requestID uint64,
|
||||
// directly here.
|
||||
tx, fee, err := t.createAndCheckTx(r.req, r.feeFunction)
|
||||
|
||||
// If the error is fee related, we will return an error and let the fee
|
||||
// If the error is fee related, we will return no error and let the fee
|
||||
// bumper retry it at next block.
|
||||
//
|
||||
// NOTE: we can check the RBF error here and ask the fee function to
|
||||
@@ -912,6 +913,18 @@ func (t *TxPublisher) createAndPublishTx(requestID uint64,
|
||||
return fn.None[BumpResult]()
|
||||
}
|
||||
|
||||
// If the result error is fee related, we will return no error and let
|
||||
// the fee bumper retry it at next block.
|
||||
//
|
||||
// NOTE: we may get this error if we've bypassed the mempool check,
|
||||
// which means we are suing neutrino backend.
|
||||
if errors.Is(result.Err, rpcclient.ErrInsufficientFee) ||
|
||||
errors.Is(result.Err, lnwallet.ErrMempoolFee) {
|
||||
|
||||
log.Debugf("Failed to bump tx %v: %v", oldTx.TxHash(), err)
|
||||
return fn.None[BumpResult]()
|
||||
}
|
||||
|
||||
// A successful replacement tx is created, attach the old tx.
|
||||
result.ReplacedTx = oldTx
|
||||
|
||||
|
Reference in New Issue
Block a user