diff --git a/exec/load/consensus_vote.js b/exec/load/consensus_vote.js index 3cd22fc1e5c025e543522a3a559f902da4b5af8b..7821f416f0b96a0c6bf0b065dd8706239286eb7f 100644 --- a/exec/load/consensus_vote.js +++ b/exec/load/consensus_vote.js @@ -72,17 +72,20 @@ function ConcensusObject(host, port, scope) newissue.answers=this.answers; this.db.write(this.scope, 'issues.'+this.index, newissue, LOCK_WRITE); } - issue.havevoted=function() + issue.myvote=function() { var i,j; for(i in this.answers) { for(j in this.answers[i].votes) { if(this.answers[i].votes[j]==user.alias) - return true; + return this.answers[i].value; } } - return false; + } + issue.havevoted=function() + { + return this.myvote()!=undefined; } }