What if i change nBits to 0x2100ffff, will other nodes accept it? #18235

issue summer-wu opened this issue on March 1, 2020
  1. summer-wu commented at 4:17 PM on March 1, 2020: none

    If I change nBits to a hard code number 0x2100ffff ( change GetNextWorkRequired method, always return 0x2100ffff). The hashTarget will be ffff000000000000000000000000000000000000000000000000000000000000.

    This hashTarget means nealy every sha256 are valid! A slow PC can generate a block within a second, when I broadcast these blocks to other nodes, will they accept it ( treat it as a valid block)?

  2. summer-wu added the label Bug on Mar 1, 2020
  3. summer-wu renamed this:
    What if i change nBits to 0x2100ffff, will other node accept it?
    What if i change nBits to 0x2100ffff, will other nodes accept it?
    on Mar 1, 2020
  4. MarcoFalke commented at 8:32 PM on March 1, 2020: member

    No, they shouldn't.

    Usually the issue tracker is used to track technical issues related to the Bitcoin Core code base. Keep in mind that general bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange or the #bitcoin IRC channel on freenode.

  5. MarcoFalke closed this on Mar 1, 2020

  6. summer-wu commented at 8:05 AM on March 2, 2020: none

    I've found the code that reject these kind of attack.

    The source that I investigating is 9d2174b (tag: v0.3.1rc1)

    in main.cpp , in CBlock::AcceptBlock() wrote:

        // Check proof of work
        if (nBits != GetNextWorkRequired(pindexPrev))
            return error("AcceptBlock() : incorrect proof of work");
    
  7. MarcoFalke locked this on Feb 15, 2022
Labels

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-05-03 15:14 UTC

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