diff options
Diffstat (limited to 'packages/order-watcher/src/order_watcher/expiration_watcher.ts')
-rw-r--r-- | packages/order-watcher/src/order_watcher/expiration_watcher.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts index 31fda7dca..c4c94a015 100644 --- a/packages/order-watcher/src/order_watcher/expiration_watcher.ts +++ b/packages/order-watcher/src/order_watcher/expiration_watcher.ts @@ -13,10 +13,10 @@ const DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS = 50; * It stores them in a min heap by expiration time and checks for expired ones every `orderExpirationCheckingIntervalMs` */ export class ExpirationWatcher { - private _orderHashByExpirationRBTree: RBTree<string>; - private _expiration: { [orderHash: string]: BigNumber } = {}; - private _orderExpirationCheckingIntervalMs: number; - private _expirationMarginMs: number; + private readonly _orderHashByExpirationRBTree: RBTree<string>; + private readonly _expiration: { [orderHash: string]: BigNumber } = {}; + private readonly _orderExpirationCheckingIntervalMs: number; + private readonly _expirationMarginMs: number; private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer; constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) { this._orderExpirationCheckingIntervalMs = @@ -68,8 +68,8 @@ export class ExpirationWatcher { private _pruneExpiredOrders(callback: (orderHash: string) => void): void { const currentUnixTimestampMs = utils.getCurrentUnixTimestampMs(); while (true) { - const hasTrakedOrders = this._orderHashByExpirationRBTree.size === 0; - if (hasTrakedOrders) { + const hasNoTrackedOrders = this._orderHashByExpirationRBTree.size === 0; + if (hasNoTrackedOrders) { break; } const nextOrderHashToExpire = this._orderHashByExpirationRBTree.min(); |