diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-20 19:07:19 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-20 19:07:19 +0800 |
commit | 41c493ace9182bc99226d66dc4479277fbbf749d (patch) | |
tree | 2f8f1b7f00903d328f21701b94dd416313882666 /rpc/api.go | |
parent | 55fdf3e46272ec50a4d55f519b542df790920306 (diff) | |
parent | eb452115018e7686dc94ce1e92d2e9f85d76ab09 (diff) | |
download | dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.gz dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.bz2 dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.lz dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.xz dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.zst dexon-41c493ace9182bc99226d66dc4479277fbbf749d.zip |
Merge branch 'rpcfrontier' of github.com-obscure:ethereum/go-ethereum into rpcfrontier
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/rpc/api.go b/rpc/api.go index fcf2ac9dc..06ed73885 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -214,7 +214,7 @@ func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error { defer self.logMut.Unlock() if self.logs[id] != nil { - *reply = toLogs(self.logs[id].get()) + *reply = NewLogsRes(self.logs[id].get()) } return nil @@ -226,7 +226,7 @@ func (self *EthereumApi) Logs(id int, reply *interface{}) error { filter := self.filterManager.GetFilter(id) if filter != nil { - *reply = toLogs(filter.Find()) + *reply = NewLogsRes(filter.Find()) } return nil @@ -236,7 +236,7 @@ func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error filter := core.NewFilter(self.xeth().Backend()) filter.SetOptions(toFilterOptions(args)) - *reply = toLogs(filter.Find()) + *reply = NewLogsRes(filter.Find()) return nil } @@ -873,3 +873,36 @@ func toFilterOptions(options *FilterOptions) core.FilterOptions { return opts } + +type whisperFilter struct { + messages []xeth.WhisperMessage + timeout time.Time + id int +} + +func (w *whisperFilter) add(msgs ...xeth.WhisperMessage) { + w.messages = append(w.messages, msgs...) +} +func (w *whisperFilter) get() []xeth.WhisperMessage { + w.timeout = time.Now() + tmp := w.messages + w.messages = nil + return tmp +} + +type logFilter struct { + logs state.Logs + timeout time.Time + id int +} + +func (l *logFilter) add(logs ...state.Log) { + l.logs = append(l.logs, logs...) +} + +func (l *logFilter) get() state.Logs { + l.timeout = time.Now() + tmp := l.logs + l.logs = nil + return tmp +} |