Closed amanzag closed 1 year ago
Are you able to reproduce the same thing w/ simnet? IIRC, I think btcd will do difficulty retargets for regtest, while bitcoind never does. This is what historically led to the creation of simnet (which does the retargets).
I think you're right. I can't reproduce with simnet and that's probably because I'm running neutrino against a bitcoind which, as you say, doesn't do retargets, as can be seen here: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L407
Shouldn't btcd/neutrino disable retargets for regtest as well?
I created a pull request https://github.com/lightninglabs/neutrino/pull/256 that fixes the issue. It's probably not the right way of fixing it, but if you point me in the right direction I can change it.
bitcoind
was refactored a bit, the fPowNoRetargeting
field can now be found here: https://github.com/bitcoin/bitcoin/blob/e695d8536e534f1e59de4a62a0d87a93e7a73456/src/kernel/chainparams.cpp#L415
Whenever I try to use neutrino in regtest mode, I run into this error:
There must be some flaw in the difficulty calculation logic here: https://github.com/lightninglabs/neutrino/blob/master/blockmanager.go#L2795-L2834
Related issue (but I think it belongs here): https://github.com/btcsuite/btcd/issues/1819