mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Fix bug in RequiredDifficulty and release another version
This commit is contained in:
parent
dbf18d8052
commit
606b781ca0
@ -22,7 +22,7 @@ import (
|
||||
|
||||
const (
|
||||
leveldbCacheSizeMiB = 256
|
||||
defaultDataDirname = "datadir"
|
||||
defaultDataDirname = "datadir2"
|
||||
)
|
||||
|
||||
var desiredLimits = &limits.DesiredLimits{
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
const (
|
||||
// ProtocolVersion is the latest protocol version this package supports.
|
||||
ProtocolVersion uint32 = 2
|
||||
ProtocolVersion uint32 = 3
|
||||
|
||||
// DefaultServices describes the default services that are supported by
|
||||
// the server.
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
|
||||
// maxProtocolVersion version is the maximum supported protocol
|
||||
// version this kaspad node supports
|
||||
const maxProtocolVersion = 1
|
||||
const maxProtocolVersion = 3
|
||||
|
||||
// Peer holds data about a peer.
|
||||
type Peer struct {
|
||||
|
@ -112,7 +112,7 @@ func (dm *difficultyManager) requiredDifficultyFromTargetsWindow(targetsWindow b
|
||||
// We could instead clamp the timestamp difference to `targetTimePerBlock`,
|
||||
// but then everything will cancel out and we'll get the target from the last block, which will be the same as genesis.
|
||||
// We add 64 as a safety margin
|
||||
if len(targetsWindow) < 2 || len(targetsWindow) < dm.difficultyAdjustmentWindowSize + 64 {
|
||||
if len(targetsWindow) < 2 || len(targetsWindow) < dm.difficultyAdjustmentWindowSize {
|
||||
return dm.genesisBits, nil
|
||||
}
|
||||
windowMinTimestamp, windowMaxTimeStamp, windowsMinIndex, _ := targetsWindow.minMaxTimestamps()
|
||||
|
@ -11,7 +11,7 @@ const validCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs
|
||||
const (
|
||||
appMajor uint = 0
|
||||
appMinor uint = 11
|
||||
appPatch uint = 5
|
||||
appPatch uint = 6
|
||||
)
|
||||
|
||||
// appBuild is defined as a variable so it can be overridden during the build
|
||||
|
Loading…
x
Reference in New Issue
Block a user