Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
if removed
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Nov 2, 2020
1 parent 63b6a57 commit 9807db2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/scala/scorex/core/network/NetworkController.scala
Expand Up @@ -239,13 +239,11 @@ class NetworkController(settings: NetworkSettings,
val now = networkTime()
connections.values.foreach { cp =>
val lastSeen = cp.lastMessage
if (lastSeen != 0) {
val timeout = settings.inactiveConnectionDeadline.toMillis
val delta = now - lastSeen
if (delta > timeout) {
log.info(s"Dropping connection with ${cp.peerInfo}, last seen ${delta / 1000.0} seconds ago")
cp.handlerRef ! CloseConnection
}
val timeout = settings.inactiveConnectionDeadline.toMillis
val delta = now - lastSeen
if (delta > timeout) {
log.info(s"Dropping connection with ${cp.peerInfo}, last seen ${delta / 1000.0} seconds ago")
cp.handlerRef ! CloseConnection
}
}
}
Expand Down

0 comments on commit 9807db2

Please sign in to comment.