Ultraprune + testnet + setgenerate RPC command problem #1946

issue Diapolo opened this issue on October 22, 2012
  1. Diapolo commented at 7:17 AM on October 22, 2012: none

    I'm using an own build containing the new Ultraprune patch on Windows 7. While doing some tests with it, I observed a strange thing.

    • start Bitcoin-Qt
    • while it syncs the block chain enter RPC console
    • enter setgenerate true
    • a block was foundm (Client did not yet catch up) and the client now displays Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.

    I can't tell if this is a problem of the internal miner (@gmaxwell said it has some errors in) or a problem that raised after Ultraprune though.

  2. Diapolo commented at 7:22 AM on October 22, 2012: none

    The problem persists even after re-starting the client and doing a -rescan.

    I was connected only via Tor while testing this, so could it be that my mined block was not broadcasted or via too less nodes (I'm no pro on that part of Bitcoin, sorry if this makes no sense)?

  3. Diapolo commented at 8:21 AM on October 22, 2012: none

    In addition I was now able to reproduce the following error with the same test condition as described above: assertion problem

  4. sipa commented at 10:54 AM on October 22, 2012: member

    Can you try moving the line 'CBlockIndex* pindexPrev = pindexBest;' in CreateNewBlock to inside the large block that is headed by 'LOCK2(cs_main, mempool.cs);' (right below that LOCK2)

  5. Diapolo commented at 11:02 AM on October 22, 2012: none

    Yes, I'll try again with the above applied.

  6. Diapolo commented at 1:17 PM on October 22, 2012: none

    I was still able to get the Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade. message, an assertion did not occur anymore ... but I need more time testing this.

    Not sure if that message is related to Ultraprune, perhaps I'll take the official 0.7.1 client an fire up the same test scenario.

  7. sipa commented at 1:24 PM on October 22, 2012: member

    When connecting a block fails, its work amount is written as bad. When this happens because of an wrong reason, you should restart with a clean datadir, as the warning will remain (until the chain catches up at least).

  8. sipa commented at 1:29 PM on October 22, 2012: member

    Actually, you shouldn't be able to mine at all during IBD. I'm sure this bug existed before ultraprune, but the resulting assertion failure is probably new.

  9. Diapolo commented at 2:07 PM on October 22, 2012: none

    @sipa What do you think about adding this into the setgenerate RPC call?

    <pre> if (vNodes.empty()) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!"); if (IsInitialBlockDownload()) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks..."); </pre>

    This check is also uses IN the threads itself, but when adding this to the RPC command we prevent spawning 4 threads that just idle and perhaps even prevent block-generation happening in some other weird situations (that currently happen, because I was able to mine a block while beeing on IBD), which causes further problems.

    So start the mining threads for RPC call only when connected and not in IBD (explicit usage) and still alow the old behavior, when using -gen (as you most likely want to start mining, when the client is ready here - implicit usage).

    I was not able to reproduce the assertion again, so your idea seems to have fixed that one! You think it was a locking problem?

    Edit: Do you thing it makes sense to create a pull for your assert fix here or is that obsolete with your last patches to master?

  10. Diapolo closed this on Nov 20, 2012

  11. KolbyML referenced this in commit 98c6183d72 on Dec 5, 2020
  12. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me