diff options
author | kumavis <aaron@kumavis.me> | 2018-05-24 13:46:20 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-05-24 13:46:20 +0800 |
commit | ee800de025397af7958d8e8e382b31b1d09c338c (patch) | |
tree | 4ad2a1a03966f32d4d2d2797b25e433afafa49ee /app/scripts/controllers | |
parent | dc96b1eb935e59b12bcdc00fc68058684a376bd8 (diff) | |
download | dexon-wallet-ee800de025397af7958d8e8e382b31b1d09c338c.tar.gz dexon-wallet-ee800de025397af7958d8e8e382b31b1d09c338c.tar.zst dexon-wallet-ee800de025397af7958d8e8e382b31b1d09c338c.zip |
controllers - recent-blocks - wrap block-tracker event in try-catch
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/recent-blocks.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/scripts/controllers/recent-blocks.js b/app/scripts/controllers/recent-blocks.js index 21563866..e256c62e 100644 --- a/app/scripts/controllers/recent-blocks.js +++ b/app/scripts/controllers/recent-blocks.js @@ -34,7 +34,13 @@ class RecentBlocksController { }, opts.initState) this.store = new ObservableStore(initState) - this.blockTracker.on('latest', this.processBlock.bind(this)) + this.blockTracker.on('latest', async (newBlockNumberHex) => { + try { + await this.processBlock(newBlockNumberHex) + } catch (err) { + log.error(err) + } + }) this.backfill() } |