Skip to content

Commit

Permalink
fix edge case where there are zero votes to clean up and zero past votes
Browse files Browse the repository at this point in the history
this was causing an endless stream of bad operations on polkadot
  • Loading branch information
nicolasochem committed Jul 6, 2022
1 parent 907c951 commit 3edb5be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polkadot-votebot-cron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function main() {
}
}

if (referenda.length == 0) {
if (referenda.length == 0 && valVotes.length > 0) {
console.log("All up-to-date with voting. Checking for expired referenda to remove...");
// Lazily removing one old vote (starting with oldest), so democracy bond can be unlocked easily if needed.
let e = valVotes[0];
Expand Down

0 comments on commit 3edb5be

Please sign in to comment.