Permalink
Browse files

src/init.cpp: Add -advertise2x option, for NODE_xxx optionality

  • Loading branch information...
jgarzik committed Sep 27, 2017
1 parent 44af0aa commit 28ebbdb1f4ab632a1500b2c412a157839608fed0
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/init.cpp
@@ -72,6 +72,7 @@ static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_DISABLE_SAFEMODE = false;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
static const bool DEFAULT_PREFPEERING = true;
static const bool DEFAULT_ADVERTISE_2X = true;

std::unique_ptr<CConnman> g_connman;
std::unique_ptr<PeerLogicValidation> peerLogic;
@@ -488,6 +489,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), DEFAULT_ACCEPT_DATACARRIER));
strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY));
strUsage += HelpMessageOpt("-prefpeering", strprintf(_("Preferential peering with segwit2x (and segwit) nodes (default: %u)"), DEFAULT_PREFPEERING));
strUsage += HelpMessageOpt("-advertise2x", strprintf(_("Advertise on network as a segwit2x-compatible node (default: %u)"), DEFAULT_ADVERTISE_2X));
strUsage += HelpMessageOpt("-mempoolreplacement", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT));
strUsage += HelpMessageOpt("-minrelaytxfee=<amt>", strprintf(_("Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)"),
CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE)));
@@ -1079,7 +1081,8 @@ bool AppInitParameterInteraction()
nMaxDatacarrierBytes = gArgs.GetArg("-datacarriersize", nMaxDatacarrierBytes);

// Advertise as segwit2x node
nLocalServices = ServiceFlags(nLocalServices | NODE_SEGWIT2X);
if (gArgs.GetBoolArg("-advertise2x", DEFAULT_ADVERTISE_2X))
nLocalServices = ServiceFlags(nLocalServices | NODE_SEGWIT2X);

// Prefer peers with compatible rulesets
if (gArgs.GetBoolArg("-prefpeering", DEFAULT_PREFPEERING)) {

12 comments on commit 28ebbdb

@lra

This comment has been minimized.

Copy link

lra replied Oct 4, 2017

This commit officially makes segwit2x a trojan horse as it allows anyone to run 2x nodes in disguise. Now core needs to find a new way to detect and ban your nodes.

@dooglus

This comment has been minimized.

Copy link

dooglus replied Oct 4, 2017

What have you done with the old jgarzik and how much will it cost us to buy him back?

@lichtamberg

This comment has been minimized.

Copy link

lichtamberg replied Oct 4, 2017

@jgarzik

This commit is a pure shame for 2X and for all 2x supporting companies.
Intentionally trying to disrupt the bitcoin network will have consequences and in a lot of states you will be held accountable by law for this attack.

I can only encourage every single B2X supporter to drop the support of B2X right now, before you will be part of a crime and have to face legal actions against you and everyone who is involved in this attack.

@arisAlexis

This comment has been minimized.

Copy link

arisAlexis replied Oct 4, 2017

@jgarzik this is tragic. bitcoin is about consensus not covert war tactics. this is open source software and masking clients to trick other open source software is just not OK by any community standards.

@neelamnaveen86

This comment has been minimized.

Copy link

neelamnaveen86 replied Oct 4, 2017

is anyone planning on reverting this commit back to the way it was so that all can go back and sleep in peace.

@GrumpyKiitty

This comment has been minimized.

Copy link

GrumpyKiitty replied Oct 4, 2017

@lra This commit officially makes Garzik both corrupt and malicious. He should be ashamed of himself; an example of true cancer to Bitcoin.

@Gaspa79

This comment has been minimized.

Copy link

Gaspa79 replied Oct 4, 2017

Anyone with an educated opinion knows this is 100% unethical and is aware that the excuse "we want to download the blockchain from high-bandwidth core clients before and after the fork" is not true at all.

If you needed to download the blockchain from core clients then that means that 2X has already failed due to a lack of adoption at that point, and disguising it won't change that. If there's adoption then you don't need this anyway.

This might cause things to get messy until the first >1MB block (non-witness data) gets mined as well. Up till now I thought the 2X fork was trying to be ethical and had good intentions in mind even with no replay protection, but this is the straw that broke the camel's back for me.

@monxas

This comment has been minimized.

Copy link

monxas replied Oct 4, 2017

That's how you can tell there is consensus for their hard-fork; Because they have to hide their nodes.

@Logerfo

This comment has been minimized.

Copy link

Logerfo replied Oct 4, 2017

I didn't realize the hate on 2X until this commit. Thanks for spoiling it!

@monxas

This comment has been minimized.

Copy link

monxas replied Oct 4, 2017

@Logerfo Thing is, this updates is to hide segwit2x support. it's just full on attack to BTC. Why hide your intentions if you're legit?

@Logerfo

This comment has been minimized.

Copy link

Logerfo replied Oct 4, 2017

@monxas I think I was not clear: I didn't realize the reason for the hate. You're right, now I do.

@jgarzik

This comment has been minimized.

Copy link

jgarzik replied Oct 4, 2017

This is a privacy feature. See discussion at PR #109 for more.

This feature defaults to advertise (privacy=off).

Users may optionally disable advertising (privacy=on).

There is historical precedent with Internet browsers: https://stackoverflow.com/questions/7975996/why-does-internet-explorer-9-report-mozilla-in-useragent

Users also rightly requested privacy features like this due to past attacks:

Bitcoin Core violated the Robustness Principle as described in RFC 1122 and elsewhere. https://tools.ietf.org/html/rfc1122

Please sign in to comment.