Fix bug in RequiredDifficulty and release another version

This commit is contained in:
Elichai Turkel 2021-11-25 21:49:15 +02:00
parent dbf18d8052
commit 606b781ca0
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
5 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ import (
const (
leveldbCacheSizeMiB = 256
defaultDataDirname = "datadir"
defaultDataDirname = "datadir2"
)
var desiredLimits = &limits.DesiredLimits{

View File

@ -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.

View File

@ -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 {

View File

@ -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()

View File

@ -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