From d216416db84b7efd17ed9315fd8af5cfee8cc84b Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 29 Mar 2018 11:15:41 +0200 Subject: [PATCH] contractcourt/channel_arbitrator: ignore ErrDoubleSpend on force close This commit mitigates a problem within the ChannelArbitrator, where after a restart we would start up in the state StateBroadcastCommit but fail to broadcast out commitment because a conflicting transaction (most likely our own commitment) was already broadcast. A more complete fix for this case will be added later, but this commit let the ChannelArbitrator continue, trying to close out the channel. --- contractcourt/channel_arbitrator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 668309c19..83792ddb9 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -451,7 +451,9 @@ func (c *ChannelArbitrator) stateStep(bestHeight uint32, bestHash *chainhash.Has if err := c.cfg.PublishTx(closeTx); err != nil { log.Errorf("ChannelArbitrator(%v): unable to broadcast "+ "close tx: %v", c.cfg.ChanPoint, err) - return StateError, closeTx, err + if err != lnwallet.ErrDoubleSpend { + return StateError, closeTx, err + } } // As we've have broadcast the commitment transaction, we send