Skip to content

Commit 9e8cc00

Browse files
authored
p2p: remove unused code (ethereum#20325)
1 parent ac5e28e commit 9e8cc00

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

p2p/rlpx.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,6 @@ func (h *encHandshake) makeAuthResp() (msg *authRespV4, err error) {
422422
return msg, nil
423423
}
424424

425-
func (msg *authMsgV4) sealPlain(h *encHandshake) ([]byte, error) {
426-
buf := make([]byte, authMsgLen)
427-
n := copy(buf, msg.Signature[:])
428-
n += copy(buf[n:], crypto.Keccak256(exportPubkey(&h.randomPrivKey.PublicKey)))
429-
n += copy(buf[n:], msg.InitiatorPubkey[:])
430-
n += copy(buf[n:], msg.Nonce[:])
431-
buf[n] = 0 // token-flag
432-
return ecies.Encrypt(rand.Reader, h.remote, buf, nil, nil)
433-
}
434-
435425
func (msg *authMsgV4) decodePlain(input []byte) {
436426
n := copy(msg.Signature[:], input)
437427
n += shaLen // skip sha3(initiator-ephemeral-pubk)

p2p/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ type Server struct {
199199
checkpointAddPeer chan *conn
200200

201201
// State of run loop and listenLoop.
202-
lastLookup time.Time
203202
inboundHistory expHeap
204203
}
205204

@@ -410,7 +409,7 @@ type sharedUDPConn struct {
410409
func (s *sharedUDPConn) ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error) {
411410
packet, ok := <-s.unhandled
412411
if !ok {
413-
return 0, nil, errors.New("Connection was closed")
412+
return 0, nil, errors.New("connection was closed")
414413
}
415414
l := len(packet.Data)
416415
if l > len(b) {

p2p/util.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ func (h *expHeap) add(item string, exp time.Time) {
4040
heap.Push(h, expItem{item, exp})
4141
}
4242

43-
// remove removes an item.
44-
func (h *expHeap) remove(item string) bool {
45-
for i, v := range *h {
46-
if v.item == item {
47-
heap.Remove(h, i)
48-
return true
49-
}
50-
}
51-
return false
52-
}
53-
5443
// contains checks whether an item is present.
5544
func (h expHeap) contains(item string) bool {
5645
for _, v := range h {

0 commit comments

Comments
 (0)