mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-24 07:46:45 +00:00

* [NOD-1475] Add Stage, Discard, and Commit methods to all stores. * [NOD-1475] Simplify interfaces for processes. * [NOD-1475] Fix GHOSTDAGManager. * [NOD-1475] Simplify ChooseSelectedParent. * [NOD-1475] Remove errors from Stage functions. * [NOD-1475] Add IsStaged to all data structures. * [NOD-1475] Remove isDisqualified from CalculateConsensusStateChanges. * [NOD-1475] Add dependency from ConsensusStateManager to BlockStatusStore. * [NOD-1475] Fix a comment. * [NOD-1475] Add ReachabilityReindexRoot to reachabilityDataStore. * [NOD-1475] Fix a comment. * [NOD-1475] Rename IsStaged to IsAnythingStaged.
25 lines
691 B
Go
25 lines
691 B
Go
package difficultymanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model"
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// DifficultyManager provides a method to resolve the
|
|
// difficulty value of a block
|
|
type difficultyManager struct {
|
|
ghostdagManager model.GHOSTDAGManager
|
|
}
|
|
|
|
// New instantiates a new DifficultyManager
|
|
func New(ghostdagManager model.GHOSTDAGManager) model.DifficultyManager {
|
|
return &difficultyManager{
|
|
ghostdagManager: ghostdagManager,
|
|
}
|
|
}
|
|
|
|
// RequiredDifficulty returns the difficulty required for some block
|
|
func (dm *difficultyManager) RequiredDifficulty(blockHash *externalapi.DomainHash) (uint32, error) {
|
|
return 0, nil
|
|
}
|