File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
pkg/coordinator/tasks/check_consensus_slot_range Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,14 @@ func (t *Task) Execute(ctx context.Context) error {
9999
100100func (t * Task ) runRangeCheck () (checkResult , isLower bool ) {
101101 consensusPool := t .ctx .Scheduler .GetServices ().ClientPool ().GetConsensusPool ()
102- if consensusPool .GetBlockCache ().GetGenesis ().GenesisTime .Compare (time .Now ()) >= 0 {
102+ genesis := consensusPool .GetBlockCache ().GetGenesis ()
103+
104+ if genesis == nil {
105+ t .logger .Errorf ("genesis data not available" )
106+ return false , true
107+ }
108+
109+ if genesis .GenesisTime .Compare (time .Now ()) >= 0 {
103110 return false , true
104111 }
105112
@@ -109,7 +116,7 @@ func (t *Task) runRangeCheck() (checkResult, isLower bool) {
109116 return false , true
110117 }
111118
112- t .ctx .Outputs .SetVar ("genesisTime" , consensusPool . GetBlockCache (). GetGenesis () .GenesisTime .Unix ())
119+ t .ctx .Outputs .SetVar ("genesisTime" , genesis .GenesisTime .Unix ())
113120 t .ctx .Outputs .SetVar ("currentSlot" , currentSlot .Number ())
114121 t .ctx .Outputs .SetVar ("currentEpoch" , currentEpoch .Number ())
115122
You can’t perform that action at this time.
0 commit comments