From 2251ceebd013bf8dcfc115d1f9fb7572149c8d91 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 2 Apr 2025 13:07:28 +0200 Subject: [PATCH] p2p/discover: add comment --- p2p/discover/v5_udp_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/discover/v5_udp_test.go b/p2p/discover/v5_udp_test.go index 30631d2f6e..50c5923fad 100644 --- a/p2p/discover/v5_udp_test.go +++ b/p2p/discover/v5_udp_test.go @@ -775,6 +775,8 @@ type testCodecFrame struct { } func (c *testCodec) Encode(toID enode.ID, addr string, p v5wire.Packet, _ *v5wire.Whoareyou) ([]byte, v5wire.Nonce, error) { + // To match the behavior of v5wire.Codec, we return the cached encoding of + // WHOAREYOU challenges. if wp, ok := p.(*v5wire.Whoareyou); ok && len(wp.Encoded) > 0 { return wp.Encoded, wp.Nonce, nil }