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
6fd894aa
Commit
6fd894aa
authored
Feb 23, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow zero and negative block numbers
0 is genesis block. Xeth recognises -1 as current
parent
dd086791
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
15 deletions
+4
-15
args.go
rpc/args.go
+0
-7
packages.go
rpc/packages.go
+4
-8
No files found.
rpc/args.go
View file @
6fd894aa
...
@@ -22,13 +22,6 @@ func (obj *GetBlockArgs) UnmarshalJSON(b []byte) (err error) {
...
@@ -22,13 +22,6 @@ func (obj *GetBlockArgs) UnmarshalJSON(b []byte) (err error) {
return
NewErrorResponse
(
ErrorDecodeArgs
)
return
NewErrorResponse
(
ErrorDecodeArgs
)
}
}
func
(
obj
*
GetBlockArgs
)
requirements
()
error
{
if
obj
.
BlockNumber
==
0
&&
obj
.
Hash
==
""
{
return
NewErrorResponse
(
"GetBlock requires either a block 'number' or a block 'hash' as argument"
)
}
return
nil
}
type
NewTxArgs
struct
{
type
NewTxArgs
struct
{
From
string
`json:"from"`
From
string
`json:"from"`
To
string
`json:"to"`
To
string
`json:"to"`
...
...
rpc/packages.go
View file @
6fd894aa
...
@@ -177,15 +177,11 @@ func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error
...
@@ -177,15 +177,11 @@ func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error
}
}
func
(
p
*
EthereumApi
)
GetBlock
(
args
*
GetBlockArgs
,
reply
*
interface
{})
error
{
func
(
p
*
EthereumApi
)
GetBlock
(
args
*
GetBlockArgs
,
reply
*
interface
{})
error
{
err
:=
args
.
requirements
()
// This seems a bit precarious Maybe worth splitting to discrete functions
if
err
!=
nil
{
if
len
(
args
.
Hash
)
>
0
{
return
err
}
if
args
.
BlockNumber
>
0
{
*
reply
=
p
.
xeth
.
BlockByNumber
(
args
.
BlockNumber
)
}
else
{
*
reply
=
p
.
xeth
.
BlockByHash
(
args
.
Hash
)
*
reply
=
p
.
xeth
.
BlockByHash
(
args
.
Hash
)
}
else
{
*
reply
=
p
.
xeth
.
BlockByNumber
(
args
.
BlockNumber
)
}
}
return
nil
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