Commit 40c997f1 authored by Maurelian's avatar Maurelian

refactor(ctb): Reduce branching on pre-removal check

parent 377dcdaf
...@@ -88,14 +88,12 @@ contract LivenessModule is ISemver { ...@@ -88,14 +88,12 @@ contract LivenessModule is ISemver {
) )
internal internal
{ {
if (_newOwnersCount > 0) {
if (_isAboveMinOwners(_newOwnersCount)) {
// Check that the owner to remove has not signed a transaction in the last 30 days
require( require(
LIVENESS_GUARD.lastLive(_ownerToRemove) < block.timestamp - LIVENESS_INTERVAL, !_isAboveMinOwners(_newOwnersCount)
|| LIVENESS_GUARD.lastLive(_ownerToRemove) < block.timestamp - LIVENESS_INTERVAL,
"LivenessModule: owner has signed recently" "LivenessModule: owner has signed recently"
); );
} if (_newOwnersCount > 0) {
// Remove the owner and update the threshold // Remove the owner and update the threshold
_removeOwnerSafeCall({ _prevOwner: _prevOwner, _owner: _ownerToRemove, _threshold: _newThreshold }); _removeOwnerSafeCall({ _prevOwner: _prevOwner, _owner: _ownerToRemove, _threshold: _newThreshold });
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment