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

Method getSyncedChainConfigView

consensus/vbft/state_mgmt.go:325–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323}
324
325func (self *StateMgr) getSyncedChainConfigView() uint32 {
326 if len(self.peers) < self.getMinActivePeerCount() {
327 return 0
328 }
329
330 views := make(map[uint32]int)
331 for _, p := range self.peers {
332 views[p.chainConfigView] += 1
333 }
334
335 for k, v := range views {
336 if v >= self.getMinActivePeerCount() {
337 return k
338 }
339 }
340
341 return 0
342}
343
344func (self *StateMgr) isSyncedReady() bool {
345 // check action peer connections

Callers 3

runMethod · 0.95
onPeerUpdateMethod · 0.95

Calls 1

getMinActivePeerCountMethod · 0.95

Tested by 1