mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 14:03:46 +00:00
fix: utp send call to maintain nonce
This commit is contained in:
parent
c1ed669bb6
commit
c6aa362ebb
2 changed files with 6 additions and 1 deletions
|
|
@ -326,7 +326,7 @@ func (p *PortalProtocol) setupUDPListening() error {
|
||||||
if id, ok := p.cachedIds[addr.String()]; ok {
|
if id, ok := p.cachedIds[addr.String()]; ok {
|
||||||
//_, err := p.DiscV5.TalkRequestToID(id, addr, string(portalwire.UTPNetwork), buf)
|
//_, err := p.DiscV5.TalkRequestToID(id, addr, string(portalwire.UTPNetwork), buf)
|
||||||
req := &v5wire.TalkRequest{Protocol: string(portalwire.Utp), Message: buf}
|
req := &v5wire.TalkRequest{Protocol: string(portalwire.Utp), Message: buf}
|
||||||
p.DiscV5.sendFromAnotherThread(id, netip.AddrPortFrom(netutil.IPToAddr(addr.IP), uint16(addr.Port)), req)
|
p.DiscV5.sendFromAnotherThreadWithCall(id, netip.AddrPortFrom(netutil.IPToAddr(addr.IP), uint16(addr.Port)), req)
|
||||||
|
|
||||||
return len(buf), err
|
return len(buf), err
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -686,6 +686,11 @@ func (t *UDPv5) sendFromAnotherThread(toID enode.ID, toAddr netip.AddrPort, pack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *UDPv5) sendFromAnotherThreadWithCall(toID enode.ID, toAddr netip.AddrPort, packet v5wire.Packet) {
|
||||||
|
resp := t.callToID(toID, toAddr, v5wire.TalkRequestMsg, packet)
|
||||||
|
defer t.callDone(resp)
|
||||||
|
}
|
||||||
|
|
||||||
// send sends a packet to the given node.
|
// send sends a packet to the given node.
|
||||||
func (t *UDPv5) send(toID enode.ID, toAddr netip.AddrPort, packet v5wire.Packet, c *v5wire.Whoareyou) (v5wire.Nonce, error) {
|
func (t *UDPv5) send(toID enode.ID, toAddr netip.AddrPort, packet v5wire.Packet, c *v5wire.Whoareyou) (v5wire.Nonce, error) {
|
||||||
addr := toAddr.String()
|
addr := toAddr.String()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue