good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
697c2b5d
Commit
697c2b5d
authored
Feb 3, 2015
by
Gustav Simonsson
Browse files
Options
Downloads
Patches
Plain Diff
Correct block parent timestamp check and typos
parent
4dc283c0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/block_processor.go
+6
-6
6 additions, 6 deletions
core/block_processor.go
miner/miner.go
+1
-1
1 addition, 1 deletion
miner/miner.go
with
7 additions
and
7 deletions
core/block_processor.go
+
6
−
6
View file @
697c2b5d
...
@@ -206,7 +206,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
...
@@ -206,7 +206,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
return
return
}
}
if
err
=
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
if
err
=
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
return
return
}
}
...
@@ -248,8 +248,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
...
@@ -248,8 +248,8 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
}
}
diff
:=
block
.
Header
()
.
Time
-
parent
.
Header
()
.
Time
diff
:=
block
.
Header
()
.
Time
-
parent
.
Header
()
.
Time
if
diff
<
0
{
if
diff
<
=
0
{
return
ValidationError
(
"Block timestamp
less then
prev block %v (%v - %v)"
,
diff
,
block
.
Header
()
.
Time
,
sm
.
bc
.
CurrentBlock
()
.
Header
()
.
Time
)
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
()
{
if
block
.
Time
()
>
time
.
Now
()
.
Unix
()
{
...
@@ -264,7 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
...
@@ -264,7 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return
nil
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
)
reward
:=
new
(
big
.
Int
)
.
Set
(
BlockReward
)
ancestors
:=
set
.
New
()
ancestors
:=
set
.
New
()
...
@@ -326,7 +326,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes
...
@@ -326,7 +326,7 @@ func (sm *BlockProcessor) GetMessages(block *types.Block) (messages []*state.Mes
defer
state
.
Reset
()
defer
state
.
Reset
()
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
)
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
)
return
state
.
Manifest
()
.
Messages
,
nil
return
state
.
Manifest
()
.
Messages
,
nil
}
}
...
@@ -347,7 +347,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro
...
@@ -347,7 +347,7 @@ func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err erro
defer
state
.
Reset
()
defer
state
.
Reset
()
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
TransitionState
(
state
,
parent
,
block
)
sm
.
Accum
e
lateRewards
(
state
,
block
,
parent
)
sm
.
Accum
u
lateRewards
(
state
,
block
,
parent
)
return
state
.
Logs
(),
nil
return
state
.
Logs
(),
nil
}
}
This diff is collapsed.
Click to expand it.
miner/miner.go
+
1
−
1
View file @
697c2b5d
...
@@ -206,7 +206,7 @@ func (self *Miner) mine() {
...
@@ -206,7 +206,7 @@ func (self *Miner) mine() {
block
.
SetReceipts
(
receipts
)
block
.
SetReceipts
(
receipts
)
// Accumulate the rewards included for this block
// 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
)
state
.
Update
(
ethutil
.
Big0
)
block
.
SetRoot
(
state
.
Root
())
block
.
SetRoot
(
state
.
Root
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment