What Does "Activation" Actually Mean In Bitcoin?
However Segwit is a complex upgrade to Bitcoin so there must be many places where changes are made to Bitcoin for Segwit - so how many such "if" blocks are there ?


As of writing, there are 23 to 34 places where behavior changes based on whether segwit is active, depending on how you count. (e.g. if you pass a boolean to a function, and that function contains an if, and the function return value is passed to another if, is that 1 or 2 if statements?)

If you have a copy of the repository you can find them with the following commands:


grep -RI "SEGWIT" * | grep THRESHOLD_ACTIVE
grep -RI "fPreSegWit" *
grep -RI "IsWitnessEnabled" *
grep -RI "fWitnessEnabled" *
grep -RI "witnessEnabled" *