Delete "if" condition due always will be true. Delete unreachable "else" code at repayWithCollateral.

This commit is contained in:
David Racero 2020-09-10 13:30:57 +00:00
parent 831bc3d0eb
commit 167f02533f

View File

@ -361,14 +361,7 @@ contract LendingPoolLiquidationManager is VersionedInitializable {
);
}
if (msg.sender == user || vars.healthFactor < GenericLogic.HEALTH_FACTOR_CRITICAL_THRESHOLD) {
vars.maxPrincipalAmountToLiquidate = vars.userStableDebt.add(vars.userVariableDebt);
} else {
vars.maxPrincipalAmountToLiquidate = vars
.userStableDebt
.add(vars.userVariableDebt)
.percentMul(LIQUIDATION_CLOSE_FACTOR_PERCENT);
}
vars.maxPrincipalAmountToLiquidate = vars.userStableDebt.add(vars.userVariableDebt);
vars.actualAmountToLiquidate = principalAmount > vars.maxPrincipalAmountToLiquidate
? vars.maxPrincipalAmountToLiquidate