Skip to content

Commit

Permalink
feat: implement masternode counts in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Aug 29, 2024
1 parent f2fbc7c commit 763e4fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <univalue.h>
#include <messagesigner.h>
#include <uint256.h>
#include <statsd_client.h>

#include <optional>
#include <memory>
Expand Down Expand Up @@ -641,6 +642,15 @@ bool CDeterministicMNManager::ProcessBlock(const CBlock& block, gsl::not_null<co
updatesRet = {newList, oldList, diff};
}

statsClient.gauge("masternodes.count", newList.GetAllMNsCount());
statsClient.gauge("masternodes.weighted_count", newList.GetValidWeightedMNsCount());
statsClient.gauge("masternodes.enabled", newList.GetValidMNsCount());
statsClient.gauge("masternodes.weighted_enabled", newList.GetValidWeightedMNsCount());
statsClient.gauge("masternodes.evo.count", newList.GetAllEvoCount());
statsClient.gauge("masternodes.evo.enabled", newList.GetValidEvoCount());
statsClient.gauge("masternodes.mn.count", newList.GetAllMNsCount() - newList.GetAllEvoCount());
statsClient.gauge("masternodes.mn.enabled", newList.GetValidMNsCount() - newList.GetValidEvoCount());

if (nHeight == consensusParams.DIP0003EnforcementHeight) {
if (!consensusParams.DIP0003EnforcementHash.IsNull() && consensusParams.DIP0003EnforcementHash != pindex->GetBlockHash()) {
LogPrintf("CDeterministicMNManager::%s -- DIP3 enforcement block has wrong hash: hash=%s, expected=%s, nHeight=%d\n", __func__,
Expand Down

0 comments on commit 763e4fc

Please sign in to comment.