From 027b46d0c1e4d921471313cf300903e3c6a6b78d Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 22 Nov 2021 15:26:54 -0800 Subject: [PATCH] ipn/ipnstate: clarify PeerStatusLite.LastHandshake And document the other fields, as long as we're here. Updates #1182 Signed-off-by: Josh Bleecher Snyder --- ipn/ipnstate/ipnstate.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go index 0664c4a2b..be6bf433f 100644 --- a/ipn/ipnstate/ipnstate.go +++ b/ipn/ipnstate/ipnstate.go @@ -70,9 +70,14 @@ func (s *Status) Peers() []key.NodePublic { } type PeerStatusLite struct { + // TxBytes/RxBytes is the total number of bytes transmitted to/received from this peer. TxBytes, RxBytes int64 - LastHandshake time.Time - NodeKey key.NodePublic + // LastHandshake is the last time a handshake succeeded with this peer. + // (Or we got key confirmation via the first data message, + // which is approximately the same thing.) + LastHandshake time.Time + // NodeKey is this peer's public node key. + NodeKey key.NodePublic } type PeerStatus struct {