diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-21 03:47:09 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-21 03:47:09 +0800 |
commit | 71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b (patch) | |
tree | af69b9b067a83d580e6e6d73f9ff42aed37f3354 /packages/0x.js/src/order_watcher/order_state_watcher.ts | |
parent | a613c3b7e7654728cb56cceb67566ab75313e16f (diff) | |
download | dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar.gz dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar.bz2 dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar.lz dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar.xz dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.tar.zst dexon-sol-tools-71475d3ceafd8f1a4a76d1e5b49ff0d186bacd9b.zip |
Add expirationMarginMs
Diffstat (limited to 'packages/0x.js/src/order_watcher/order_state_watcher.ts')
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 10 |
1 files changed, 8 insertions, 2 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 27f4c7d29..3659fc6e2 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -77,7 +77,12 @@ export class OrderStateWatcher { const orderExpirationCheckingIntervalMsIfExists = _.isUndefined(config) ? undefined : config.orderExpirationCheckingIntervalMs; - this._expirationWatcher = new ExpirationWatcher(orderExpirationCheckingIntervalMsIfExists); + const expirationMarginIfExistsMs = _.isUndefined(config) ? + undefined : + config.expirationMarginMs; + this._expirationWatcher = new ExpirationWatcher( + expirationMarginIfExistsMs, orderExpirationCheckingIntervalMsIfExists, + ); } /** * Add an order to the orderStateWatcher. Before the order is added, it's @@ -91,7 +96,8 @@ export class OrderStateWatcher { this._orderByOrderHash[orderHash] = signedOrder; this.addToDependentOrderHashes(signedOrder, orderHash); // We don't remove orders from expirationWatcher because heap removal is linear. We just skip it later - this._expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec); + const expirationUnixTimestampMs = signedOrder.expirationUnixTimestampSec.times(1000); + this._expirationWatcher.addOrder(orderHash, expirationUnixTimestampMs); } /** * Removes an order from the orderStateWatcher |