From db0928fa6f3a3e309cc7860ae525e13d0502107e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 12 Jan 2018 15:29:46 +0100 Subject: [PATCH] chancloser: don't check error returned from broadcastTx This commit removes the inspection of the return error from broadcastTx. This is done since the new error checking added to PublishTransaction will return a nil error in case the transaction already exists in the mempool. --- chancloser.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/chancloser.go b/chancloser.go index 46cafe91..24dc18e5 100644 --- a/chancloser.go +++ b/chancloser.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "strings" "github.com/davecgh/go-spew/spew" "github.com/lightningnetwork/lnd/channeldb" @@ -439,19 +438,7 @@ func (c *channelCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message, b return spew.Sdump(closeTx) })) if err := c.cfg.broadcastTx(closeTx); err != nil { - // TODO(halseth): add relevant error types to the - // WalletController interface as this is quite fragile. - switch { - case strings.Contains(err.Error(), "already exists"): - fallthrough - case strings.Contains(err.Error(), "already have"): - peerLog.Debugf("channel close tx from "+ - "ChannelPoint(%v) already exist, "+ - "probably broadcast by peer: %v", - c.chanPoint, err) - default: - return nil, false, err - } + return nil, false, err } // Clear out the current channel state, marking the channel as