1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00

Update network.js

This commit is contained in:
kumavis 2018-10-21 04:32:07 -04:00 committed by GitHub
parent 61c7bbb1c1
commit b62d07f3a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,7 @@ module.exports = class NetworkController extends EventEmitter {
return log.warn('NetworkController - lookupNetwork aborted due to missing provider')
}
const ethQuery = new EthQuery(this._provider)
// first attempt to perform lookup via eth_chainId
ethQuery.sendAsync({ method: 'eth_chainId' }, (err, chainIdHex) => {
if (err) {
// if eth_chainId is not supported, fallback to net_verion