mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 08:14:42 +00:00
node: source connection start/activity timestamps from the peer machine
The connection leg's started_at and last_activity duplicated the peer machine's own connection-state copy. Make the machine copy the sole live telemetry and timeout carrier: re-stamp it with the leg's provenance when the leg is attached at handshake start (the msg1-prep clock, not the earlier dial-time constructor value) and mirror the completion touch, then delete the leg's last_activity/touch accessors and source the connection-row projection, show_connections, and the timeout readers from the machine. Byte-identical for all normal paths.
This commit is contained in:
@@ -642,10 +642,17 @@ impl Node {
|
||||
self.peer_machines.contains_key(&link_id),
|
||||
"outbound msg1 prepared for link {link_id} with no dial-time machine"
|
||||
);
|
||||
self.peer_machines
|
||||
let machine = self
|
||||
.peer_machines
|
||||
.entry(link_id)
|
||||
.or_insert_with(|| PeerMachine::new_outbound(link_id, peer_identity, current_time_ms))
|
||||
.set_leg(connection);
|
||||
.or_insert_with(|| PeerMachine::new_outbound(link_id, peer_identity, current_time_ms));
|
||||
// The dial-born machine carrier was stamped at dial; re-stamp it with the
|
||||
// leg's msg1-prep clock so the surviving `started_at`/`last_activity`
|
||||
// carry the leg's provenance. The two clocks differ when a connect
|
||||
// round-trip separates dial from msg1 preparation.
|
||||
machine.set_conn_started_at(current_time_ms);
|
||||
machine.touch_conn(current_time_ms);
|
||||
machine.set_leg(connection);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user