mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-27 17:26:43 +00:00

* [NOD-1413] Remove /cmd/addblock * [NOD-1413] Define and implement TransactionValidator. * [NOD-1413] Make changes to ConsensusStateManager's interface. * [NOD-1413] Make changes to PruningManager's interface. * [NOD-1413] Make changes to DAGTraversalManager's interface. * [NOD-1413] Make changes to MultisetStore's interface. * [NOD-1413] Make changes to UTXODiffStore's interface. * [NOD-1413] Make changes to UTXODiffStore's interface harder. * [NOD-1413] Make changes to AcceptanceDataStore's interface harder. * [NOD-1413] Make changes to PruningStore's interface. * [NOD-1413] Delete BlockIndex. * [NOD-1413] Add FeeDataStore. * [NOD-1413] Update BlockMessageStore's interface. * [NOD-1413] Fix interface violations. * [NOD-1413] Add FeeDataStore to BlockProcessor. * [NOD-1413] Make go vet happy. * [NOD-1413] Add missing fields to ConsensusStateChanges. * [NOD-1413] Add another missing field to ConsensusStateChanges. * [NOD-1413] Add a reference to blockStore in consensusStateManager. * [NOD-1413] Add missing methods to UTXODiffStore. * [NOD-1413] Rename pruningPointStore to pruningStore everywhere. * [NOD-1413] Remove superfluous parameters from CalculateConsensusStateChanges. * [NOD-1413] Add missing dependencies to PruningManager. * [NOD-1413] Remove implementation-y functions from TransactionValidator's interface. * [NOD-1413] Make go vet happy. * [NOD-1413] Add a couple of methods to DAGTopologyManager. * [NOD-1413] Fix a typo in a file name. * [NOD-1413] Remove non-interface functions from Validator.
42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
package dagtraversalmanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model"
|
|
)
|
|
|
|
// DAGTraversalManager exposes methods for travering blocks
|
|
// in the DAG
|
|
type DAGTraversalManager struct {
|
|
dagTopologyManager model.DAGTopologyManager
|
|
ghostdagManager model.GHOSTDAGManager
|
|
}
|
|
|
|
// New instantiates a new DAGTraversalManager
|
|
func New(
|
|
dagTopologyManager model.DAGTopologyManager,
|
|
ghostdagManager model.GHOSTDAGManager) *DAGTraversalManager {
|
|
return &DAGTraversalManager{
|
|
dagTopologyManager: dagTopologyManager,
|
|
ghostdagManager: ghostdagManager,
|
|
}
|
|
}
|
|
|
|
// BlockAtDepth returns the hash of the block that's at the
|
|
// given depth from the given highHash
|
|
func (dtm *DAGTraversalManager) BlockAtDepth(highHash *model.DomainHash, depth uint64) *model.DomainHash {
|
|
return nil
|
|
}
|
|
|
|
// SelectedParentIterator creates an iterator over the selected
|
|
// parent chain of the given highHash
|
|
func (dtm *DAGTraversalManager) SelectedParentIterator(highHash *model.DomainHash) model.SelectedParentIterator {
|
|
return nil
|
|
}
|
|
|
|
// ChainBlockAtBlueScore returns the hash of the smallest block
|
|
// with a blue score greater than the given blueScore in the
|
|
// virtual block's selected parent chain
|
|
func (dtm *DAGTraversalManager) ChainBlockAtBlueScore(blueScore uint64) *model.DomainHash {
|
|
return nil
|
|
}
|