mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-01 19:56:45 +00:00

* Add BlockHash optional parameter to EstimateNetworkBlockHashesPerSecond * Allow to pass '-' for optional values in kaspactl * Solve a division-by-zero in estimateNetworkHashesPerSecond * Add BlockHash to toAppMessage/fromAppMessage functions * Rename: topHash -> StartHash * Return proper error message if provided startHash doesn't deserialize into a hash
14 lines
528 B
Go
14 lines
528 B
Go
package model
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// DifficultyManager provides a method to resolve the
|
|
// difficulty value of a block
|
|
type DifficultyManager interface {
|
|
StageDAADataAndReturnRequiredDifficulty(stagingArea *StagingArea, blockHash *externalapi.DomainHash) (uint32, error)
|
|
RequiredDifficulty(stagingArea *StagingArea, blockHash *externalapi.DomainHash) (uint32, error)
|
|
EstimateNetworkHashesPerSecond(startHash *externalapi.DomainHash, windowSize int) (uint64, error)
|
|
}
|