1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #617 from MetaMask/i616-FixListenerLeak

I616 fix listener leak
This commit is contained in:
Kevin Serrano 2016-09-06 19:07:30 -07:00 committed by GitHub
commit 54425f4ee7
3 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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))

View File

@ -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)
}