Fix order of calculation of the interest rates

This commit is contained in:
The3D 2020-09-24 10:00:17 +02:00
parent ee0bc07238
commit 6ee4b2725b

View File

@ -374,6 +374,14 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
//updating collateral reserve indexes
collateralReserve.updateState();
//updating collateral reserve interest rates
collateralReserve.updateInterestRates(
collateral,
address(vars.collateralAtoken),
0,
vars.maxCollateralToLiquidate
);
vars.collateralAtoken.burn(
user,
receiver,
@ -424,14 +432,6 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
);
}
//updating collateral reserve
collateralReserve.updateInterestRates(
collateral,
address(vars.collateralAtoken),
0,
vars.maxCollateralToLiquidate
);
emit RepaidWithCollateral(
collateral,
principal,