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.
This commit is contained in:
Johan T. Halseth 2018-03-13 17:10:58 +01:00
parent 3347431923
commit 9b9fada675
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -1378,17 +1378,6 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32,
CommitResolution: uniClosure.CommitResolution, CommitResolution: uniClosure.CommitResolution,
HtlcResolutions: *uniClosure.HtlcResolutions, 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 // TODO(roasbeef): modify signal to also detect
// cooperative closures? // cooperative closures?