Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0932f843
Commit
0932f843
authored
Mar 13, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eth_newBlockFilter
parent
d4ed66c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
api.go
rpc/api.go
+8
-4
args.go
rpc/args.go
+7
-2
No files found.
rpc/api.go
View file @
0932f843
...
...
@@ -176,7 +176,7 @@ func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error {
return
nil
}
func
(
self
*
EthereumApi
)
NewFilterString
(
args
string
,
reply
*
interface
{})
error
{
func
(
self
*
EthereumApi
)
NewFilterString
(
args
*
FilterStringArgs
,
reply
*
interface
{})
error
{
var
id
int
filter
:=
core
.
NewFilter
(
self
.
xeth
()
.
Backend
())
...
...
@@ -186,10 +186,14 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
self
.
logs
[
id
]
.
add
(
&
state
.
StateLog
{})
}
if
args
==
"pending"
{
switch
args
.
Word
{
case
"pending"
:
filter
.
PendingCallback
=
callback
}
else
if
args
==
"chain"
{
case
"latest"
:
filter
.
BlockCallback
=
callback
default
:
return
NewValidationError
(
"Word"
,
"Must be `latest` or `pending`"
)
}
id
=
self
.
filterManager
.
InstallFilter
(
filter
)
...
...
@@ -692,7 +696,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
return
err
}
return
p
.
NewFilterString
(
args
.
Word
,
reply
)
return
p
.
NewFilterString
(
args
,
reply
)
case
"eth_uninstallFilter"
:
args
:=
new
(
FilterIdArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
rpc/args.go
View file @
0932f843
...
...
@@ -503,7 +503,7 @@ type FilterStringArgs struct {
}
func
(
args
*
FilterStringArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
string
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
...
...
@@ -513,7 +513,12 @@ func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
return
NewInsufficientParamsError
(
len
(
obj
),
1
)
}
args
.
Word
=
obj
[
0
]
var
argstr
string
argstr
,
ok
:=
obj
[
0
]
.
(
string
)
if
!
ok
{
return
NewDecodeParamError
(
"Filter is not a string"
)
}
args
.
Word
=
argstr
return
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment