Merge pull request #2001 from obscuren/fixes

cmd, crypto: updated web3
This commit is contained in:
Jeffrey Wilcke 2015-11-26 23:00:05 +01:00
commit b9db5b37f2
3 changed files with 6278 additions and 996 deletions

View File

@ -299,12 +299,12 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
utils.Fatalf("Error loading web3.js: %v", err)
}
_, err = js.re.Run("var web3 = require('web3');")
_, err = js.re.Run("var Web3 = require('web3');")
if err != nil {
utils.Fatalf("Error requiring web3: %v", err)
}
_, err = js.re.Run("web3.setProvider(jeth)")
_, err = js.re.Run("var web3 = new Web3(jeth);")
if err != nil {
utils.Fatalf("Error setting web3 provider: %v", err)
}

File diff suppressed because it is too large Load Diff

View File

@ -644,7 +644,9 @@ func (p *XEth) NewWhisperFilter(to, from string, topics [][]string) int {
callback := func(msg WhisperMessage) {
p.messagesMu.RLock() // Only read lock to the filter pool
defer p.messagesMu.RUnlock()
p.messages[id].insert(msg)
if p.messages[id] != nil {
p.messages[id].insert(msg)
}
}
// Initialize the core whisper filter and wrap into xeth
id = p.Whisper().Watch(to, from, topics, callback)