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

Method addNewSpeed

p2pserver/block_sync.go:963–968  ·  view source on GitHub ↗

addNewSpeed apend the new speed to tail, remove the oldest one

(nodeId uint64, speed float32)

Source from the content-addressed store, hash-verified

961
962//addNewSpeed apend the new speed to tail, remove the oldest one
963func (this *BlockSyncMgr) addNewSpeed(nodeId uint64, speed float32) {
964 n := this.getNodeWeight(nodeId)
965 if n != nil {
966 n.AppendNewSpeed(speed)
967 }
968}
969
970//pingOutsyncNodes send ping msg to lower height nodes for syncing
971func (this *BlockSyncMgr) pingOutsyncNodes(curHeight uint32) {

Callers 1

OnBlockReceiveMethod · 0.95

Calls 2

getNodeWeightMethod · 0.95
AppendNewSpeedMethod · 0.80

Tested by

no test coverage detected