Merge pull request #617 from MetaMask/i616-FixListenerLeak

I616 fix listener leak
feature/default_network_editable
Kevin Serrano 8 years ago committed by GitHub
commit 54425f4ee7
  1. 1
      CHANGELOG.md
  2. 1
      app/scripts/background.js
  3. 2
      app/scripts/metamask-controller.js

@ -4,6 +4,7 @@
- On fresh install, open a new tab with the MetaMask Introduction video.
- Block negative values from transactions.
- Fixed a memory leak.
## 2.10.2 2016-09-02

@ -86,6 +86,7 @@ function setupControllerConnection (stream) {
stream.pipe(dnode).pipe(stream)
dnode.on('remote', (remote) => {
// push updates to popup
controller.ethStore.removeListener('update', controller.sendUpdate.bind(controller))
controller.ethStore.on('update', controller.sendUpdate.bind(controller))
controller.listeners.push(remote)
idStore.on('update', controller.sendUpdate.bind(controller))

@ -220,7 +220,7 @@ module.exports = class MetamaskController {
}
enforceTxValidations (txParams) {
if (txParams.value.indexOf('-') === 0) {
if (('value' in txParams) && txParams.value.indexOf('-') === 0) {
const msg = `Invalid transaction value of ${txParams.value} not a positive number.`
return new Error(msg)
}

Loading…
Cancel
Save