Skip to main content

cross_connection_winner

Function cross_connection_winner 

Source
pub fn cross_connection_winner(
    our_node_addr: &NodeAddr,
    their_node_addr: &NodeAddr,
    this_is_outbound: bool,
) -> bool
Expand description

Determine winner of cross-connection tie-breaker.

Rule: The node with the smaller node_addr prefers its OUTBOUND connection. This is deterministic and symmetric: both nodes will reach the same conclusion.

§Arguments

  • our_node_addr - Our node’s ID
  • their_node_addr - The peer’s node ID
  • this_is_outbound - Whether the connection being evaluated is our outbound

§Returns

true if this connection should win (survive), false if it should close.