aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-10 06:44:36 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-10 06:44:45 +0800
commitc60d7e2db857331f66140c9d9a49f4161a8bf8a4 (patch)
tree323eb695a39ff912a1993b722fc9411076ba92c6
parent50d3a1482567d0e4f572877b50547ae4fbad9942 (diff)
downloaddexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar.gz
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar.bz2
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar.lz
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar.xz
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.tar.zst
dexon-sol-tools-c60d7e2db857331f66140c9d9a49f4161a8bf8a4.zip
Fix getting events from non-mempool
-rw-r--r--src/order_watcher/event_watcher.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_watcher/event_watcher.ts b/src/order_watcher/event_watcher.ts
index 471dcd21a..f1a2b5729 100644
--- a/src/order_watcher/event_watcher.ts
+++ b/src/order_watcher/event_watcher.ts
@@ -53,8 +53,9 @@ export class EventWatcher {
fromBlock = BlockParamLiteral.Pending;
toBlock = BlockParamLiteral.Pending;
} else {
- toBlock = await this._web3Wrapper.getBlockNumberAsync();
- fromBlock = toBlock - numConfirmations;
+ const currentBlock = await this._web3Wrapper.getBlockNumberAsync();
+ toBlock = currentBlock - numConfirmations;
+ fromBlock = currentBlock - numConfirmations;
}
const eventFilter = {
fromBlock,