getAllNodeWeights get all nodeweight and return a slice
()
| 926 | |
| 927 | //getAllNodeWeights get all nodeweight and return a slice |
| 928 | func (this *BlockSyncMgr) getAllNodeWeights() NodeWeights { |
| 929 | this.lock.RLock() |
| 930 | defer this.lock.RUnlock() |
| 931 | weights := make(NodeWeights, 0, len(this.nodeWeights)) |
| 932 | for _, w := range this.nodeWeights { |
| 933 | weights = append(weights, w) |
| 934 | } |
| 935 | return weights |
| 936 | } |
| 937 | |
| 938 | //addTimeoutCnt incre a node's timeout count |
| 939 | func (this *BlockSyncMgr) addTimeoutCnt(nodeId uint64) { |