MCPcopy Create free account
hub / github.com/ethstorage/es-node / addPeerToTask

Method addPeerToTask

ethstorage/p2p/protocol/syncclient.go:1364–1374  ·  view source on GitHub ↗
(contractShards map[common.Address][]uint64)

Source from the content-addressed store, hash-verified

1362}
1363
1364func (s *SyncClient) addPeerToTask(contractShards map[common.Address][]uint64) {
1365 for contract, shards := range contractShards {
1366 for _, shard := range shards {
1367 for _, t := range s.tasks {
1368 if t.Contract == contract && shard == t.ShardId {
1369 t.state.PeerCount++
1370 }
1371 }
1372 }
1373 }
1374}
1375
1376func (s *SyncClient) removePeerFromTask(contractShards map[common.Address][]uint64) {
1377 for contract, shards := range contractShards {

Callers 1

AddPeerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected