Skip to content

Commit

Permalink
Fix max available stake for voting showing negative
Browse files Browse the repository at this point in the history
When attempting to vote on proposals with insufficient BSQ,
the max available stake for voting was showing a negative value.
  • Loading branch information
devinbileck committed Apr 3, 2019
1 parent 8d22d7b commit fb9774c
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -271,6 +271,8 @@ public void onUpdateBalances(Coin availableConfirmedBalance,
Coin blindVoteFee = BlindVoteConsensus.getFee(daoStateService, daoStateService.getChainHeight());
if (isBlindVotePhaseButNotLastBlock()) {
Coin availableForVoting = availableConfirmedBalance.subtract(blindVoteFee);
if (availableForVoting.isNegative())
availableForVoting = Coin.valueOf(0);
stakeInputTextField.setPromptText(Res.get("dao.proposal.myVote.stake.prompt",
bsqFormatter.formatCoinWithCode(availableForVoting)));
} else
Expand Down

0 comments on commit fb9774c

Please sign in to comment.