|
|
@ -279,19 +279,20 @@ function ExecutionContext () { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
web3.setProvider(new web3.providers.HttpProvider(endpoint)) |
|
|
|
web3.setProvider(new web3.providers.HttpProvider(endpoint)) |
|
|
|
} |
|
|
|
} |
|
|
|
// fixed
|
|
|
|
web3.eth.net.isListening((err, isConnected) => { |
|
|
|
if (web3.isConnected()) { |
|
|
|
if (!err && isConnected) { |
|
|
|
executionContext = context |
|
|
|
executionContext = context |
|
|
|
self._updateBlockGasLimit() |
|
|
|
self._updateBlockGasLimit() |
|
|
|
self.event.trigger('contextChanged', ['web3']) |
|
|
|
self.event.trigger('contextChanged', ['web3']) |
|
|
|
self.event.trigger('web3EndpointChanged') |
|
|
|
self.event.trigger('web3EndpointChanged') |
|
|
|
cb() |
|
|
|
cb() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
web3.setProvider(oldProvider) |
|
|
|
web3.setProvider(oldProvider) |
|
|
|
var alertMsg = 'Not possible to connect to the Web3 provider. ' |
|
|
|
var alertMsg = 'Not possible to connect to the Web3 provider. ' |
|
|
|
alertMsg += 'Make sure the provider is running and a connection is open (via IPC or RPC).' |
|
|
|
alertMsg += 'Make sure the provider is running and a connection is open (via IPC or RPC).' |
|
|
|
cb(alertMsg) |
|
|
|
cb(alertMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.setProviderFromEndpoint = setProviderFromEndpoint |
|
|
|
this.setProviderFromEndpoint = setProviderFromEndpoint |
|
|
|
|
|
|
|
|
|
|
|