Skip to content

Commit

Permalink
Add wrong vote version messages to votes that will not be tabulated (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlyp authored May 11, 2017
1 parent d193a95 commit f151618
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Rpc._parseTxResult = function(info) {
agendasLE += voteBits.substring(i, i + 2);
}
info.agendas = new Array();
var wrongVoteVersion = 'Wrong vote version';

if (config.network == 'dcrdlivenet') {
// Agendas for mainnet vote version 4
if (parseInt(hexLE, 16) == 4) {
Expand All @@ -68,6 +70,8 @@ Rpc._parseTxResult = function(info) {
if (sdiff != '') {
info.agendas.push(sdiff);
}
} else {
info.agendas.push(wrongVoteVersion);
}
} else if (config.network == 'dcrdtestnet') {
// Agendas for mainnet vote version 5
Expand All @@ -78,6 +82,8 @@ Rpc._parseTxResult = function(info) {
if (choice != '') {
info.agendas.push(choice);
}
} else {
info.agendas.push(wrongVoteVersion);
}
}
info.voterVersion = parseInt(hexLE, 16);
Expand Down

0 comments on commit f151618

Please sign in to comment.