|
|
@ -129,6 +129,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
provider: this.provider, |
|
|
|
provider: this.provider, |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// start and stop polling for balances based on activeControllerConnections
|
|
|
|
// start and stop polling for balances based on activeControllerConnections
|
|
|
|
this.on('controllerConnectionChanged', (activeControllerConnections) => { |
|
|
|
this.on('controllerConnectionChanged', (activeControllerConnections) => { |
|
|
|
if (activeControllerConnections > 0) { |
|
|
|
if (activeControllerConnections > 0) { |
|
|
@ -137,7 +138,12 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
this.accountTracker.stop() |
|
|
|
this.accountTracker.stop() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ensure accountTracker updates balances after network change
|
|
|
|
|
|
|
|
this.networkController.on('networkDidChange', () => { |
|
|
|
|
|
|
|
this.accountTracker._updateAccounts() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// key mgmt
|
|
|
|
// key mgmt
|
|
|
|
const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring] |
|
|
|
const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring] |
|
|
|
this.keyringController = new KeyringController({ |
|
|
|
this.keyringController = new KeyringController({ |
|
|
|