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
47129428
Commit
47129428
authored
Feb 05, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #290 from Gustav-Simonsson/correct_block_parent_timestamp_check
Correct block parent timestamp check and typos
parents
2f30a27b
697c2b5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
block_processor.go
core/block_processor.go
+6
-6
miner.go
miner/miner.go
+1
-1
No files found.
core/block_processor.go
View file @
47129428
...
...
@@ -220,7 +220,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
return
}
if
err
=
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
if
err
=
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
return
}
...
...
@@ -261,8 +261,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
}
diff
:=
block
.
Header
()
.
Time
-
parent
.
Header
()
.
Time
if
diff
<
0
{
return
ValidationError
(
"Block timestamp
less then
prev block %v (%v - %v)"
,
diff
,
block
.
Header
()
.
Time
,
sm
.
bc
.
CurrentBlock
()
.
Header
()
.
Time
)
if
diff
<
=
0
{
return
ValidationError
(
"Block timestamp
not after
prev block %v (%v - %v)"
,
diff
,
block
.
Header
()
.
Time
,
sm
.
bc
.
CurrentBlock
()
.
Header
()
.
Time
)
}
if
block
.
Time
()
>
time
.
Now
()
.
Unix
()
{
...
...
@@ -277,7 +277,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return
nil
}
func
(
sm
*
BlockProcessor
)
Accum
e
lateRewards
(
statedb
*
state
.
StateDB
,
block
,
parent
*
types
.
Block
)
error
{
func
(
sm
*
BlockProcessor
)
Accum
u
lateRewards
(
statedb
*
state
.
StateDB
,
block
,
parent
*
types
.
Block
)
error
{
reward
:=
new
(
big
.
Int
)
.
Set
(
BlockReward
)
ancestors
:=
set
.
New
()
...
...
@@ -335,7 +335,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes
defer
state
.
Reset
()
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
)
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
)
return
state
.
Manifest
()
.
Messages
,
nil
}
...
...
@@ -356,7 +356,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro
defer
state
.
Reset
()
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
)
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
)
return
state
.
Logs
(),
nil
}
miner/miner.go
View file @
47129428
...
...
@@ -204,7 +204,7 @@ func (self *Miner) mine() {
block
.
SetReceipts
(
receipts
)
// Accumulate the rewards included for this block
blockProcessor
.
Accum
e
lateRewards
(
state
,
block
,
parent
)
blockProcessor
.
Accum
u
lateRewards
(
state
,
block
,
parent
)
state
.
Update
(
ethutil
.
Big0
)
block
.
SetRoot
(
state
.
Root
())
...
...
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