mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added check if the reserve was already added
This commit is contained in:
parent
24a4980496
commit
9fdfc8bf26
|
@ -951,11 +951,15 @@ 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++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev returns the normalized income per unit of asset
|
||||
|
|
Loading…
Reference in New Issue
Block a user