diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-18 05:20:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-18 05:20:47 +0800 |
commit | 7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048 (patch) | |
tree | 764d7ebd57cafbae0a12d046aeafd1b823a0f0bb /rpc/packages.go | |
parent | 11e12680ebe4f4679083317ee0f2c27b219d44b3 (diff) | |
download | dexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.tar.gz dexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.tar.zst dexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.zip |
Changed to ChainEvent and fixed a nil pointer in transact
Diffstat (limited to 'rpc/packages.go')
-rw-r--r-- | rpc/packages.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/packages.go b/rpc/packages.go index 0b73d48a7..4d2194571 100644 --- a/rpc/packages.go +++ b/rpc/packages.go @@ -127,6 +127,9 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error filter := core.NewFilter(self.xeth.Backend()) callback := func(block *types.Block) { + self.logMut.Lock() + defer self.logMut.Unlock() + self.logs[id] = append(self.logs[id], &state.StateLog{}) } if args == "pending" { @@ -153,6 +156,9 @@ func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error { } func (self *EthereumApi) Logs(id int, reply *interface{}) error { + self.logMut.Lock() + defer self.logMut.Unlock() + filter := self.filterManager.GetFilter(id) *reply = toLogs(filter.Find()) |