1

I read everywhere that segwit2x activates at blocks 494784, around 15 or 16 of November.

I did just checkout the segwit2x codebase doing:

git clone https://github.com/btc1/bitcoin

And I can see that I'm on a branch called "segwit2x".

I tried to search every single file for any hint of block 494784, 494783 or 494785 but couldn't find anything.

I've got many technical questions regarding segwit2x and I wanted to dig into the source code to find answers.

Seen that I couldn't find anything, my first technical question is this one: where's the code related to block 494784 at which segwit2x is supposed to happen?

2

It is referenced relatively, namely by using the parameter BIP102HeightDelta. The hardfork is 3 months after the block that Segwit was actived and the number of blocks after is equal to 90(days)*144(blocks/day)(https://github.com/btc1/bitcoin/blob/385cbc994f35d36cefdab8c1c00ebfaceb55cfc6/src/chainparams.cpp#L78)

Try to look for that parameter. It will show up that it is used here to define if the 3 months have passed to activate 2MB or not (https://github.com/btc1/bitcoin/blob/385cbc994f35d36cefdab8c1c00ebfaceb55cfc6/src/validation.cpp#L2934 and https://github.com/btc1/bitcoin/blob/385cbc994f35d36cefdab8c1c00ebfaceb55cfc6/src/validation.cpp#L1853 and https://github.com/btc1/bitcoin/blob/385cbc994f35d36cefdab8c1c00ebfaceb55cfc6/src/consensus/consensus.h#L24).

  • ooooh gotcha +1: thank you very much... I was surprised I couldn't find anything but didn't realize they were using a computation starting from the original segwit! – Cedric Martin Oct 30 '17 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.