mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-30 18:56:41 +00:00

* [NOD-1417] Implement reachability * [NOD-1417] Rename package name * [NOD-1417] Add UpdateReindexRoot to interface api * [NOD-1417] Remove redundant type * [NOD-1417] Rename reachabilityTreeManager/reachabilityTree to reachabilityManager * [NOD-1417] Fix typo * [NOD-1417] Remove redundant copyright message * [NOD-1417] Fix comment
13 lines
562 B
Go
13 lines
562 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// ReachabilityTree maintains a structure that allows to answer
|
|
// reachability queries in sub-linear time
|
|
type ReachabilityTree 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
|
|
}
|