()
| 323 | } |
| 324 | |
| 325 | func (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 | |
| 344 | func (self *StateMgr) isSyncedReady() bool { |
| 345 | // check action peer connections |