From 648eb7c66666c9cdd7a46a446c44c41d44c2e59b Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 30 Jul 2015 14:35:59 -0700 Subject: [PATCH] add last seen date to the peer --- src/swarm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/swarm.js b/src/swarm.js index 78ab773d..3f89f9f0 100644 --- a/src/swarm.js +++ b/src/swarm.js @@ -19,7 +19,7 @@ function Swarm () { } self.port = parseInt(process.env.IPFS_SWARM_PORT, 10) || 4001 - self.connections = {} // {conn: <>, socket: <>} + self.connections = {} // {peerIdB58: {conn: <>, socket: <>} self.handles = [] // set the listener @@ -128,6 +128,7 @@ function Swarm () { msi.handle(stream, function () { msi.select(protocol, function (err, ds) { if (err) { return cb(err) } + peer.lastSeen = new Date() cb(null, ds) // return the stream }) })