Skip to content

Commit

Permalink
[ETCM-468] merge develop
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Paradziński <piotr.paradzinski@iohk.io>
  • Loading branch information
Piotr Paradziński committed Jan 19, 2021
1 parent 459ed70 commit 4aa4c62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Empty file added repo.nix
Empty file.
11 changes: 11 additions & 0 deletions src/main/scala/io/iohk/ethereum/network/PeerStatisticsActor.scala
Expand Up @@ -53,6 +53,17 @@ class PeerStatisticsActor(
)
maybeStats = maybeStats.map(_.add(peerId, obs))
}

private def handleMessageFromPeer(msg: Message, peerId: PeerId): Unit = {
val now = clock.millis
val obs = PeerStat(
responsesReceived = if (ResponseCodes(msg.code)) 1 else 0,
requestsReceived = if (RequestCodes(msg.code)) 1 else 0,
firstSeenTimeMillis = Some(now),
lastSeenTimeMillis = Some(now)
)
maybeStats = maybeStats.map(_.add(peerId, obs))
}
}

object PeerStatisticsActor {
Expand Down

0 comments on commit 4aa4c62

Please sign in to comment.