Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
The definition of enum BlockStatus has a bug #10813
Comments
|
In what way is this a bug? Bitwise OR'ing an odd number (except for 1) means that you are setting multiple bits, not just one bit. That is not a problem as BLOCK_VALID_MASK is just a bit mask for all of the bits that must be set for a block to be valid. The same effect would be achieved by not including BLOCK_VALID_TRANSACTIONS in the bitwise OR since BLOCK_VALID_HEADER and BLOCK_VALID_TREE already set bits 1 and 2. But having BLOCK_VALID_TRANSACTIONS there is not wrong and makes it easier for people to understand what enums are part of BLOCK_VALID_MASK. |
|
Agree with @achow101 - it seems you misunderstand bitwise operations. If this is really a bug, please describe how it affects the behavior of the software (and don't ignore those questions in the template!) |
zhoushouchang commentedJul 13, 2017
This issue tracker is only for technical issues related to bitcoin-core.
General bitcoin questions and/or support requests and are best directed to the Bitcoin StackExchange.
For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.
Describe the issue
Can you reliably reproduce the issue?
If so, please list the steps to reproduce below:
1.BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS |
BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS,
2.This is a bit or operation,so every element must be 1, 2, 4, 8, ...,but BLOCK_VALID_TRANSACTIONS = 3
3.
Expected behaviour
Tell us what should happen
Actual behaviour
Tell us what happens instead
Screenshots.
If the issue is related to the GUI, screenshots can be added to this issue via drag & drop.
What version of bitcoin-core are you using?
List the version number/commit ID, and if it is an official binary, self compiled or a distribution package such as PPA.
Machine specs:
Any extra information that might be useful in the debugging process.
This is normally the contents of a
debug.logorconfig.logfile. Raw text or a link to a pastebin type site are preferred.