mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-22 14:56:44 +00:00

* Replace blueScore with blueWork in ghostDAG SelectedParent selection * Add blueWork to protopuf ghostdag data * Auto generate protobuf go code * Serialize/Deserialize blueWork when converting to protobuf * pass block header store to ghostdagmanager * Convert tal's ghostdag2 implementation to blueWork * Change finality test to check the blueWork instead of blueScore * Update ghostdag_test to pass blockHeaderStore to ghostdag, and test all networks genesis headers * Add sanity blueWork check to ghostdag_test
32 lines
848 B
Go
32 lines
848 B
Go
package ghostdagmanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model"
|
|
)
|
|
|
|
// ghostdagManager resolves and manages GHOSTDAG block data
|
|
type ghostdagManager struct {
|
|
databaseContext model.DBReader
|
|
dagTopologyManager model.DAGTopologyManager
|
|
ghostdagDataStore model.GHOSTDAGDataStore
|
|
headerStore model.BlockHeaderStore
|
|
k model.KType
|
|
}
|
|
|
|
// New instantiates a new GHOSTDAGManager
|
|
func New(
|
|
databaseContext model.DBReader,
|
|
dagTopologyManager model.DAGTopologyManager,
|
|
ghostdagDataStore model.GHOSTDAGDataStore,
|
|
headerStore model.BlockHeaderStore,
|
|
k model.KType) model.GHOSTDAGManager {
|
|
|
|
return &ghostdagManager{
|
|
databaseContext: databaseContext,
|
|
dagTopologyManager: dagTopologyManager,
|
|
ghostdagDataStore: ghostdagDataStore,
|
|
headerStore: headerStore,
|
|
k: k,
|
|
}
|
|
}
|