mirror of https://github.com/status-im/op-geth.git
core, light: delete SplitStatTy, ChainSplitEvent (unused)
This commit is contained in:
parent
d2fda73ad7
commit
7b2fc0643f
|
@ -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) {
|
||||||
|
|
||||||
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)
|
||||||
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})
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue