Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1817,10 +1817,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []
}
block, err = it.next()
}
stats.queued += it.processed()
stats.ignored += it.remaining()

// If there are any still remaining, mark as ignored
return it.index, events, coalescedLogs, err

// First block (and state) is known
Expand All @@ -1839,7 +1835,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []

// Some other error occurred, abort
case err != nil:
stats.ignored += len(it.chain)
bc.reportBlock(block, nil, err)
return it.index, events, coalescedLogs, err
}
Expand Down Expand Up @@ -1944,10 +1939,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []
if err := bc.addFutureBlock(block); err != nil {
return it.index, events, coalescedLogs, err
}
stats.queued++
}
}
stats.ignored += it.remaining()

// Append a single chain head event if we've progressed the chain
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
Expand Down
21 changes: 4 additions & 17 deletions core/blockchain_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

// insertStats tracks and reports on block insertion.
type insertStats struct {
queued, processed, ignored int
usedGas uint64
lastIndex int
startTime mclock.AbsTime
processed, ignored int
usedGas uint64
lastIndex int
startTime mclock.AbsTime
}

// statsReportLimit is the time limit during import and export after which we
Expand Down Expand Up @@ -65,9 +65,6 @@ func (st *insertStats) report(chain []*types.Block, index int, cache common.Stor
}
context = append(context, []interface{}{"dirty", cache}...)

if st.queued > 0 {
context = append(context, []interface{}{"queued", st.queued}...)
}
if st.ignored > 0 {
context = append(context, []interface{}{"ignored", st.ignored}...)
}
Expand Down Expand Up @@ -154,13 +151,3 @@ func (it *insertIterator) previous() *types.Header {
func (it *insertIterator) first() *types.Block {
return it.chain[0]
}

// remaining returns the number of remaining blocks.
func (it *insertIterator) remaining() int {
return len(it.chain) - it.index
}

// processed returns the number of processed blocks.
func (it *insertIterator) processed() int {
return it.index + 1
}