aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-18 08:31:34 +0800
committerGitHub <noreply@github.com>2018-04-18 08:31:34 +0800
commita63dfb7995e90c330112557396a8523561fa231a (patch)
treeedf8fadefd1e08c604580db4747a7c3fa4cc1967 /packages
parentbf4873e519762c6e13bb68c7a6757cc1ec25eb77 (diff)
parent3ffcb03d8791acefa25bb886384e79cfaabe88d6 (diff)
downloaddexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar
dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.gz
dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.bz2
dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.lz
dexon-sol-tools-a63dfb7995e90c330112557396a8523561fa231a.tar.xz
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
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/CHANGELOG.json4
-rw-r--r--packages/0x.js/src/order_watcher/expiration_watcher.ts3
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];
}