Skip to content

Commit

Permalink
GH-1072 Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jun 7, 2023
1 parent cdd05a8 commit 668d2a4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,11 @@ namespace eosio {
* Time message handling
* @{
*/
// Members set from network data
tstamp org{0}; //!< originate timestamp
tstamp rec{0}; //!< receive timestamp
tstamp dst{0}; //!< destination timestamp
tstamp xmt{0}; //!< transmit timestamp
// See NTP protocol. https://datatracker.ietf.org/doc/rfc5905/
tstamp org{0}; //!< origin timestamp. Time at the client when the request departed for the server.
tstamp rec{0}; //!< receive timestamp. Time at the server when the request arrived from the client.
tstamp dst{0}; //!< destination timestamp, Time at the client when the reply arrived from the server.
tstamp xmt{0}; //!< transmit timestamp, Time at the server when the response left for the client.
/** @} */
// timestamp for the lastest message
tstamp latest_msg_time{0};
Expand Down Expand Up @@ -3298,14 +3298,12 @@ namespace eosio {
void connection::handle_message( const time_message& msg ) {
peer_dlog( this, "received time_message: ${t}", ("t", msg) );

/* We've already lost however many microseconds it took to dispatch
* the message, but it can't be helped.
*/
// We've already lost however many microseconds it took to dispatch the message, but it can't be helped.
msg.dst = get_time();

// If the transmit timestamp is zero, the peer is horribly broken.
if(msg.xmt == 0)
return; /* invalid timestamp */
return; // invalid timestamp

auto msg_xmt = normalize_epoch_to_ns(msg.xmt);
auto msg_org = normalize_epoch_to_ns(msg.org);
Expand All @@ -3317,7 +3315,7 @@ namespace eosio {
}

if (msg_xmt == xmt)
return; /* duplicate packet */
return; // duplicate packet

xmt = msg_xmt;
rec = normalize_epoch_to_ns(msg.rec);
Expand Down

0 comments on commit 668d2a4

Please sign in to comment.