mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-15 12:50:28 +02:00
staticaddr: don't ignore output-already-spent publish error
This commit is contained in:
parent
ff44b3b640
commit
b5af507c6b
1 changed files with 9 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcwallet/chain"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
"github.com/lightninglabs/loop/staticaddr/deposit"
|
||||
staticaddressrpc "github.com/lightninglabs/loop/swapserverrpc"
|
||||
|
|
@ -564,11 +565,17 @@ func (m *Manager) publishFinalizedWithdrawalTx(ctx context.Context,
|
|||
// Publish the withdrawal sweep transaction.
|
||||
err := m.cfg.WalletKit.PublishTransaction(ctx, tx, txLabel)
|
||||
if err != nil {
|
||||
if !strings.Contains(err.Error(), "output already spent") &&
|
||||
!strings.Contains(err.Error(), "insufficient fee") {
|
||||
if !strings.Contains(err.Error(), chain.ErrSameNonWitnessData.Error()) &&
|
||||
!strings.Contains(err.Error(), "output already spent") &&
|
||||
!strings.Contains(err.Error(), chain.ErrInsufficientFee.Error()) {
|
||||
|
||||
return false, err
|
||||
} else {
|
||||
if strings.Contains(err.Error(), "output already spent") {
|
||||
log.Warnf("output already spent, tx %v, %v",
|
||||
tx.TxHash(), err)
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue