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

Method AppendNewSpeed

p2pserver/block_sync.go:106–109  ·  view source on GitHub ↗

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

(s float32)

Source from the content-addressed store, hash-verified

104
105//addNewSpeed apend the new speed to tail, remove the oldest one
106func (this *NodeWeight) AppendNewSpeed(s float32) {
107 copy(this.speed[0:SYNC_NODE_RECORD_SPEED_CNT-1], this.speed[1:])
108 this.speed[SYNC_NODE_RECORD_SPEED_CNT-1] = s
109}
110
111//Weight calculate node's weight for sort. Highest weight node will be accessed first for next request.
112func (this *NodeWeight) Weight() float32 {

Callers 1

addNewSpeedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected