Skip to content

Instantly share code, notes, and snippets.

@fix
Created May 9, 2016 13:43
Show Gist options
  • Save fix/c234f403ede5b1cb75590ec166b0244e to your computer and use it in GitHub Desktop.
Save fix/c234f403ede5b1cb75590ec166b0244e to your computer and use it in GitHub Desktop.
private.getKeysSortByVote = function (cb) {
modules.accounts.getAccounts({
isDelegate: 1,
sort: { "vote": -1, "publicKey": 1 },
limit: slots.delegates
}, ["publicKey"], function (err, rows) {
if (err) {
cb(err)
}
cb(null, rows.map(function (el) {
return el.publicKey
}))
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment