Skip to content

Commit

Permalink
Attempt to fix panic in ProcessSyncMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Mar 10, 2022
1 parent 8ad5258 commit 306f9a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ibft/controller/controller_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package controller

import (
"context"
"time"

"github.com/bloxapp/ssv/ibft/proto"
"github.com/bloxapp/ssv/ibft/sync/history"
"github.com/bloxapp/ssv/ibft/sync/incoming"
"github.com/bloxapp/ssv/network"
"github.com/bloxapp/ssv/network/msgqueue"
"github.com/bloxapp/ssv/utils/tasks"
"github.com/pkg/errors"
"time"
)

// syncRetries is the number of reties to perform for history sync
Expand All @@ -35,7 +36,7 @@ func (i *Controller) processSyncQueueMessages() {
func (i *Controller) ProcessSyncMessage(msg *network.SyncChanObj) {
var lastChangeRoundMsg *proto.SignedMessage
currentInstaceSeqNumber := int64(-1)
if i.currentInstance != nil {
if i.currentInstance != nil && i.currentInstance.State() != nil && i.currentInstance.State().SeqNumber != nil {
lastChangeRoundMsg = i.currentInstance.GetLastChangeRoundMsg()
currentInstaceSeqNumber = int64(i.currentInstance.State().SeqNumber.Get())
}
Expand Down

0 comments on commit 306f9a6

Please sign in to comment.