From 9b9fada6751e22cd0391174b346cc9c5daf64cf7 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 13 Mar 2018 17:10:58 +0100 Subject: [PATCH] contractcourt: remove unecessary contractRes check This commit removes a short circuit checking if the contract resolver after a unilateral close is empty. After removing this, the state machine will advance the state from StateDefault->ContractClosed, in which the stateCallback will be called, logging the state needed to advance. Since this logged state is empty, the state machine will go directly to StateFullyResolved, which will trigger the MarkChannelResolved call. This means the behaviour is kept. --- contractcourt/channel_arbitrator.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 5cc9d9fe..42a31344 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -1378,17 +1378,6 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32, CommitResolution: uniClosure.CommitResolution, HtlcResolutions: *uniClosure.HtlcResolutions, } - if contractRes.IsEmpty() { - log.Infof("ChannelArbitrator(%v): contract "+ - "resolutions empty, exiting", c.cfg.ChanPoint) - - err := c.cfg.MarkChannelResolved() - if err != nil { - log.Errorf("unable to resolve "+ - "contract: %v", err) - } - return - } // TODO(roasbeef): modify signal to also detect // cooperative closures?