We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pos-blockchain/blockchain/stake.js
Line 47 in 2e7ee09
I think this:
getMax(addresses) { let balance = -1; let leader = undefined; addresses.forEach(address => { if (this.getBalance(address) > balance) { leader = address; } }); return leader; }
Should actually be:
getMax(addresses) { let balance = -1; let leader = undefined; addresses.forEach(address => { let address_balance = this.getBalance(address); if (address_balance > balance) { leader = address; balance = address_balance; } }); return leader; }
Otherwise getMax will just return the last address that has a balance greater than -1.
The text was updated successfully, but these errors were encountered:
Create a PR and ill merge it.
Sorry, something went wrong.
No branches or pull requests
pos-blockchain/blockchain/stake.js
Line 47 in 2e7ee09
I think this:
Should actually be:
Otherwise getMax will just return the last address that has a balance greater than -1.
The text was updated successfully, but these errors were encountered: