Skip to content

Conversation

@kallewoof
Copy link
Contributor

Currently the system uses the hard coded parameters for mainnet, which gives weird results for non-mainnet nets (e.g. testnet). This pulls the Params().GetConsensus().powLimit and uses that instead.

@kallewoof kallewoof closed this Jan 20, 2017
@kallewoof kallewoof reopened this Jan 20, 2017
@kallewoof kallewoof force-pushed the getdifficulty-use-net-params branch from cbd2ea8 to c60ed72 Compare January 20, 2017 09:10
@morcos
Copy link
Contributor

morcos commented Jan 20, 2017

testnet actually has the same powLimit as mainnet, so this would change results only on regtest, but doesn't it make more sense for difficulty to always reference the same minimum value and regtest just allows it to go less than 1?

@kallewoof
Copy link
Contributor Author

Hm, I didn't realize that (testnet had same powLimit as mainnet). I do know that when running on an experimental network with a different pow limit we got very weird values which go against the comment about being a factor of minimum difficulty. I guess it comes down to, "do we care about that case?"

@luke-jr
Copy link
Member

luke-jr commented Jan 20, 2017

NACK, let's not try to redefine difficulty for each network. It's okay if some networks might have <1 difficulties.

@sipa
Copy link
Member

sipa commented Jan 20, 2017

I believe that in the first testnet iteration, at least in some versions of the software, the powLimit was defined as 2x higher than the mainnet one, and 1 testnet difficulty corresponded to 0.5 mainnet difficulty in hashrate. It was pretty confusing, and I think it's indeed easier to just everywhere treat 1 difficulty as 4295032833 hashes.

@kallewoof kallewoof closed this Jan 23, 2017
@kallewoof kallewoof deleted the getdifficulty-use-net-params branch October 17, 2019 09:01
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants