From ed5db96e05f208c819f86e44ca0cd78a126d4d34 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 21 Aug 2018 12:54:58 +0200 Subject: [PATCH] contractcourt/channel_arbittrator: ignore noResolutions error on startup --- contractcourt/channel_arbitrator.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index f803f806b..ba64eecc2 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -295,8 +295,23 @@ func (c *ChannelArbitrator) Start() error { startingState := c.state nextState, _, err := c.advanceState(triggerHeight, trigger) if err != nil { - c.cfg.BlockEpochs.Cancel() - return err + switch err { + + // If we detect that we tried to fetch resolutions, but failed, + // this channel was marked closed in the database before + // resolutions successfully written. In this case there is not + // much we can do, so we don't return the error. + case errScopeBucketNoExist: + fallthrough + case errNoResolutions: + log.Warnf("ChannelArbitrator(%v): detected closed"+ + "channel with no contract resolutions written.", + c.cfg.ChanPoint) + + default: + c.cfg.BlockEpochs.Cancel() + return err + } } // If we start and ended at the awaiting full resolution state, then