mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-02 03:54:26 +02:00
multi: remove ErrDoubleSpend check for PublishTransaction
In this commit, we address a lingering issue within some subsystems that are responsible for broadcasting transactions. Previously, ErrDoubleSpend indicated that a transaction was already included in the mempool/chain. This error was then modified to actually be returned for conflicting transactions, but its callers were not modified accordingly. This would lead to conflicting transactions to be interpreted as valid, when they shouldn't be.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
@@ -148,7 +147,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
|
||||
// constructed, we'll broadcast the sweep transaction to the
|
||||
// network.
|
||||
err := h.PublishTx(h.sweepTx)
|
||||
if err != nil && err != lnwallet.ErrDoubleSpend {
|
||||
if err != nil {
|
||||
log.Infof("%T(%x): unable to publish tx: %v",
|
||||
h, h.payHash[:], err)
|
||||
return nil, err
|
||||
@@ -200,7 +199,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
|
||||
//
|
||||
// TODO(roasbeef): after changing sighashes send to tx bundler
|
||||
err := h.PublishTx(h.htlcResolution.SignedSuccessTx)
|
||||
if err != nil && err != lnwallet.ErrDoubleSpend {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user