Commit 40401964 authored by yann300's avatar yann300

listen on network only if web3 mode

parent f609aec3
......@@ -38,7 +38,7 @@ class TxListener {
// in VM mode
// in web3 mode && listen remix txs only
if (!this._isListening) return // we don't listen
if (this._loopId) return // we seems to already listen on the network
if (this._loopId && executionContext.getProvider() !== 'vm') return // we seems to already listen on a "web3" network
executionContext.web3().eth.getTransaction(txResult.transactionHash, (error, tx) => {
if (error) return console.log(error)
if (txResult && txResult.result && txResult.result.vm) tx.returnValue = txResult.result.vm.return
......@@ -81,7 +81,7 @@ class TxListener {
startListening () {
this.init()
this._isListening = true
if (this._listenOnNetwork) {
if (this._listenOnNetwork && executionContext.getProvider() !== 'vm') {
this._startListenOnNetwork()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment