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
09aabaea
Commit
09aabaea
authored
Apr 24, 2017
by
Péter Szilágyi
Committed by
GitHub
Apr 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14364 from fjl/core-remove-split-stat-ty
core, light: delete SplitStatTy, ChainSplitEvent (unused)
parents
d2fda73a
7b2fc064
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
15 deletions
+3
-15
blockchain.go
core/blockchain.go
+3
-6
events.go
core/events.go
+0
-6
lightchain.go
light/lightchain.go
+0
-3
No files found.
core/blockchain.go
View file @
09aabaea
...
@@ -628,7 +628,6 @@ type WriteStatus byte
...
@@ -628,7 +628,6 @@ type WriteStatus byte
const
(
const
(
NonStatTy
WriteStatus
=
iota
NonStatTy
WriteStatus
=
iota
CanonStatTy
CanonStatTy
SplitStatTy
SideStatTy
SideStatTy
)
)
...
@@ -1029,9 +1028,6 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
...
@@ -1029,9 +1028,6 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
blockInsertTimer
.
UpdateSince
(
bstart
)
blockInsertTimer
.
UpdateSince
(
bstart
)
events
=
append
(
events
,
ChainSideEvent
{
block
})
events
=
append
(
events
,
ChainSideEvent
{
block
})
case
SplitStatTy
:
events
=
append
(
events
,
ChainSplitEvent
{
block
,
logs
})
}
}
stats
.
processed
++
stats
.
processed
++
stats
.
usedGas
+=
usedGas
.
Uint64
()
stats
.
usedGas
+=
usedGas
.
Uint64
()
...
@@ -1226,8 +1222,9 @@ func (self *BlockChain) postChainEvents(events []interface{}, logs []*types.Log)
...
@@ -1226,8 +1222,9 @@ func (self *BlockChain) postChainEvents(events []interface{}, logs []*types.Log)
self
.
eventMux
.
Post
(
logs
)
self
.
eventMux
.
Post
(
logs
)
for
_
,
event
:=
range
events
{
for
_
,
event
:=
range
events
{
if
event
,
ok
:=
event
.
(
ChainEvent
);
ok
{
if
event
,
ok
:=
event
.
(
ChainEvent
);
ok
{
// We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long
// We need some control over the mining operation. Acquiring locks and waiting
// and in most cases isn't even necessary.
// for the miner to create new block takes too long and in most cases isn't
// even necessary.
if
self
.
LastBlockHash
()
==
event
.
Hash
{
if
self
.
LastBlockHash
()
==
event
.
Hash
{
self
.
eventMux
.
Post
(
ChainHeadEvent
{
event
.
Block
})
self
.
eventMux
.
Post
(
ChainHeadEvent
{
event
.
Block
})
}
}
...
...
core/events.go
View file @
09aabaea
...
@@ -46,12 +46,6 @@ type RemovedTransactionEvent struct{ Txs types.Transactions }
...
@@ -46,12 +46,6 @@ type RemovedTransactionEvent struct{ Txs types.Transactions }
// RemovedLogEvent is posted when a reorg happens
// RemovedLogEvent is posted when a reorg happens
type
RemovedLogsEvent
struct
{
Logs
[]
*
types
.
Log
}
type
RemovedLogsEvent
struct
{
Logs
[]
*
types
.
Log
}
// ChainSplit is posted when a new head is detected
type
ChainSplitEvent
struct
{
Block
*
types
.
Block
Logs
[]
*
types
.
Log
}
type
ChainEvent
struct
{
type
ChainEvent
struct
{
Block
*
types
.
Block
Block
*
types
.
Block
Hash
common
.
Hash
Hash
common
.
Hash
...
...
light/lightchain.go
View file @
09aabaea
...
@@ -377,9 +377,6 @@ func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int)
...
@@ -377,9 +377,6 @@ func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int)
case
core
.
SideStatTy
:
case
core
.
SideStatTy
:
log
.
Debug
(
"Inserted forked header"
,
"number"
,
header
.
Number
,
"hash"
,
header
.
Hash
())
log
.
Debug
(
"Inserted forked header"
,
"number"
,
header
.
Number
,
"hash"
,
header
.
Hash
())
events
=
append
(
events
,
core
.
ChainSideEvent
{
Block
:
types
.
NewBlockWithHeader
(
header
)})
events
=
append
(
events
,
core
.
ChainSideEvent
{
Block
:
types
.
NewBlockWithHeader
(
header
)})
case
core
.
SplitStatTy
:
events
=
append
(
events
,
core
.
ChainSplitEvent
{
Block
:
types
.
NewBlockWithHeader
(
header
)})
}
}
return
err
return
err
}
}
...
...
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