-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable retargeting on regtest to preserve compatibility with bitcoind #256
Conversation
@@ -2736,6 +2736,11 @@ func (b *blockManager) checkHeaderSanity(blockHeader *wire.BlockHeader, | |||
func (b *blockManager) calcNextRequiredDifficulty(newBlockTime time.Time, | |||
reorgAttempt bool) (uint32, error) { | |||
|
|||
// bitcoind doesn't do retargeting on regtest, we do the same to ensure compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit hacky indeed... bitcoind
solved it by adding another boolean to the chain params: https://github.com/bitcoin/bitcoin/blob/e695d8536e534f1e59de4a62a0d87a93e7a73456/src/kernel/chainparams.cpp#L415
Perhaps we should do the same in btcd
? Then we could solve it for both Neutrino and btcd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be straightforward since blockManagerCfg has the params stored.
For reference: https://github.com/bitcoin/bitcoin/pull/6853/files
Would you be able to tweak this PR like that @amanzag? Thanks so much for addressing this inconsistency with bitcoind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR up in btcd
that can be re-used here once merged: btcsuite/btcd#1985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, Great!
No description provided.