Skip to content

Make sure GetPeers response always fits within a single UDP datagram #3

@madadam

Description

@madadam

The spec says:

A node obeying this specification must not send UDP datagrams with a payload larger than 1024 octets,

We need to calculate the maximum number of values we can put into the response so the total message size is <= 1024 bytes. Call this number N. If we have more than N peers, we should take only N of them, but we should randomize which N to pick.

Note that N depend on whether we are sending ipv4 or ipv6 contacts and also on the number of ipv4 and/or ipv6 nodes we include in the message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions