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
0f76a1c6
Commit
0f76a1c6
authored
May 14, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: changed how head events are checked
parent
580bae0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
chain_manager.go
core/chain_manager.go
+2
-2
events.go
core/events.go
+2
-0
No files found.
core/chain_manager.go
View file @
0f76a1c6
...
...
@@ -593,7 +593,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
self
.
setTransState
(
state
.
New
(
block
.
Root
(),
self
.
stateDb
))
self
.
txState
.
SetState
(
state
.
New
(
block
.
Root
(),
self
.
stateDb
))
queue
[
i
]
=
ChainEvent
{
block
,
logs
}
queue
[
i
]
=
ChainEvent
{
block
,
block
.
Hash
(),
logs
}
queueEvent
.
canonicalCount
++
if
glog
.
V
(
logger
.
Debug
)
{
...
...
@@ -683,7 +683,7 @@ out:
case
ChainEvent
:
// We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long
// and in most cases isn't even necessary.
if
i
+
1
==
ev
.
canonicalCount
{
if
self
.
lastBlockHash
==
event
.
Hash
{
self
.
currentGasLimit
=
CalcGasLimit
(
event
.
Block
)
self
.
eventMux
.
Post
(
ChainHeadEvent
{
event
.
Block
})
}
...
...
core/events.go
View file @
0f76a1c6
...
...
@@ -3,6 +3,7 @@ package core
import
(
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
)
...
...
@@ -27,6 +28,7 @@ type ChainSplitEvent struct {
type
ChainEvent
struct
{
Block
*
types
.
Block
Hash
common
.
Hash
Logs
state
.
Logs
}
...
...
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