RocketRewardsPool - registerClaimer should check if a node is already disabled before decrementing rewards.pool.claim.interval.claimers.total.next
The other branch in `registerClaimer` does not check whether the provided `_claimerAddress` is already disabled (or invalid). This might lead to inconsistencies where `rewards.pool.claim.interval.claimers.total.next` is decremented because the caller provided an already deactivated address.\\nThis issue is flagged as `minor` since we have not found an exploitable version of this issue in the current codebase. However, we recommend safeguarding the implementation instead of relying on the caller to provide sane parameters. Registered Nodes cannot unregister, and Trusted Nodes are unregistered when they leave.\\n```\\nfunction registerClaimer(address \\_claimerAddress, bool \\_enabled) override external onlyClaimContract {\\n    // The name of the claiming contract\\n    string memory contractName = getContractName(msg.sender);\\n    // Record the block they are registering at\\n    uint256 registeredBlock = 0;\\n    // How many users are to be included in next interval\\n    uint256 claimersIntervalTotalUpdate = getClaimingContractUserTotalNext(contractName);\\n    // Ok register\\n    if(\\_enabled) {\\n        // Make sure they are not already registered\\n        require(getClaimingContractUserRegisteredBlock(contractName, \\_claimerAddress) == 0, "Claimer is already registered");\\n        // Update block number\\n        registeredBlock = block.number;\\n        // Update the total registered claimers for next interval\\n        setUint(keccak256(abi.encodePacked("rewards.pool.claim.interval.claimers.total.next", contractName)), claimersIntervalTotalUpdate.add(1));\\n    }else{\\n        setUint(keccak256(abi.encodePacked("rewards.pool.claim.interval.claimers.total.next", contractName)), claimersIntervalTotalUpdate.sub(1));\\n    }\\n    // Save the registered block\\n    setUint(keccak256(abi.encodePacked("rewards.pool.claim.contract.registered.block", contractName, \\_claimerAddress)), registeredBlock);\\n}\\n```\\n
Ensure that `getClaimingContractUserRegisteredBlock(contractName, _claimerAddress)` returns `!=0` before decrementing the `.total.next`.
```\\nfunction registerClaimer(address \\_claimerAddress, bool \\_enabled) override external onlyClaimContract {\\n    // The name of the claiming contract\\n    string memory contractName = getContractName(msg.sender);\\n    // Record the block they are registering at\\n    uint256 registeredBlock = 0;\\n    // How many users are to be included in next interval\\n    uint256 claimersIntervalTotalUpdate = getClaimingContractUserTotalNext(contractName);\\n    // Ok register\\n    if(\\_enabled) {\\n        // Make sure they are not already registered\\n        require(getClaimingContractUserRegisteredBlock(contractName, \\_claimerAddress) == 0, "Claimer is already registered");\\n        // Update block number\\n        registeredBlock = block.number;\\n        // Update the total registered claimers for next interval\\n        setUint(keccak256(abi.encodePacked("rewards.pool.claim.interval.claimers.total.next", contractName)), claimersIntervalTotalUpdate.add(1));\\n    }else{\\n        setUint(keccak256(abi.encodePacked("rewards.pool.claim.interval.claimers.total.next", contractName)), claimersIntervalTotalUpdate.sub(1));\\n    }\\n    // Save the registered block\\n    setUint(keccak256(abi.encodePacked("rewards.pool.claim.contract.registered.block", contractName, \\_claimerAddress)), registeredBlock);\\n}\\n```\\n