-
Notifications
You must be signed in to change notification settings - Fork 115
Fix "last seen date" for connected peers api route. #141
Comments
@ceilican What do you think about it? I can easily implement this changes, but firstly I need to |
I think if you see this peer right now, then you should return now as last time :) |
In principle, I think Both Do we currently have a way to track the true last time we interacted with the peer? If not, we could consider implementing it. If we need to choose between the |
|
Updating some field on every message could be expensive(we need to send a message to PeerManager on such an event). As an alternative, we can update PeerManager on certain kind of message to be got over wire. In Scorex we dont' have Ping/Pong messages (unlike, say, Ethereum network protocol). However, we have other pairs of messages, GetPeers/Peers and Sync/Sync to be exchanged regularly (we are not sending such requests to all the peers at the same time though), so let's use them to update lastSeen field (i.e. lets update the field on receiving one of these messages). |
@kushti @ceilican I think in this case this field shouldn't be called |
Fix for #141: updates for last seen & dropping inactive connections
New issue: #378 |
Currently api route
/peers/connected
returns list of objects withlastSeen
field. This field is being filled withnow()
timestamp instead of correct last seen date. However classHandshake
has its owntime
field. Maybe we should consider use this field instead ofnow()
?The text was updated successfully, but these errors were encountered: