listen on network only if web3 mode

pull/1/head
yann300 7 years ago
parent f609aec381
commit 4040196444
  1. 4
      src/app/execution/txListener.js

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

Loading…
Cancel
Save