diff --git a/contracts/Token.sol b/contracts/Token.sol index 5e7097a..868ebd7 100644 --- a/contracts/Token.sol +++ b/contracts/Token.sol @@ -350,16 +350,16 @@ contract Token { } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { - uint32 blockNumber = safe32(block.number, "Tkn::_writeCheckpoint: block number exceeds 32 bits"); + uint32 blockNumber = safe32(block.number, "Tkn::_writeCheckpoint: block number exceeds 32 bits"); - if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { - checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; - } else { - checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); - numCheckpoints[delegatee] = nCheckpoints + 1; - } + if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { + checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; + } else { + checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); + numCheckpoints[delegatee] = nCheckpoints + 1; + } - emit DelegateVotesChanged(delegatee, oldVotes, newVotes); + emit DelegateVotesChanged(delegatee, oldVotes, newVotes); }