aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discv5/net_test.go
diff options
context:
space:
mode:
authorkiel barry <kiel.j.barry@gmail.com>2018-05-08 19:08:43 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-05-08 19:08:43 +0800
commit864e80a48fd18fda89b80b11f9116c4e11cb835d (patch)
tree1eb9aa6bbae718b9505e67f4464c6750c08e51eb /p2p/discv5/net_test.go
parenta42be3b78dcb70ea3c44ba46c277cf41ef0bba23 (diff)
downloaddexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.gz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.bz2
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.lz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.xz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.zst
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.zip
p2p: fix some golint warnings (#16577)
Diffstat (limited to 'p2p/discv5/net_test.go')
-rw-r--r--p2p/discv5/net_test.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/p2p/discv5/net_test.go b/p2p/discv5/net_test.go
index 369282ca9..001d193cc 100644
--- a/p2p/discv5/net_test.go
+++ b/p2p/discv5/net_test.go
@@ -336,26 +336,26 @@ func (*preminedTestnet) localAddr() *net.UDPAddr {
// mine generates a testnet struct literal with nodes at
// various distances to the given target.
-func (n *preminedTestnet) mine(target NodeID) {
- n.target = target
- n.targetSha = crypto.Keccak256Hash(n.target[:])
+func (tn *preminedTestnet) mine(target NodeID) {
+ tn.target = target
+ tn.targetSha = crypto.Keccak256Hash(tn.target[:])
found := 0
for found < bucketSize*10 {
k := newkey()
id := PubkeyID(&k.PublicKey)
sha := crypto.Keccak256Hash(id[:])
- ld := logdist(n.targetSha, sha)
- if len(n.dists[ld]) < bucketSize {
- n.dists[ld] = append(n.dists[ld], id)
+ ld := logdist(tn.targetSha, sha)
+ if len(tn.dists[ld]) < bucketSize {
+ tn.dists[ld] = append(tn.dists[ld], id)
fmt.Println("found ID with ld", ld)
found++
}
}
fmt.Println("&preminedTestnet{")
- fmt.Printf(" target: %#v,\n", n.target)
- fmt.Printf(" targetSha: %#v,\n", n.targetSha)
- fmt.Printf(" dists: [%d][]NodeID{\n", len(n.dists))
- for ld, ns := range n.dists {
+ fmt.Printf(" target: %#v,\n", tn.target)
+ fmt.Printf(" targetSha: %#v,\n", tn.targetSha)
+ fmt.Printf(" dists: [%d][]NodeID{\n", len(tn.dists))
+ for ld, ns := range tn.dists {
if len(ns) == 0 {
continue
}