Code Monkey home page Code Monkey logo

Comments (5)

romanz avatar romanz commented on June 12, 2024 1

electrs is also using initialblockdownload (and is behaving similarly annoying with stale regtest chains), perhaps @romanz has some insight on how that compares to using headers == blocks?

Yes, handling regtest "staleness" indeed an issue...
I think that the solution in 49dc380 should work well.

from bwt.

shesek avatar shesek commented on June 12, 2024

This is happening because bitcoind considers itself in IBD when no new blocks were received for more than nMaxTipAge. Generating a new block should get it out of IBD mode. (previously also brought up in #35 (comment))

I'm not sure what's the right way to handle this. We could check for headers == blocks instead (I actually have this commented out in the code), but this might have unintended consequences, as you mentioned. IsInitialBlockDownload does a bunch more checks that may be necessary.

electrs is also using initialblockdownload (and is behaving similarly annoying with stale regtest chains), perhaps @romanz has some insight on how that compares to using headers == blocks?

One option that seems safe is keeping the current check for non-regtest chains, and using headers == blocks for regtest only.

from bwt.

shesek avatar shesek commented on June 12, 2024

One option that seems safe is keeping the current check for non-regtest chains, and using headers == blocks for regtest only.

I went ahead and implemented that in 49dc380. @justinmoon Can you confirm this works for you as intended?

from bwt.

shesek avatar shesek commented on June 12, 2024

Thanks @romanz!

from bwt.

justinmoon avatar justinmoon commented on June 12, 2024

I haven't tested this, but I wrote the exact same code locally a few days ago and it fixed it. This looks good.

from bwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.