Skip to content

server: Perform addr related tasks after handshake.#3690

Open
davecgh wants to merge 1 commit into
decred:masterfrom
davecgh:server_addrs_after_handshake
Open

server: Perform addr related tasks after handshake.#3690
davecgh wants to merge 1 commit into
decred:masterfrom
davecgh:server_addrs_after_handshake

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented May 13, 2026

This moves the logic related to requesting and advertising addresses to after the handshake completes as opposed to doing it during the handshake in the version message handler.

In practice, the overall effect is the same, but moving it to happen after the handshake has at least the following benefits:

  • It helps ensure no other messages are queued up or sent between the version and verack messages
  • It keeps the version handler focused on its primary purpose of negotiation and rejection of peers deemed to be unsuitable
  • It is easier to reason about the sequence of events

@davecgh davecgh added this to the 2.2.0 milestone May 13, 2026
This moves the logic related to requesting and advertising addresses to
after the handshake completes as opposed to doing it during the
handshake in the version message handler.

In practice, the overall effect is the same, but moving it to happen
after the handshake has at least the following benefits:

- It helps ensure no other messages are queued up or sent between the
  version and verack messages
- It keeps the version handler focused on its primary purpose of
  negotiation and rejection of peers deemed to be unsuitable
- It is easier to reason about the sequence of events
@davecgh davecgh force-pushed the server_addrs_after_handshake branch from db09081 to d4da7fd Compare May 13, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant