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
5c8cc10d
Unverified
Commit
5c8cc10d
authored
Feb 01, 2023
by
Martin Holst Swende
Committed by
GitHub
Feb 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: improve ambiguous block validation message (#26582)
parent
bd6a05e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
block_validator.go
core/block_validator.go
+3
-3
No files found.
core/block_validator.go
View file @
5c8cc10d
...
@@ -60,14 +60,14 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
...
@@ -60,14 +60,14 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
return
err
return
err
}
}
if
hash
:=
types
.
CalcUncleHash
(
block
.
Uncles
());
hash
!=
header
.
UncleHash
{
if
hash
:=
types
.
CalcUncleHash
(
block
.
Uncles
());
hash
!=
header
.
UncleHash
{
return
fmt
.
Errorf
(
"uncle root hash mismatch
: have %x, want %x"
,
hash
,
header
.
UncleH
ash
)
return
fmt
.
Errorf
(
"uncle root hash mismatch
(header value %x, calculated %x)"
,
header
.
UncleHash
,
h
ash
)
}
}
if
hash
:=
types
.
DeriveSha
(
block
.
Transactions
(),
trie
.
NewStackTrie
(
nil
));
hash
!=
header
.
TxHash
{
if
hash
:=
types
.
DeriveSha
(
block
.
Transactions
(),
trie
.
NewStackTrie
(
nil
));
hash
!=
header
.
TxHash
{
return
fmt
.
Errorf
(
"transaction root hash mismatch
: have %x, want %x"
,
hash
,
header
.
TxH
ash
)
return
fmt
.
Errorf
(
"transaction root hash mismatch
(header value %x, calculated %x)"
,
header
.
TxHash
,
h
ash
)
}
}
if
header
.
WithdrawalsHash
!=
nil
{
if
header
.
WithdrawalsHash
!=
nil
{
if
hash
:=
types
.
DeriveSha
(
block
.
Withdrawals
(),
trie
.
NewStackTrie
(
nil
));
hash
!=
*
header
.
WithdrawalsHash
{
if
hash
:=
types
.
DeriveSha
(
block
.
Withdrawals
(),
trie
.
NewStackTrie
(
nil
));
hash
!=
*
header
.
WithdrawalsHash
{
return
fmt
.
Errorf
(
"withdrawals root hash mismatch
: have %x, want %x"
,
hash
,
*
header
.
WithdrawalsH
ash
)
return
fmt
.
Errorf
(
"withdrawals root hash mismatch
(header value %x, calculated %x)"
,
*
header
.
WithdrawalsHash
,
h
ash
)
}
}
}
}
if
!
v
.
bc
.
HasBlockAndState
(
block
.
ParentHash
(),
block
.
NumberU64
()
-
1
)
{
if
!
v
.
bc
.
HasBlockAndState
(
block
.
ParentHash
(),
block
.
NumberU64
()
-
1
)
{
...
...
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