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
14 lines
484 B
Go
14 lines
484 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// HeadersSelectedChainStore represents a store of the headers selected chain
|
|
type HeadersSelectedChainStore interface {
|
|
Store
|
|
Stage(dbContext DBReader,
|
|
chainChanges *externalapi.SelectedChainPath) error
|
|
IsStaged() bool
|
|
GetIndexByHash(dbContext DBReader, blockHash *externalapi.DomainHash) (uint64, error)
|
|
GetHashByIndex(dbContext DBReader, index uint64) (*externalapi.DomainHash, error)
|
|
}
|