Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Oct 10, 2024
1 parent d90bd67 commit 32ded91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/discover/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (t *udp) sendPing(toid enode.ID, toaddr *net.UDPAddr, callback func()) <-ch
To: makeEndpoint(toaddr, 0), // TODO: maybe use known TCP port from DB
Expiration: uint64(time.Now().Add(expiration).Unix()),
}
packet, hash, err := encodePacket(t.priv, pingPacket, req)
packet, hash, err := encodePacket(t.priv, pingXDC, req)
if err != nil {
errc := make(chan error, 1)
errc <- err
Expand All @@ -321,7 +321,7 @@ func (t *udp) sendPing(toid enode.ID, toaddr *net.UDPAddr, callback func()) <-ch
}

func (t *udp) waitping(from enode.ID) error {
return <-t.pending(from, pingPacket, func(interface{}) bool { return true })
return <-t.pending(from, pingXDC, func(interface{}) bool { return true })
}

// findnode sends a findnode request to the given node and waits until
Expand Down Expand Up @@ -631,7 +631,7 @@ func (req *ping) handle(t *udp, from *net.UDPAddr, fromKey encPubkey, mac []byte
Expiration: uint64(time.Now().Add(expiration).Unix()),
})
n := wrapNode(enode.NewV4(key, from.IP, int(req.From.TCP), from.Port))
t.handleReply(n.ID(), pingPacket, req)
t.handleReply(n.ID(), pingXDC, req)
if time.Since(t.db.LastPongReceived(n.ID())) > bondExpiration {
t.sendPing(n.ID(), from, func() { t.addThroughPing(n) })
} else {
Expand Down

0 comments on commit 32ded91

Please sign in to comment.