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

* Unite all reachability stores * Upgrade script * Fix tests * Add UpdateReindexRoot to RebuildReachability * Use dbTx when deleting reachability stores * Use ghostdagDataWithoutPrunedBlocks when rebuilding reachability * Use next tree ancestor wherever possible and avoid finality point search if the block is too close to pruning point * Address the boundary case where the pruning point becomes the finality point * some minor fixes * Remove RebuildReachability and use manual syncing between old and new consensus for migration * Remove sanity test (it failed when tips where not in the same order) Co-authored-by: msutton <mikisiton2@gmail.com>
16 lines
843 B
Go
16 lines
843 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// ReachabilityDataStore represents a store of ReachabilityData
|
|
type ReachabilityDataStore interface {
|
|
Store
|
|
StageReachabilityData(stagingArea *StagingArea, blockHash *externalapi.DomainHash, reachabilityData ReachabilityData)
|
|
StageReachabilityReindexRoot(stagingArea *StagingArea, reachabilityReindexRoot *externalapi.DomainHash)
|
|
IsStaged(stagingArea *StagingArea) bool
|
|
ReachabilityData(dbContext DBReader, stagingArea *StagingArea, blockHash *externalapi.DomainHash) (ReachabilityData, error)
|
|
HasReachabilityData(dbContext DBReader, stagingArea *StagingArea, blockHash *externalapi.DomainHash) (bool, error)
|
|
ReachabilityReindexRoot(dbContext DBReader, stagingArea *StagingArea) (*externalapi.DomainHash, error)
|
|
Delete(dbContext DBWriter) error
|
|
}
|