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
4688d3c8
Unverified
Commit
4688d3c8
authored
Mar 07, 2023
by
Felix Lange
Committed by
GitHub
Mar 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethclient: fix panic when requesting missing blocks (#26817)
This fixes a regression introduced by #26723. Fixes #26816.
parent
544e4a70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
ethclient.go
ethclient/ethclient.go
+7
-3
No files found.
ethclient/ethclient.go
View file @
4688d3c8
...
...
@@ -113,15 +113,19 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
err
:=
ec
.
c
.
CallContext
(
ctx
,
&
raw
,
method
,
args
...
)
if
err
!=
nil
{
return
nil
,
err
}
else
if
len
(
raw
)
==
0
{
return
nil
,
ethereum
.
NotFound
}
// Decode header and transactions.
var
head
*
types
.
Header
var
body
rpcBlock
if
err
:=
json
.
Unmarshal
(
raw
,
&
head
);
err
!=
nil
{
return
nil
,
err
}
// When the block is not found, the API returns JSON null.
if
head
==
nil
{
return
nil
,
ethereum
.
NotFound
}
var
body
rpcBlock
if
err
:=
json
.
Unmarshal
(
raw
,
&
body
);
err
!=
nil
{
return
nil
,
err
}
...
...
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