Skip to content

Commit 7b2fc06

Browse files
committed
core, light: delete SplitStatTy, ChainSplitEvent (unused)
1 parent d2fda73 commit 7b2fc06

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

‎core/blockchain.go‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ type WriteStatus byte
628628
const (
629629
NonStatTy WriteStatus = iota
630630
CanonStatTy
631-
SplitStatTy
632631
SideStatTy
633632
)
634633

@@ -1029,9 +1028,6 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
10291028

10301029
blockInsertTimer.UpdateSince(bstart)
10311030
events = append(events, ChainSideEvent{block})
1032-
1033-
case SplitStatTy:
1034-
events = append(events, ChainSplitEvent{block, logs})
10351031
}
10361032
stats.processed++
10371033
stats.usedGas += usedGas.Uint64()
@@ -1226,8 +1222,9 @@ func (self *BlockChain) postChainEvents(events []interface{}, logs []*types.Log)
12261222
self.eventMux.Post(logs)
12271223
for _, event := range events {
12281224
if event, ok := event.(ChainEvent); ok {
1229-
// We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long
1230-
// and in most cases isn't even necessary.
1225+
// We need some control over the mining operation. Acquiring locks and waiting
1226+
// for the miner to create new block takes too long and in most cases isn't
1227+
// even necessary.
12311228
if self.LastBlockHash() == event.Hash {
12321229
self.eventMux.Post(ChainHeadEvent{event.Block})
12331230
}

‎core/events.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ type RemovedTransactionEvent struct{ Txs types.Transactions }
4646
// RemovedLogEvent is posted when a reorg happens
4747
type RemovedLogsEvent struct{ Logs []*types.Log }
4848

49-
// ChainSplit is posted when a new head is detected
50-
type ChainSplitEvent struct {
51-
Block *types.Block
52-
Logs []*types.Log
53-
}
54-
5549
type ChainEvent struct {
5650
Block *types.Block
5751
Hash common.Hash

‎light/lightchain.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int)
377377
case core.SideStatTy:
378378
log.Debug("Inserted forked header", "number", header.Number, "hash", header.Hash())
379379
events = append(events, core.ChainSideEvent{Block: types.NewBlockWithHeader(header)})
380-
381-
case core.SplitStatTy:
382-
events = append(events, core.ChainSplitEvent{Block: types.NewBlockWithHeader(header)})
383380
}
384381
return err
385382
}

0 commit comments

Comments
 (0)