mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
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
|
// Get the block node at the previous retarget (targetTimespan days
|
||||||
// worth of blocks).
|
// worth of blocks).
|
||||||
firstNode := lastNode.RelativeAncestor(b.blocksPerRetarget)
|
blocksBack := b.blocksPerRetarget
|
||||||
if lastNode.height == 0 {
|
if blocksBack > lastNode.height {
|
||||||
firstNode = lastNode
|
blocksBack = lastNode.height
|
||||||
}
|
}
|
||||||
|
firstNode := lastNode.RelativeAncestor(blocksBack)
|
||||||
if firstNode == nil {
|
if firstNode == nil {
|
||||||
return 0, AssertError("unable to obtain previous retarget block")
|
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")
|
paramErr := fmt.Errorf("cannot use -wallet with -regtest, btcwallet not yet compatible with regtest")
|
||||||
return "", paramErr
|
return "", paramErr
|
||||||
} else {
|
} else {
|
||||||
defaultPort = "18334"
|
defaultPort = "29245"
|
||||||
}
|
}
|
||||||
case &chaincfg.SigNetParams:
|
case &chaincfg.SigNetParams:
|
||||||
if useWallet {
|
if useWallet {
|
||||||
|
|
Loading…
Add table
Reference in a new issue