Skip to content

Commit

Permalink
display only peers ready for requets on ethstats (hyperledger#5880)
Browse files Browse the repository at this point in the history
* display only ready for requets peers in ethstats

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>

* cast to int

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
3 people authored and garyschulte committed Sep 20, 2023
1 parent 32c8e2b commit 5770fd9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ private void sendNodeStatsReport() {
final boolean isSyncing = syncState.isInSync();
final long gasPrice = suggestGasPrice(blockchainQueries.getBlockchain().getChainHeadBlock());
final long hashrate = miningCoordinator.hashesPerSecond().orElse(0L);
final int peersNumber = protocolManager.ethContext().getEthPeers().peerCount();
// safe to cast to int since it isn't realistic to have more than max int peers
final int peersNumber =
(int) protocolManager.ethContext().getEthPeers().streamAvailablePeers().count();

final NodeStatsReport nodeStatsReport =
ImmutableNodeStatsReport.builder()
Expand Down

0 comments on commit 5770fd9

Please sign in to comment.