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
69f7a1da
Commit
69f7a1da
authored
May 27, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1122 from Gustav-Simonsson/improve_validate_header_comments
Update ValidateHeader comments
parents
34729c36
bf5f0b1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
block_processor.go
core/block_processor.go
+2
-4
No files found.
core/block_processor.go
View file @
69f7a1da
...
@@ -285,9 +285,8 @@ func (self *BlockProcessor) GetBlockReceipts(bhash common.Hash) (receipts types.
...
@@ -285,9 +285,8 @@ func (self *BlockProcessor) GetBlockReceipts(bhash common.Hash) (receipts types.
}
}
// Validates the current block. Returns an error if the block was invalid,
// See YP section 4.3.4. "Block Header Validity"
// an uncle or anything that isn't on the current block chain.
// Validates a block. Returns an error if the block is invalid.
// Validation validates easy over difficult (dagger takes longer time = difficult)
func
(
sm
*
BlockProcessor
)
ValidateHeader
(
block
,
parent
*
types
.
Header
,
checkPow
bool
)
error
{
func
(
sm
*
BlockProcessor
)
ValidateHeader
(
block
,
parent
*
types
.
Header
,
checkPow
bool
)
error
{
if
big
.
NewInt
(
int64
(
len
(
block
.
Extra
)))
.
Cmp
(
params
.
MaximumExtraDataSize
)
==
1
{
if
big
.
NewInt
(
int64
(
len
(
block
.
Extra
)))
.
Cmp
(
params
.
MaximumExtraDataSize
)
==
1
{
return
fmt
.
Errorf
(
"Block extra data too long (%d)"
,
len
(
block
.
Extra
))
return
fmt
.
Errorf
(
"Block extra data too long (%d)"
,
len
(
block
.
Extra
))
...
@@ -298,7 +297,6 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header, checkPow b
...
@@ -298,7 +297,6 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header, checkPow b
return
fmt
.
Errorf
(
"Difficulty check failed for block %v, %v"
,
block
.
Difficulty
,
expd
)
return
fmt
.
Errorf
(
"Difficulty check failed for block %v, %v"
,
block
.
Difficulty
,
expd
)
}
}
// block.gasLimit - parent.gasLimit <= parent.gasLimit / GasLimitBoundDivisor
a
:=
new
(
big
.
Int
)
.
Sub
(
block
.
GasLimit
,
parent
.
GasLimit
)
a
:=
new
(
big
.
Int
)
.
Sub
(
block
.
GasLimit
,
parent
.
GasLimit
)
a
.
Abs
(
a
)
a
.
Abs
(
a
)
b
:=
new
(
big
.
Int
)
.
Div
(
parent
.
GasLimit
,
params
.
GasLimitBoundDivisor
)
b
:=
new
(
big
.
Int
)
.
Div
(
parent
.
GasLimit
,
params
.
GasLimitBoundDivisor
)
...
...
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