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
e4aa011d
Commit
e4aa011d
authored
May 14, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Plain Diff
Merge pull request #970 from ethereum/vitalik_quick_test
Created separate family and ancestors environment objects
parents
bc837619
bdec8c3e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miner/worker.go
+8
-2
8 additions, 2 deletions
miner/worker.go
with
8 additions
and
2 deletions
miner/worker.go
+
8
−
2
View file @
e4aa011d
...
@@ -45,7 +45,8 @@ type environment struct {
...
@@ -45,7 +45,8 @@ type environment struct {
state
*
state
.
StateDB
// apply state changes here
state
*
state
.
StateDB
// apply state changes here
coinbase
*
state
.
StateObject
// the miner's account
coinbase
*
state
.
StateObject
// the miner's account
block
*
types
.
Block
// the new block
block
*
types
.
Block
// the new block
family
*
set
.
Set
// family set (used for checking uncles)
ancestors
*
set
.
Set
// ancestor set (used for checking uncle parent validity)
family
*
set
.
Set
// family set (used for checking uncle invalidity)
uncles
*
set
.
Set
// uncle set
uncles
*
set
.
Set
// uncle set
remove
*
set
.
Set
// tx which will be removed
remove
*
set
.
Set
// tx which will be removed
tcount
int
// tx count in cycle
tcount
int
// tx count in cycle
...
@@ -62,6 +63,7 @@ func env(block *types.Block, eth core.Backend) *environment {
...
@@ -62,6 +63,7 @@ func env(block *types.Block, eth core.Backend) *environment {
totalUsedGas
:
new
(
big
.
Int
),
totalUsedGas
:
new
(
big
.
Int
),
state
:
state
,
state
:
state
,
block
:
block
,
block
:
block
,
ancestors
:
set
.
New
(),
family
:
set
.
New
(),
family
:
set
.
New
(),
uncles
:
set
.
New
(),
uncles
:
set
.
New
(),
coinbase
:
state
.
GetOrNewStateObject
(
block
.
Coinbase
()),
coinbase
:
state
.
GetOrNewStateObject
(
block
.
Coinbase
()),
...
@@ -265,7 +267,11 @@ func (self *worker) makeCurrent() {
...
@@ -265,7 +267,11 @@ func (self *worker) makeCurrent() {
current
:=
env
(
block
,
self
.
eth
)
current
:=
env
(
block
,
self
.
eth
)
for
_
,
ancestor
:=
range
self
.
chain
.
GetAncestors
(
block
,
7
)
{
for
_
,
ancestor
:=
range
self
.
chain
.
GetAncestors
(
block
,
7
)
{
for
_
,
uncle
:=
range
ancestor
.
Uncles
()
{
current
.
family
.
Add
(
uncle
.
Hash
())
}
current
.
family
.
Add
(
ancestor
.
Hash
())
current
.
family
.
Add
(
ancestor
.
Hash
())
current
.
ancestors
.
Add
(
ancestor
.
Hash
())
}
}
accounts
,
_
:=
self
.
eth
.
AccountManager
()
.
Accounts
()
accounts
,
_
:=
self
.
eth
.
AccountManager
()
.
Accounts
()
// Keep track of transactions which return errors so they can be removed
// Keep track of transactions which return errors so they can be removed
...
@@ -363,7 +369,7 @@ func (self *worker) commitUncle(uncle *types.Header) error {
...
@@ -363,7 +369,7 @@ func (self *worker) commitUncle(uncle *types.Header) error {
}
}
self
.
current
.
uncles
.
Add
(
uncle
.
Hash
())
self
.
current
.
uncles
.
Add
(
uncle
.
Hash
())
if
!
self
.
current
.
family
.
Has
(
uncle
.
ParentHash
)
{
if
!
self
.
current
.
ancestors
.
Has
(
uncle
.
ParentHash
)
{
return
core
.
UncleError
(
fmt
.
Sprintf
(
"Uncle's parent unknown (%x)"
,
uncle
.
ParentHash
[
0
:
4
]))
return
core
.
UncleError
(
fmt
.
Sprintf
(
"Uncle's parent unknown (%x)"
,
uncle
.
ParentHash
[
0
:
4
]))
}
}
...
...
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