@@ -528,24 +528,29 @@ func (builder *Builder) buildNodeInfoManager() error {
528528 return errors .New ("cannot find staking protocol" )
529529 }
530530 chain := builder .cs .chain
531- dm := nodeinfo .NewInfoManager (& builder .cfg .NodeInfo , cs .p2pAgent , cs .chain , func () []string {
532- ctx := protocol .WithFeatureCtx (
533- protocol .WithBlockCtx (
534- genesis .WithGenesisContext (context .Background (), chain .Genesis ()),
535- protocol.BlockCtx {BlockHeight : chain .TipHeight ()},
536- ),
537- )
538- candidates , err := stk .ActiveCandidates (ctx , cs .factory , 0 )
539- if err != nil {
540- log .L ().Error ("failed to get active candidates" , zap .Error (errors .WithStack (err )))
541- return nil
542- }
543- whiteList := make ([]string , len (candidates ))
544- for i := range whiteList {
545- whiteList [i ] = candidates [i ].Address
546- }
547- return whiteList
548- }, builder .cfg .Chain .ProducerPrivateKeys ()... )
531+ var dm * nodeinfo.InfoManager
532+ if builder .cfg .System .Active {
533+ dm = nodeinfo .NewInfoManager (& builder .cfg .NodeInfo , cs .p2pAgent , cs .chain , func () []string {
534+ ctx := protocol .WithFeatureCtx (
535+ protocol .WithBlockCtx (
536+ genesis .WithGenesisContext (context .Background (), chain .Genesis ()),
537+ protocol.BlockCtx {BlockHeight : chain .TipHeight ()},
538+ ),
539+ )
540+ candidates , err := stk .ActiveCandidates (ctx , cs .factory , 0 )
541+ if err != nil {
542+ log .L ().Error ("failed to get active candidates" , zap .Error (errors .WithStack (err )))
543+ return nil
544+ }
545+ whiteList := make ([]string , len (candidates ))
546+ for i := range whiteList {
547+ whiteList [i ] = candidates [i ].Address
548+ }
549+ return whiteList
550+ }, builder .cfg .Chain .ProducerPrivateKeys ()... )
551+ } else {
552+ dm = nodeinfo .NewInfoManager (& builder .cfg .NodeInfo , cs .p2pAgent , cs .chain , nil )
553+ }
549554 builder .cs .nodeInfoManager = dm
550555 builder .cs .lifecycle .Add (dm )
551556 return nil
0 commit comments