Skip to content

Commit aee8feb

Browse files
committed
fix bug
1 parent 8473d88 commit aee8feb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/FinalityRelayerManager.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ contract FinalityRelayerManager is OwnableUpgradeable, FinalityRelayerManagerSto
134134

135135
// ==============================internal function====================================
136136
function reducibleChallengePeriod(uint256 votedManta, uint256 votedBitcoin) internal view returns(uint256) {
137-
uint256 reduciblePeriod = TOTAL_CHALLENGE_PERIOD - ((votedManta * MANTA_REDUCE_PERIOD) / TARGET_MANTA + (votedBitcoin * BITCOIN_REDUCE_PERIOD) / TARGET_BITCOIN);
138-
if (reduciblePeriod < MIN_CHALLENGE_PERIOD) {
137+
uint256 totalReduction = (votedManta * MANTA_REDUCE_PERIOD) / TARGET_MANTA + (votedBitcoin * BITCOIN_REDUCE_PERIOD) / TARGET_BITCOIN;
138+
if (totalReduction > TOTAL_CHALLENGE_PERIOD - MIN_CHALLENGE_PERIOD) {
139139
return MIN_CHALLENGE_PERIOD;
140140
}
141-
return reduciblePeriod;
141+
return TOTAL_CHALLENGE_PERIOD - totalReduction;
142142
}
143143
}

0 commit comments

Comments
 (0)