function revealVote(uint _pollID, uint _voteOption, uint _salt) external {
// Make sure the reveal period is active
require(revealPeriodActive(_pollID));
require(!hasBeenRevealed(msg.sender, _pollID)); // prevent user from revealing multiple times
require(keccak256(_voteOption, _salt) == getCommitHash(msg.sender, _pollID)); // compare resultant hash from inputs to original commitHash
uint numTokens = getNumTokens(msg.sender, _pollID);
if (_voteOption == 1) // apply numTokens to appropriate poll choice
pollMap[_pollID].votesFor += numTokens;
else
pollMap[_pollID].votesAgainst += numTokens;
dllMap[msg.sender].remove(_pollID); // remove the node referring to this vote upon reveal
VoteRevealed(msg.sender, _pollID, numTokens, _voteOption);
}
Prospective fix: Change else to else if (vote == 0), followed by an else { revert }. The user will never be able to reveal, but they will be able to rescue tokens.
https://github.com/ConsenSys/PLCRVoting/blob/master/contracts/PLCRVoting.sol#L174