fix regtest difficulty
This commit is contained in:
parent
cee79f6635
commit
103ab86904
2 changed files with 5 additions and 4 deletions
|
@ -245,10 +245,11 @@ func (b *BlockChain) calcNextRequiredDifficulty(lastNode *blockNode, newBlockTim
|
|||
|
||||
// Get the block node at the previous retarget (targetTimespan days
|
||||
// worth of blocks).
|
||||
firstNode := lastNode.RelativeAncestor(b.blocksPerRetarget)
|
||||
if lastNode.height == 0 {
|
||||
firstNode = lastNode
|
||||
blocksBack := b.blocksPerRetarget
|
||||
if blocksBack > lastNode.height {
|
||||
blocksBack = lastNode.height
|
||||
}
|
||||
firstNode := lastNode.RelativeAncestor(blocksBack)
|
||||
if firstNode == nil {
|
||||
return 0, AssertError("unable to obtain previous retarget block")
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ func normalizeAddress(addr string, chain *chaincfg.Params, useWallet bool) (stri
|
|||
paramErr := fmt.Errorf("cannot use -wallet with -regtest, btcwallet not yet compatible with regtest")
|
||||
return "", paramErr
|
||||
} else {
|
||||
defaultPort = "18334"
|
||||
defaultPort = "29245"
|
||||
}
|
||||
case &chaincfg.SigNetParams:
|
||||
if useWallet {
|
||||
|
|
Loading…
Add table
Reference in a new issue