diff options
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts index a9df8ac9d..94b463921 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -123,7 +123,7 @@ export class OrderStateWatcher { * Removes an order from the orderStateWatcher * @param orderHash The orderHash of the order you wish to stop watching. */ - public removeOrder(orderHash: string): void { + public removeOrder(orderHash: string, removeFromExpirationWatcher: boolean = true): void { assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema); const signedOrder = this._orderByOrderHash[orderHash]; if (_.isUndefined(signedOrder)) { @@ -139,7 +139,9 @@ export class OrderStateWatcher { this._removeFromDependentOrderHashes(signedOrder.maker, signedOrder.makerTokenAddress, orderHash); } - this._expirationWatcher.removeOrder(orderHash); + if (removeFromExpirationWatcher) { + this._expirationWatcher.removeOrder(orderHash); + } } /** * Starts an orderStateWatcher subscription. The callback will be called every time a watched order's @@ -212,7 +214,7 @@ export class OrderStateWatcher { error: ExchangeContractErrs.OrderFillExpired, }; if (!_.isUndefined(this._orderByOrderHash[orderHash])) { - this.removeOrder(orderHash); + this.removeOrder(orderHash, false); if (!_.isUndefined(this._callbackIfExists)) { this._callbackIfExists(null, orderState); } |