From f3920c37012ab993032858ad8fb84169ab67eb21 Mon Sep 17 00:00:00 2001 From: Tyler Sorensen Date: Sun, 10 May 2020 20:41:57 -0700 Subject: [PATCH] fix bug in max rounds reached case --- packages/dai-plugin-governance/src/GovPollingService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/dai-plugin-governance/src/GovPollingService.js b/packages/dai-plugin-governance/src/GovPollingService.js index 6449ce7fe..e02a52021 100644 --- a/packages/dai-plugin-governance/src/GovPollingService.js +++ b/packages/dai-plugin-governance/src/GovPollingService.js @@ -214,9 +214,10 @@ export default class GovPollingService extends PrivateService { let maxOption; Object.entries(tally.options).forEach( ([option, { firstChoice, transfer }]) => { - if (firstChoice.plus(transfer).gt(max)) + if (firstChoice.plus(transfer).gt(max)) { max = firstChoice.plus(transfer); - maxOption = option; + maxOption = option; + } } ); tally.winner = maxOption;