aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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];
}