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
1d6451f5
Commit
1d6451f5
authored
Mar 20, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inline GetBlockByNumber
parent
bde16138
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
api.go
rpc/api.go
+13
-20
No files found.
rpc/api.go
View file @
1d6451f5
...
@@ -97,13 +97,6 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e
...
@@ -97,13 +97,6 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e
return
nil
return
nil
}
}
func
(
p
*
EthereumApi
)
GetBlockByNumber
(
blocknum
int64
,
includetx
bool
)
(
*
BlockRes
,
error
)
{
block
:=
p
.
xeth
()
.
EthBlockByNumber
(
blocknum
)
br
:=
NewBlockRes
(
block
)
br
.
fullTx
=
includetx
return
br
,
nil
}
// func (self *EthereumApi) Register(args string, reply *interface{}) error {
// func (self *EthereumApi) Register(args string, reply *interface{}) error {
// self.regmut.Lock()
// self.regmut.Lock()
// defer self.regmut.Unlock()
// defer self.regmut.Unlock()
...
@@ -284,11 +277,11 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -284,11 +277,11 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
return
err
}
}
v
,
err
:=
p
.
GetBlockByNumber
(
args
.
BlockNumber
,
args
.
IncludeTxs
)
block
:=
p
.
xeth
()
.
EthBlockByNumber
(
args
.
BlockNumber
)
if
err
!=
nil
{
br
:=
NewBlockRes
(
block
)
return
err
br
.
fullTx
=
args
.
IncludeTxs
}
*
reply
=
v
*
reply
=
br
case
"eth_getTransactionByHash"
:
case
"eth_getTransactionByHash"
:
// HashIndexArgs used, but only the "Hash" part we need.
// HashIndexArgs used, but only the "Hash" part we need.
args
:=
new
(
HashIndexArgs
)
args
:=
new
(
HashIndexArgs
)
...
@@ -318,10 +311,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -318,10 +311,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
return
err
}
}
v
,
err
:=
p
.
GetBlockByNumber
(
args
.
BlockNumber
,
true
)
block
:=
p
.
xeth
()
.
EthBlockByNumber
(
args
.
BlockNumber
)
if
err
!=
nil
{
v
:=
NewBlockRes
(
block
)
return
err
v
.
fullTx
=
true
}
if
args
.
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Index
<
0
{
if
args
.
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Index
<
0
{
return
NewValidationError
(
"Index"
,
"does not exist"
)
return
NewValidationError
(
"Index"
,
"does not exist"
)
}
}
...
@@ -348,10 +341,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -348,10 +341,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
return
err
}
}
v
,
err
:=
p
.
GetBlockByNumber
(
args
.
BlockNumber
,
true
)
block
:=
p
.
xeth
()
.
EthBlockByNumber
(
args
.
BlockNumber
)
if
err
!=
nil
{
v
:=
NewBlockRes
(
block
)
return
err
v
.
fullTx
=
true
}
if
args
.
Index
>
int64
(
len
(
v
.
Uncles
))
||
args
.
Index
<
0
{
if
args
.
Index
>
int64
(
len
(
v
.
Uncles
))
||
args
.
Index
<
0
{
return
NewValidationError
(
"Index"
,
"does not exist"
)
return
NewValidationError
(
"Index"
,
"does not exist"
)
}
}
...
...
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