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:
parent
d96b5b62eb
commit
db0928fa6f
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/lightningnetwork/lnd/channeldb"
|
"github.com/lightningnetwork/lnd/channeldb"
|
||||||
@ -439,20 +438,8 @@ func (c *channelCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message, b
|
|||||||
return spew.Sdump(closeTx)
|
return spew.Sdump(closeTx)
|
||||||
}))
|
}))
|
||||||
if err := c.cfg.broadcastTx(closeTx); err != nil {
|
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
|
// Clear out the current channel state, marking the channel as
|
||||||
// being closed within the database.
|
// being closed within the database.
|
||||||
|
Loading…
Reference in New Issue
Block a user