mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
p2p/discover: add comment
This commit is contained in:
parent
9de65574bd
commit
2251ceebd0
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue