MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / new

Method new

nodedb-cluster/src/swim/wire/authenticated.rs:81–88  ·  view source on GitHub ↗

Construct from the cluster MAC key and the bound local address. Passing [`MacKey::zero`] is the insecure-mode opt-out — MAC and replay detection are cosmetic in that mode but the wire format stays identical so mixed-mode misconfiguration fails loudly instead of succeeding by accident.

(mac_key: MacKey, local_addr: SocketAddr)

Source from the content-addressed store, hash-verified

79 /// stays identical so mixed-mode misconfiguration fails loudly
80 /// instead of succeeding by accident.
81 pub fn new(mac_key: MacKey, local_addr: SocketAddr) -> Self {
82 Self {
83 mac_key,
84 local_addr_hash: addr_hash(local_addr),
85 seq_out: PeerSeqSender::new(),
86 seq_in: PeerSeqWindow::new(),
87 }
88 }
89
90 /// Hash of the local bound address — used as the envelope's
91 /// `from_node_id` on every outbound datagram.

Callers

nothing calls this directly

Calls 1

addr_hashFunction · 0.85

Tested by

no test coverage detected