Added check if the reserve was already added

This commit is contained in:
The3D 2020-10-06 18:20:44 +02:00
parent 24a4980496
commit 9fdfc8bf26

View File

@ -951,10 +951,14 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
require(_reservesCount < MAX_NUMBER_RESERVES, Errors.NO_MORE_RESERVES_ALLOWED);
bool reserveAlreadyAdded = _reserves[asset].id != 0 || _reservesList[0]==asset;
if(!reserveAlreadyAdded){
_reserves[asset].id = uint8(_reservesCount);
_reservesList[_reservesCount] = asset;
_reservesCount++;
}
}
/**