Skip to content
Snippets Groups Projects
Commit b776e839 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix NullPointerException when computing buid on peer.stats with an empty peerCountByBuid map

parent 27a96d62
No related branches found
No related tags found
No related merge requests found
Pipeline #4314 passed
......@@ -270,7 +270,7 @@ public class NetworkServiceImpl extends BaseRemoteServiceImpl implements Network
boolean isMainConsensus = buid.equals(mainBuid);
stats.setMainConsensus(isMainConsensus);
boolean isForkConsensus = !isMainConsensus && peerCountByBuid.get(buid) > 1;
boolean isForkConsensus = !isMainConsensus && peerCountByBuid.containsKey(buid) && peerCountByBuid.get(buid) > 1;
stats.setForkConsensus(isForkConsensus);
stats.setConsensusPct(isMainConsensus || isForkConsensus ? buidsPct.get(buid) : 0d);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment