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