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
ff844918
Unverified
Commit
ff844918
authored
Nov 01, 2021
by
Martin Holst Swende
Committed by
GitHub
Nov 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpc: avoid crashing on clique getSigner during sync (#23832)
parent
c113520d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
api.go
consensus/clique/api.go
+3
-0
types.go
rpc/types.go
+10
-0
No files found.
consensus/clique/api.go
View file @
ff844918
...
@@ -214,6 +214,9 @@ func (api *API) GetSigner(rlpOrBlockNr *blockNumberOrHashOrRLP) (common.Address,
...
@@ -214,6 +214,9 @@ func (api *API) GetSigner(rlpOrBlockNr *blockNumberOrHashOrRLP) (common.Address,
}
else
if
number
,
ok
:=
blockNrOrHash
.
Number
();
ok
{
}
else
if
number
,
ok
:=
blockNrOrHash
.
Number
();
ok
{
header
=
api
.
chain
.
GetHeaderByNumber
(
uint64
(
number
.
Int64
()))
header
=
api
.
chain
.
GetHeaderByNumber
(
uint64
(
number
.
Int64
()))
}
}
if
header
==
nil
{
return
common
.
Address
{},
fmt
.
Errorf
(
"missing block %v"
,
blockNrOrHash
.
String
())
}
return
api
.
clique
.
Author
(
header
)
return
api
.
clique
.
Author
(
header
)
}
}
block
:=
new
(
types
.
Block
)
block
:=
new
(
types
.
Block
)
...
...
rpc/types.go
View file @
ff844918
...
@@ -186,6 +186,16 @@ func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool) {
...
@@ -186,6 +186,16 @@ func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool) {
return
BlockNumber
(
0
),
false
return
BlockNumber
(
0
),
false
}
}
func
(
bnh
*
BlockNumberOrHash
)
String
()
string
{
if
bnh
.
BlockNumber
!=
nil
{
return
strconv
.
Itoa
(
int
(
*
bnh
.
BlockNumber
))
}
if
bnh
.
BlockHash
!=
nil
{
return
bnh
.
BlockHash
.
String
()
}
return
"nil"
}
func
(
bnh
*
BlockNumberOrHash
)
Hash
()
(
common
.
Hash
,
bool
)
{
func
(
bnh
*
BlockNumberOrHash
)
Hash
()
(
common
.
Hash
,
bool
)
{
if
bnh
.
BlockHash
!=
nil
{
if
bnh
.
BlockHash
!=
nil
{
return
*
bnh
.
BlockHash
,
true
return
*
bnh
.
BlockHash
,
true
...
...
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