Skip to content

Commit 51bd816

Browse files
fix(contracts): active subscriptions counter in aggregation-mode payment service (#2240)
1 parent db385ed commit 51bd816

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/src/core/AggregationModePaymentService.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
225225
if (subscribedAddresses[msg.sender] < block.timestamp) {
226226
// Subscription is inactive/expired: start a new period from now.
227227
subscribedAddresses[msg.sender] = block.timestamp + paymentExpirationTimeSeconds;
228+
++activeSubscriptionsAmount;
228229
} else {
229230
// Subscription is still active: extend the current expiry by one period.
230231
subscribedAddresses[msg.sender] = subscribedAddresses[msg.sender] + paymentExpirationTimeSeconds;
@@ -236,7 +237,6 @@ contract AggregationModePaymentService is Initializable, UUPSUpgradeable, Access
236237
revert SubscriptionTimeExceedsLimit(newExpiration, maxSubscriptionTimeAhead);
237238
}
238239

239-
++activeSubscriptionsAmount;
240240

241241
emit UserPayment(msg.sender, amount, block.timestamp, block.timestamp + paymentExpirationTimeSeconds);
242242
}

0 commit comments

Comments
 (0)