MCPcopy Create free account
hub / github.com/DNAProject/DNA / updateParticipantConfig

Method updateParticipantConfig

consensus/vbft/service.go:645–666  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

643}
644
645func (self *Server) updateParticipantConfig() error {
646 blkNum := self.GetCurrentBlockNo()
647 block, _ := self.blockPool.getSealedBlock(blkNum - 1)
648 if block == nil {
649 return fmt.Errorf("failed to get sealed block (%d)", blkNum-1)
650 }
651 chainconfig := self.config
652 if block.Info.NewChainConfig != nil {
653 chainconfig = block.Info.NewChainConfig
654 }
655 self.metaLock.Lock()
656 cfg, err := self.buildParticipantConfig(blkNum, block, chainconfig)
657 if err == nil {
658 self.currentParticipantConfig = cfg
659 }
660 self.metaLock.Unlock()
661 if err != nil {
662 return fmt.Errorf("failed to build participant config (%d): %s", blkNum, err)
663 }
664 // TODO: if server is not in new config, self.stop()
665 return nil
666}
667
668func (self *Server) startNewRound() error {
669 blkNum := self.GetCurrentBlockNo()

Callers 2

startNewRoundMethod · 0.95
actionLoopMethod · 0.95

Calls 4

GetCurrentBlockNoMethod · 0.95
getSealedBlockMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected