diff --git a/blockchain/difficulty.go b/blockchain/difficulty.go index 2f16e2e5..051998ba 100644 --- a/blockchain/difficulty.go +++ b/blockchain/difficulty.go @@ -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") } diff --git a/cmd/lbcctl/config.go b/cmd/lbcctl/config.go index bab6bb18..b2f77447 100644 --- a/cmd/lbcctl/config.go +++ b/cmd/lbcctl/config.go @@ -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 {