Skip to content

Commit

Permalink
cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel committed Aug 22, 2024
1 parent 9931afe commit ea820ac
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions protocol/genesis/ssv/validator/msgqueue_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,17 @@ func (v *Validator) ConsumeQueue(logger *zap.Logger, msgID genesisspectypes.Mess
var runningInstance *instance.Instance
if runner.HasRunningDuty() {
runningInstance = runner.GetBaseRunner().State.RunningInstance
if runningInstance != nil {
decided, _ := runningInstance.IsDecided()
state.HasRunningInstance = !decided
}
}
state.Height = v.GetLastHeight(msgID)
state.Round = v.GetLastRound(msgID)
state.Quorum = v.Share.Quorum

filter := genesisqueue.FilterAny
if !runner.HasRunningDuty() {
if runningInstance == nil {
// If no duty is running, pop only ExecuteDuty messages.
filter = func(m *genesisqueue.GenesisSSVMessage) bool {
e, ok := m.Body.(*types.EventMsg)
if !ok {
logger.Error("❗ could not cast message body to EventMsg", fields.MessageID(spectypes.MessageID(m.MsgID)))
logger.Error("❗ could not cast message body to EventMsg", fields.MessageID(spectypes.MessageID(m.MsgID)), fields.MessageType(spectypes.MsgType(m.MsgType)))
return false
}
if e.Type == types.ExecuteDuty {
Expand Down

0 comments on commit ea820ac

Please sign in to comment.