aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 19:03:54 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-10 03:11:45 +0800
commit23d7d7d1400706488d50af2c648cbe9a73530562 (patch)
tree7285be0798336bc6503d5f7d25c8bf547ebc2285
parentf8179bc5a96456c4e5a7979b955caa76e675c4f7 (diff)
downloaddexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar.gz
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar.bz2
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar.lz
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar.xz
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.tar.zst
dexon-sol-tools-23d7d7d1400706488d50af2c648cbe9a73530562.zip
Don't emit new events if already unsubscribed
-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);
+ }
});
}
}