core: use headers only where blocks are unnecessary

This commit is contained in:
Péter Szilágyi
2019-03-13 12:31:35 +02:00
parent b87a68407b
commit 4f457859a2
5 changed files with 11 additions and 11 deletions

View File

@ -111,12 +111,12 @@ func (it *insertIterator) next() (*types.Block, error) {
return it.chain[it.index], it.validator.ValidateBody(it.chain[it.index])
}
// previous returns the previous block was being processed, or nil
func (it *insertIterator) previous() *types.Block {
// previous returns the previous header that was being processed, or nil.
func (it *insertIterator) previous() *types.Header {
if it.index < 1 {
return nil
}
return it.chain[it.index-1]
return it.chain[it.index-1].Header()
}
// first returns the first block in the it.