Skip to content

Commit

Permalink
Fix an issue with invalid masternode count
Browse files Browse the repository at this point in the history
-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
  • Loading branch information
joeuhren committed Feb 3, 2024
1 parent 4e032c0 commit 860209a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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+)/;
Expand Down

0 comments on commit 860209a

Please sign in to comment.