来自ethereum-web3的Event.watch被无限次激发

时间:2016-04-04 08:52:33

标签: ethereum solidity truffle

我正在尝试松露+ web3 + ethereumjs-testrpc。在应用程序中,我有以下代码:

window.onload = function() {
  var meta = MetaCoin.deployed();
  var event = meta.Transfer({}, {fromBlock: 0, toBlock: 'latest'}, function (error, result) {
    if (error) {
      console.log("Error: " + error);
    } else {
      console.log(result);
    }
  });
}

我在控制台中无休止地获得最新的转移。 合同是标准的MetaCoin,添加了事件转移。 Here是完整的代码。

1 个答案:

答案 0 :(得分:0)

这听起来像是TestRPC的一个问题。事件相关的方法已经更新,并且可能更新版本的TestRPC将解决您的问题。干杯!

相关问题