This is a follow-up of D2442. It makes the number of bits to consider
for display in the "peer details" view a constant.
Details
- Reviewers
deadalnix jasonbcox - Group Reviewers
Restricted Project - Commits
- rSTAGINGa36c8cbcde44: Make the number service of service flag bits to display a constant
rABCa36c8cbcde44: Make the number service of service flag bits to display a constant
./src/qt/bitcoin-qt -prune=550 & mkdir /tmp/datadir ./src/qt/bitcoin-qt -datadir=/tmp/datadir -connect=127.0.0.1
In the second instance:
Go to "Help=>Debug window"
Select the tab "Peers"
Click the 127.0.0.1 peer in the upper table
Check in the details that the LIMITED flag is displayed
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/qt/guiutil.cpp | ||
---|---|---|
899 ↗ | (On Diff #7030) | Rather than having an arbitrary constant, we can make it dependent on the flag that we want to detect up to. Something like: // check is largest flag to detect up to uint64_t check = NODE_NETWORK_LIMITED; while (check != 0) { if (mask & check) { ... } check = check >> 1; } |
src/qt/guiutil.cpp | ||
---|---|---|
891 ↗ | (On Diff #7049) | Note: I reverted the loop direction from @jasonbcox proposal, in order to keep the same display ordering |
src/qt/guiutil.cpp | ||
---|---|---|
892 ↗ | (On Diff #7049) | Add a constant in the enum that indicate the end of the main services range. |
src/qt/guiutil.cpp | ||
---|---|---|
892 ↗ | (On Diff #7049) | While not for (uint64_t check = 1; check <= NODE_LAST_SERVICE_BIT; check <<= 1;) |
src/qt/guiutil.cpp | ||
---|---|---|
92 ↗ | (On Diff #7087) | No, put it in the enum with a value that define the end of the range that you want to be used for flag (I assume we don't want to display the experimental ones. It's not like this is performance critical and we want to shave off all we can from that loop. |
src/protocol.h | ||
---|---|---|
313 ↗ | (On Diff #7104) | No, put the actual value of the last possible flag. |
Set the constant as the last non experimental service bit.
No longer filter more than avoiding experimental bits.
src/qt/guiutil.cpp | ||
---|---|---|
891 ↗ | (On Diff #7237) | Really, if the maximum value is 1 << 23, I'm not sure we need a uint64_t |
src/protocol.h | ||
---|---|---|
313 ↗ | (On Diff #7237) | If you want to keep the same behavior, this should be (1 << 11), otherwise there will be a list of UNKNOWN for flags 11 to 23. If you think there is value in keeping this flag as 23, then please re-verify that this renders ok in the RPC console in bitcoin-qt. |
src/protocol.h | ||
---|---|---|
313 ↗ | (On Diff #7237) | I checked in BU and XT to see if they defined service flags above 1 << 10, and found none. |
src/protocol.h | ||
---|---|---|
313 ↗ | (On Diff #7237) | Fair. |