mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
controllers - recent-blocks - wrap block-tracker event in try-catch
This commit is contained in:
parent
dc96b1eb93
commit
ee800de025
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user