mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-22 23:07:04 +00:00

* Add selected chain store and optimize block locator with it * Fix build error * Fix comments * Fix IsStaged * Rename CalculateSelectedParentChainChanges to CalculateChainPath and SelectedParentChainChanges->SelectedChainPath * Use binary.LittleEndian directly to allow compiler optimizations * Remove boolean from HeadersSelectedChainStore interface * Prevent endless loop in block locator
19 lines
941 B
Go
19 lines
941 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// DAGTraversalManager exposes methods for traversing blocks
|
|
// in the DAG
|
|
type DAGTraversalManager interface {
|
|
BlockAtDepth(highHash *externalapi.DomainHash, depth uint64) (*externalapi.DomainHash, error)
|
|
LowestChainBlockAboveOrEqualToBlueScore(highHash *externalapi.DomainHash, blueScore uint64) (*externalapi.DomainHash, error)
|
|
SelectedParentIterator(highHash *externalapi.DomainHash) BlockIterator
|
|
SelectedChildIterator(highHash, lowHash *externalapi.DomainHash) (BlockIterator, error)
|
|
AnticoneFromContext(context, lowHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error)
|
|
BlueWindow(highHash *externalapi.DomainHash, windowSize int) ([]*externalapi.DomainHash, error)
|
|
NewDownHeap() BlockHeap
|
|
NewUpHeap() BlockHeap
|
|
CalculateChainPath(
|
|
fromBlockHash, toBlockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error)
|
|
}
|