aave / protocol-v2

Aave Protocol V2
https://aave.com
Other
668 stars 754 forks source link

In library ReserveLogic, function _updateIndexes #237

Open guotie opened 3 years ago

guotie commented 3 years ago

because of in the same block, the time differece is 0, so, can _updateIndexes optimal to following?

  function _updateIndexes(
    DataTypes.ReserveData storage reserve,
    uint256 scaledVariableDebt,
    uint256 liquidityIndex,
    uint256 variableBorrowIndex,
    uint40 timestamp
  ) internal returns (uint256, uint256) {
    if (timestamp  >= block.timestamp) {
        return (reserve.liquidityIndex, reserve.variableBorrowIndex);
    }

    ....
  }