diff options
author | Ara Kevonian <ara@dextroid.io> | 2018-04-17 22:25:13 +0800 |
---|---|---|
committer | Ara Kevonian <ara@dextroid.io> | 2018-04-17 22:25:13 +0800 |
commit | cbca2061f7f0e2632d5c74be62328d9e49dd822e (patch) | |
tree | 04c4b10a36ef42c6d1200f67de487a6ae7df9d85 /packages/0x.js/src | |
parent | bf4873e519762c6e13bb68c7a6757cc1ec25eb77 (diff) | |
download | dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar.gz dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar.bz2 dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar.lz dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar.xz dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.tar.zst dexon-sol-tools-cbca2061f7f0e2632d5c74be62328d9e49dd822e.zip |
Fix redundant expired order removal bug
Diffstat (limited to 'packages/0x.js/src')
-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); } |