Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Jan 3, 2024
1 parent fca3c57 commit 7f022fd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions contracts/BC_fusion/StakeHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1016,13 +1016,12 @@ contract StakeHub is System, Initializable {
function _jailValidator(Validator storage valInfo, uint256 jailUntil) internal {
// keep the last eligible validator
bool isLast = (numOfJailed >= _validatorSet.length() - 1);
// 0x08 is the staking channel id. If this channel is closed, then BC-fusion is finished and we should keep the last eligible validator here
if (
!ICrossChain(CROSS_CHAIN_CONTRACT_ADDR).registeredContractChannelMap(VALIDATOR_CONTRACT_ADDR, 0x08)
&& isLast
) {
emit ValidatorEmptyJailed(valInfo.operatorAddress);
return;
if (isLast) {
// 0x08 is the staking channel id. If this channel is closed, then BC-fusion is finished and we should keep the last eligible validator here
if (!ICrossChain(CROSS_CHAIN_CONTRACT_ADDR).registeredContractChannelMap(VALIDATOR_CONTRACT_ADDR, 0x08)) {
emit ValidatorEmptyJailed(valInfo.operatorAddress);
return;
}
}

if (jailUntil > valInfo.jailUntil) {
Expand Down

0 comments on commit 7f022fd

Please sign in to comment.