mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-25 08:16:46 +00:00
21 lines
860 B
Go
21 lines
860 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// ReachabilityManager maintains a structure that allows to answer
|
|
// reachability queries in sub-linear time
|
|
type ReachabilityManager interface {
|
|
AddBlock(blockHash *externalapi.DomainHash) error
|
|
IsReachabilityTreeAncestorOf(blockHashA *externalapi.DomainHash, blockHashB *externalapi.DomainHash) (bool, error)
|
|
IsDAGAncestorOf(blockHashA *externalapi.DomainHash, blockHashB *externalapi.DomainHash) (bool, error)
|
|
UpdateReindexRoot(selectedTip *externalapi.DomainHash) error
|
|
}
|
|
|
|
// TestReachabilityManager adds to the main ReachabilityManager methods required by tests
|
|
type TestReachabilityManager interface {
|
|
ReachabilityManager
|
|
SetReachabilityReindexWindow(reindexWindow uint64)
|
|
SetReachabilityReindexSlack(reindexSlack uint64)
|
|
ReachabilityReindexSlack() uint64
|
|
}
|