Skip to content

Commit

Permalink
Merge pull request #303 from Midas-Protocol/fix/borrow-balance-curren…
Browse files Browse the repository at this point in the history
…t-reentrant

removing some unnecessary and breaking code
  • Loading branch information
vminkov authored Jul 5, 2022
2 parents 74e5962 + ad943bf commit 25b4218
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions contracts/compound/CToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ contract CToken is CTokenInterface, Exponential, TokenErrorReporter {
* @notice Returns the current total borrows plus accrued interest
* @return The total borrows with interest
*/
function totalBorrowsCurrent() external override nonReentrant(false) returns (uint256) {
function totalBorrowsCurrent() external override returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return totalBorrows;
}
Expand Down Expand Up @@ -1636,13 +1636,6 @@ contract CToken is CTokenInterface, Exponential, TokenErrorReporter {
// Emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel)
emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel);

// Attempt to reset interest checkpoints on old IRM
if (address(oldInterestRateModel) != address(0))
address(oldInterestRateModel).call(abi.encodeWithSignature("resetInterestCheckpoints()"));

// Attempt to add first interest checkpoint on new IRM
address(newInterestRateModel).call(abi.encodeWithSignature("checkpointInterest()"));

return uint256(Error.NO_ERROR);
}

Expand Down

0 comments on commit 25b4218

Please sign in to comment.