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

Method OnAddNode

p2pserver/block_sync.go:619–625  ·  view source on GitHub ↗

OnAddNode to node list when a new node added

(nodeId uint64)

Source from the content-addressed store, hash-verified

617
618//OnAddNode to node list when a new node added
619func (this *BlockSyncMgr) OnAddNode(nodeId uint64) {
620 log.Debugf("[p2p]OnAddNode:%d", nodeId)
621 this.lock.Lock()
622 defer this.lock.Unlock()
623 w := NewNodeWeight(nodeId)
624 this.nodeWeights[nodeId] = w
625}
626
627//OnDelNode remove from node list. When the node disconnect
628func (this *BlockSyncMgr) OnDelNode(nodeId uint64) {

Callers

nothing calls this directly

Calls 2

DebugfFunction · 0.92
NewNodeWeightFunction · 0.85

Tested by

no test coverage detected