Fix an issue with invalid masternode count

-This fix prevents an error from being thrown that crashes the explorer when trying to use a masternode count that is a sinlge number. A single number masternode count is not valid or usable since it cannot differentiate the number of good and bad nodes, but the explorer will no longer crash when given this data
This commit is contained in:
Joe Uhren
2024-02-03 08:56:40 -07:00
parent 4e032c0e49
commit 860209a5f9
+1 -1
View File
@@ -154,7 +154,7 @@ function normalizeMasternodeCount(raw_count) {
total: splitCount[1].trim()
};
// check if the data is in the format of "Total: {total_count} Enabled: {enabled_count}"
} else if (raw_count.indexOf('Total: ') > -1 && raw_count.indexOf('Enabled: ')) {
} else if (raw_count.toString().indexOf('Total: ') > -1 && raw_count.toString().indexOf('Enabled: ')) {
// Total: {total_count} Enabled: {enabled_count}" format detected
const totalRegex = /Total: (\d+)/;
const enabledRegex = /Enabled: (\d+)/;