cnct: simplify channel arbitrator state logging

This commit is contained in:
Joost Jager
2020-03-12 17:34:55 +01:00
parent 3b517390d8
commit e8e99c6533

View File

@@ -850,28 +850,24 @@ func (c *ChannelArbitrator) stateStep(
// We are waiting for a commitment to be confirmed, so any // We are waiting for a commitment to be confirmed, so any
// other trigger will be ignored. // other trigger will be ignored.
case chainTrigger, userTrigger: case chainTrigger, userTrigger:
log.Infof("ChannelArbitrator(%v): noop trigger %v",
c.cfg.ChanPoint, trigger)
nextState = StateCommitmentBroadcasted nextState = StateCommitmentBroadcasted
// If this state advance was triggered by any of the // If this state advance was triggered by any of the
// commitments being confirmed, then we'll jump to the state // commitments being confirmed, then we'll jump to the state
// where the contract has been closed. // where the contract has been closed.
case localCloseTrigger, remoteCloseTrigger: case localCloseTrigger, remoteCloseTrigger:
log.Infof("ChannelArbitrator(%v): trigger %v, "+
" going to StateContractClosed",
c.cfg.ChanPoint, trigger)
nextState = StateContractClosed nextState = StateContractClosed
// If a coop close or breach was confirmed, jump straight to // If a coop close or breach was confirmed, jump straight to
// the fully resolved state. // the fully resolved state.
case coopCloseTrigger, breachCloseTrigger: case coopCloseTrigger, breachCloseTrigger:
log.Infof("ChannelArbitrator(%v): trigger %v, "+
" going to StateFullyResolved",
c.cfg.ChanPoint, trigger)
nextState = StateFullyResolved nextState = StateFullyResolved
} }
log.Infof("ChannelArbitrator(%v): trigger %v moving from "+
"state %v to %v", c.cfg.ChanPoint, trigger, c.state,
nextState)
// If we're in this state, then the contract has been fully closed to // If we're in this state, then the contract has been fully closed to
// outside sub-systems, so we'll process the prior set of on-chain // outside sub-systems, so we'll process the prior set of on-chain
// contract actions and launch a set of resolvers. // contract actions and launch a set of resolvers.