display only peers ready for requets on ethstats (#5880)

* 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>
pull/5886/head
matkt 1 year ago committed by GitHub
parent dfcd960d8b
commit 3bb95be26f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/ethstats/src/main/java/org/hyperledger/besu/ethstats/EthStatsService.java

@ -424,7 +424,9 @@ public class EthStatsService {
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()

Loading…
Cancel
Save