diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-26 19:03:54 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-10-31 00:49:16 +0800 |
commit | 1bb9c912cd3f33bf677a5e64904faba4014d7b87 (patch) | |
tree | 436735a6fc0124228ca530afa0e5c5785ac6131e /src/mempool | |
parent | 02d470892f68abb5f92a9b79b4a581979288f2f3 (diff) | |
download | dexon-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')
-rw-r--r-- | src/mempool/mempool_watcher.ts | 4 |
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); + } }); } } |