Skip to content

Commit

Permalink
Remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
kanewallmann committed Sep 13, 2024
1 parent bfd30a3 commit 2ff7827
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/contract/network/RocketNetworkVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ contract RocketNetworkVoting is RocketBase, RocketNetworkVotingInterface {
/// Sets their delegate to themself.
/// @param _nodeAddress The address of the node to initialise
function initialiseVotingFor(address _nodeAddress) onlyRegisteredNode(_nodeAddress) external override {
if (!getBool(keccak256(abi.encodePacked("node.voting.enabled", _nodeAddress)))) {
_initialiseVoting(_nodeAddress, _nodeAddress);
}
_initialiseVoting(_nodeAddress, _nodeAddress);
}

/// @notice Unlocks a node operator's voting power (only required for node operators who registered before
Expand All @@ -56,7 +54,7 @@ contract RocketNetworkVoting is RocketBase, RocketNetworkVotingInterface {
/// @param _delegate The address to delegate the node's voting power to
function _initialiseVoting(address _nodeAddress, address _delegate) private {
// Check if already initialised
require (!getBool(keccak256(abi.encodePacked("node.voting.enabled", _nodeAddress))), "Voting power already initialised");
require(!getBool(keccak256(abi.encodePacked("node.voting.enabled", _nodeAddress))), "Voting power already initialised");
setBool(keccak256(abi.encodePacked("node.voting.enabled", _nodeAddress)), true);

// Get contracts
Expand Down

0 comments on commit 2ff7827

Please sign in to comment.