aboutsummaryrefslogtreecommitdiffstats
path: root/src/mempool/mempool_watcher.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 19:03:54 +0800
committerFabio Berger <me@fabioberger.com>2017-10-31 00:49:16 +0800
commit1bb9c912cd3f33bf677a5e64904faba4014d7b87 (patch)
tree436735a6fc0124228ca530afa0e5c5785ac6131e /src/mempool/mempool_watcher.ts
parent02d470892f68abb5f92a9b79b4a581979288f2f3 (diff)
downloaddexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar.gz
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar.bz2
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar.lz
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar.xz
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.tar.zst
dexon-sol-tools-1bb9c912cd3f33bf677a5e64904faba4014d7b87.zip
Don't emit new events if already unsubscribed
Diffstat (limited to 'src/mempool/mempool_watcher.ts')
-rw-r--r--src/mempool/mempool_watcher.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mempool/mempool_watcher.ts b/src/mempool/mempool_watcher.ts
index 7a485172d..8314afb0c 100644
--- a/src/mempool/mempool_watcher.ts
+++ b/src/mempool/mempool_watcher.ts
@@ -58,7 +58,9 @@ export class MempoolWatcher {
removed: isRemoved,
...log,
};
- (this._callback as MempoolEventCallback)(logWithDecodedArgsEvent);
+ if (!_.isUndefined(this._callback)) {
+ this._callback(logWithDecodedArgsEvent);
+ }
});
}
}