diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-18 08:31:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 08:31:34 +0800 |
commit | a63dfb7995e90c330112557396a8523561fa231a (patch) | |
tree | edf8fadefd1e08c604580db4747a7c3fa4cc1967 | |
parent | bf4873e519762c6e13bb68c7a6757cc1ec25eb77 (diff) | |
parent | 3ffcb03d8791acefa25bb886384e79cfaabe88d6 (diff) | |
download | dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.gz dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.zst dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.zip |
Merge pull request #527 from avonian/redundant_order_removal_bug
Fix redundant expired order removal bug
-rw-r--r-- | packages/0x.js/CHANGELOG.json | 4 | ||||
-rw-r--r-- | packages/0x.js/src/order_watcher/expiration_watcher.ts | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 65228b183..295741b66 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -4,6 +4,10 @@ "changes": [ { "note": "Internal changes and refactoring" + }, + { + "note": "Fix redundant expired order removal bug", + "pr": 527 } ] }, diff --git a/packages/0x.js/src/order_watcher/expiration_watcher.ts b/packages/0x.js/src/order_watcher/expiration_watcher.ts index 00b62162d..8b306bf3b 100644 --- a/packages/0x.js/src/order_watcher/expiration_watcher.ts +++ b/packages/0x.js/src/order_watcher/expiration_watcher.ts @@ -48,6 +48,9 @@ export class ExpirationWatcher { this._orderHashByExpirationRBTree.insert(orderHash); } public removeOrder(orderHash: string): void { + if (_.isUndefined(this._expiration[orderHash])) { + return; // noop since order already removed + } this._orderHashByExpirationRBTree.remove(orderHash); delete this._expiration[orderHash]; } |