Bitcoin Forum
May 30, 2024, 06:35:38 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: how to disable segwit in my build?  (Read 678 times)
danda (OP)
Full Member
***
Offline Offline

Activity: 201
Merit: 157


View Profile WWW
July 12, 2017, 11:03:43 PM
 #1

I tried to ask this on bitcoin-dev list yesterday, but it seems to be stuck in moderation limbo, so I thought I'd ask here.

------

Hi!

Up to now, I have purposefully been running bitcoin releases prior to
0.13.1 as a way to avoid the (possible) segwit activation, at least
until such time as I personally am comfortable with it.

At this time, I would like to have some of the more recent features, but
without the possibility that my node will activate segwit, until I
choose to.

As I understand it, there is not any user setting that can disable
segwit from activating on my node.  If there was, I would use it.
Please correct me if wrong.

I am here to ask what is the simplest code change (fewest LOC changed) I
can make to 0.14.2+ code that would disable segwit from activating and
keep my node acting just like a legacy node with regards to consensus
rules, even if/when the rest of the network activates segwit.

I think, more generally, the same question applies to most any Bip9
versionbits feature.

I'm not looking for reasons NOT to do it, only HOW to do it without
unwanted side-effects.  My first untested idea is just to change the
segwit nTimeout in chainparams.cpp to a date in the past.  But I figured
I should ask the experts first.   

thanks.


ps: full disclosure:  I may be the only one who wants this, but if
successful, I do plan to release my changes in case someone else wishes
to run with status-quo consensus rules.



mybitprices.info - wallet auditing   |  hd-wallet-derive - derive keys locally |  hd-wallet-addrs - find used addrs
lightning-nodes - list of LN nodes  |  coinparams - params for 300+ alts  |  jsonrpc-cli - cli jsonrpc client
subaddress-derive-xmr - monero offline wallet tool
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3402
Merit: 6659


Just writing some code


View Profile WWW
July 12, 2017, 11:23:55 PM
Last edit: July 13, 2017, 07:02:11 AM by achow101
 #2

There are two lines that you want to change: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L100 and the line after it (101). Change those two lines so that the time is just 0 and that will disable segwit for your build.

Edit: Do this at your own risk. There may be unintended consequences of doing so as 0.13.1+ was designed without any segwit disabling capabilities in mind. You may end up partitioning yourself from nodes that will give you blocks in the non-segwit format.

danda (OP)
Full Member
***
Offline Offline

Activity: 201
Merit: 157


View Profile WWW
July 12, 2017, 11:53:14 PM
 #3

There are two lines that you want to change: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L100 and the line after it (101). Change those two lines so that the time is just 0 and that will disable segwit for your build.

awesome.  That is what I was thinking after peeking at the code, but i wanted to be certain.   thanks!

mybitprices.info - wallet auditing   |  hd-wallet-derive - derive keys locally |  hd-wallet-addrs - find used addrs
lightning-nodes - list of LN nodes  |  coinparams - params for 300+ alts  |  jsonrpc-cli - cli jsonrpc client
subaddress-derive-xmr - monero offline wallet tool
Quickseller
Copper Member
Legendary
*
Offline Offline

Activity: 2884
Merit: 2327


View Profile
July 13, 2017, 04:32:58 AM
 #4

Here is the relevant portion of the response that u/nullc aka gmaxwell sent in response to your inquiry:

Quote from: gmaxwell
It is not simple to do so correctly, I couldn't tell you off the top
of my head; a number of things must be changed it isn't as simple as
disabling the activiation because of the segwit P2P changes.  Nor is
it a supported configuration. Even if it were now, it wouldn't be one
we'd continue to support in the future after segwit is active, as
we're likely to drop deployment/compat code.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 13, 2017, 11:36:46 AM
 #5

keep my node acting just like a legacy node with regards to consensus
rules, even if/when the rest of the network activates segwit.

I think the simplest way to do it is to set protocol flags (version & services) to the value of 0.12.x client
https://en.bitcoin.it/wiki/Protocol_documentation#version

Edit: Do this at your own risk.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!