btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

blockchain+chaincfg: disable retargeting for regtest #1985

Closed guggero closed 1 year ago

guggero commented 1 year ago

This commit emulates the behavior of Bitcoin Core introduced in https://github.com/bitcoin/bitcoin/pull/6853 that disables retargeting of the required proof of work for regtest.

Attempts to fix https://github.com/lightninglabs/neutrino/pull/256 in a less hacky way (needs a PR in that repo as well after this one has been merged).

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5342782675


Files with Coverage Reduction New Missed Lines %
blockchain/difficulty.go 23 48.78%
<!-- Total: 23 -->
Totals Coverage Status
Change from base Build 5336862129: -0.04%
Covered Lines: 26644
Relevant Lines: 48251

💛 - Coveralls
kcalvinalvin commented 1 year ago

ACK cf802a019f992b07af5cfa279d196343bf0e00f4

Roasbeef commented 1 year ago

but I think the ship has sailed on this since it's what bitcoind does and apps like neutrino need to match.

FWIW simnet does do retargeting, so applications that depend on being able to replicate such behavior can use that in place.