mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-30 02:36:42 +00:00

* Add Close() function to all the iterators * Add defer iterator.Close() whenever we open an iterator * Add isClosed to all iterators and panic/return error if used after closing Co-authored-by: Svarog <feanorr@gmail.com>
12 lines
271 B
Go
12 lines
271 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// BlockIterator is an iterator over blocks according to some order.
|
|
type BlockIterator interface {
|
|
First() bool
|
|
Next() bool
|
|
Get() (*externalapi.DomainHash, error)
|
|
Close() error
|
|
}
|