aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-02-28 19:14:45 +0800
committerGitHub <noreply@github.com>2019-02-28 19:14:45 +0800
commitdac7cbcf21a601ef889aa56c59d22c3a3776099e (patch)
tree17aa30e1ba791dda9b464d8976d28cf1d93174ea /p2p/discover
parentdd28ba378a8138f95c1c261972894afafa4031c3 (diff)
parent57f959af41bd94887aafea87af6a1f80b8182cf5 (diff)
downloadgo-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar.gz
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar.bz2
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar.lz
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar.xz
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.tar.zst
go-tangerine-dac7cbcf21a601ef889aa56c59d22c3a3776099e.zip
p2p/enode: use localItemKey for local sequence number (#19131)
* p2p/discover: remove unused function * p2p/enode: use localItemKey for local sequence number I added localItemKey for this purpose in #18963, but then forgot to actually use it. This changes the database layout yet again and requires bumping the version number.
Diffstat (limited to 'p2p/discover')
-rw-r--r--p2p/discover/table_test.go2
-rw-r--r--p2p/discover/table_util_test.go9
2 files changed, 2 insertions, 9 deletions
diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go
index b5622e3a2..233687d79 100644
--- a/p2p/discover/table_test.go
+++ b/p2p/discover/table_test.go
@@ -624,6 +624,8 @@ func (tn *preminedTestnet) findnode(toid enode.ID, toaddr *net.UDPAddr, target e
func (*preminedTestnet) close() {}
func (*preminedTestnet) ping(toid enode.ID, toaddr *net.UDPAddr) error { return nil }
+var _ = (*preminedTestnet).mine // avoid linter warning about mine being dead code.
+
// mine generates a testnet struct literal with nodes at
// various distances to the given target.
func (tn *preminedTestnet) mine(target encPubkey) {
diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go
index e61c9e6fc..f4dbc25a3 100644
--- a/p2p/discover/table_util_test.go
+++ b/p2p/discover/table_util_test.go
@@ -17,7 +17,6 @@
package discover
import (
- "crypto/ecdsa"
"encoding/hex"
"fmt"
"math/rand"
@@ -167,11 +166,3 @@ func hexEncPubkey(h string) (ret encPubkey) {
copy(ret[:], b)
return ret
}
-
-func hexPubkey(h string) *ecdsa.PublicKey {
- k, err := decodePubkey(hexEncPubkey(h))
- if err != nil {
- panic(err)
- }
- return k
-}