瀏覽代碼

p2p/discover: remove unused function

Felix Lange 6 年之前
父節點
當前提交
cf147c71d5
共有 2 個文件被更改,包括 2 次插入9 次删除
  1. 2 0
      p2p/discover/table_test.go
  2. 0 9
      p2p/discover/table_util_test.go

+ 2 - 0
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) {

+ 0 - 9
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
-}