diff --git a/contracts/src/TroveManager.sol b/contracts/src/TroveManager.sol index 8e968eaf2..bb04bed76 100644 --- a/contracts/src/TroveManager.sol +++ b/contracts/src/TroveManager.sol @@ -304,16 +304,18 @@ contract TroveManager is LiquityBase, ITroveManager, ITroveEvents { _collChangeFromOperation: -int256(trove.entireColl) }); - emit BatchUpdated({ - _interestBatchManager: batchAddress, - _operation: BatchOperation.exitBatch, - _debt: batches[batchAddress].debt, - _coll: batches[batchAddress].coll, - _annualInterestRate: batch.annualInterestRate, - _annualManagementFee: batch.annualManagementFee, - _totalDebtShares: batches[batchAddress].totalDebtShares, - _debtIncreaseFromUpfrontFee: 0 - }); + if (isTroveInBatch) { + emit BatchUpdated({ + _interestBatchManager: batchAddress, + _operation: BatchOperation.exitBatch, + _debt: batches[batchAddress].debt, + _coll: batches[batchAddress].coll, + _annualInterestRate: batch.annualInterestRate, + _annualManagementFee: batch.annualManagementFee, + _totalDebtShares: batches[batchAddress].totalDebtShares, + _debtIncreaseFromUpfrontFee: 0 + }); + } } // Return the amount of Coll to be drawn from a trove's collateral and sent as gas compensation.