Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Coding Enthusiast on October 12, 2020, 03:41:25 PM



Title: Why was the 6th ServiceFlags bit skipped?
Post by: Coding Enthusiast on October 12, 2020, 03:41:25 PM
The ServiceFlags enum is jumping from the previously defined 5th bit (1 << 4 ie XThin) to 7th bit (1 << 6 ie CompactFilters). I couldn't find the 6th bit ever being set in the history of protocol.h file so is there any reason for this jump?

https://github.com/bitcoin/bitcoin/blob/af22322dab1a2277483b2512723491a5fad1a606/src/protocol.h#L268-L302


Title: Re: Why was the 6th ServiceFlags bit skipped?
Post by: achow101 on October 12, 2020, 03:51:54 PM
It's because both Bcash and Segwit2x occupied some service bits to indicate their own forks while they were still able to connect to Bitcoin nodes.

Bcash was using bit 6, and Segwit2x was using bit 8. Both bits thus needed to be skipped for some time to avoid collisions. See https://github.com/bitcoin/bitcoin/pull/10982