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.
This commit is contained in:
Johan T. Halseth 2018-01-12 15:29:46 +01:00
parent d96b5b62eb
commit db0928fa6f
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
1 changed files with 1 additions and 14 deletions

View File

@ -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