Skip to content

Add option -alerts to opt out of alert system#6274

Merged
laanwj merged 1 commit intobitcoin:masterfrom
laanwj:2015_06_disable_alert
Jun 15, 2015
Merged

Add option -alerts to opt out of alert system#6274
laanwj merged 1 commit intobitcoin:masterfrom
laanwj:2015_06_disable_alert

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Jun 12, 2015

Make it possible to opt-out of the centralized alert system by providing an option -noalerts or -alerts=0. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by removing the alert system completely.

I intend to add this to the GUI options in another pull.

src/main.cpp Outdated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The check for fAlerts would be faster I guess? Why not place switch the checks? If we are talking about a DoS situation perhaps that could make things less ressource hungry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, yes, agreed (though in practice, if the short string comparison gives a DoS risk we'll have worse problems... so this is not really worth worrying about)

@jtimon
Copy link
Contributor

jtimon commented Jun 12, 2015

ut ACK

@paveljanik
Copy link
Contributor

&& fAlerts means that every incoming "alert" will log "Unknown command" when alerts disabled. Do you want it this way?

@laanwj
Copy link
Member Author

laanwj commented Jun 12, 2015

@paveljanik Yea - good catch, but I'm ok with that. This is effectively a way of saying that you don't acknowledge that the alert message is part of the P2P protocol. Also remember that "unknown message" will only appear with -debug=net.
(but it's easy enough to avoid if people prefer that...)

@rebroad
Copy link
Contributor

rebroad commented Jun 12, 2015

@laanwj I'd prefer it didn't treat "alert" as an unknown message, but instead logged it if debug=alert is set

@jgarzik
Copy link
Contributor

jgarzik commented Jun 12, 2015

ut ACK

Very odd - I thought this facility to disable alerts already existed. Apparently not. I was probably thinking of -alertnotify

The patch is fine as-is, though I can see the value of debug=alert versus debug=net too.

@laanwj
Copy link
Member Author

laanwj commented Jun 12, 2015

To log the alert in any sensible way, it'd have to be parsed (possibly even verified). That's exactly what I'm trying to avoid.

@sipa
Copy link
Member

sipa commented Jun 14, 2015

Untested ACK

Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of bitcoin#6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.
@laanwj laanwj force-pushed the 2015_06_disable_alert branch from aa00660 to 02a6702 Compare June 15, 2015 07:53
@laanwj laanwj merged commit 02a6702 into bitcoin:master Jun 15, 2015
laanwj added a commit that referenced this pull request Jun 15, 2015
02a6702 Add option `-alerts` to opt out of alert system (Wladimir J. van der Laan)
laanwj added a commit that referenced this pull request Jun 15, 2015
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.

Conflicts:
	src/init.cpp
	src/main.cpp

Github-Pull: #6274
Rebased-From: 02a6702
laanwj added a commit that referenced this pull request Jun 15, 2015
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.

Github-Pull: #6274
Rebased-From: 02a6702
@ABISprotocol
Copy link

Hello, question:

Since the following will have disabled alerts,
Bitcoin Core 0.13.1, 0.13.0, 0.12.1
Bitcoin Core 0.10.3, 0.11.x, and 0.12.x can disable alerts with -alerts=0
Armory 0.94.1+
how can a user view alerts if they want to view them (assuming that they are disabled in the software, but want to view an alert somewhere else)?

@dcousens
Copy link
Contributor

dcousens commented Nov 23, 2016

utACK 02a6702

@maflcko
Copy link
Member

maflcko commented Nov 26, 2016

how can a user view alerts if they want to view them

@ABISprotocol There won't be any other alerts than the final alert, so there is no reason to enable alerts as a user, other than for academic purposes. See https://bitcoin.org/en/alert/2016-11-01-alert-retirement

Please note that internal alerts, partition detection warnings and the -alertnotify option features remain according to #7692.

@maflcko
Copy link
Member

maflcko commented Nov 26, 2016

Regardless of that, please don't use year old pull request for help questions, which should go to bitcoin stackexchange instead.



else if (strCommand == "alert")
else if (fAlerts && strCommand == "alert")
Copy link
Contributor

@rebroad rebroad Dec 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause an "Unknown command" message to be logged if fAlerts is false, better to exit is strCommand == "alert" yet fAlerts is false (since "alert" is not an unknown command).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the code review, more than a year after the fact.

However this code has been ripped out already together with the alert logic, so it's no longer relevant.

@ABISprotocol
Copy link

Thanks for clarification.

@rubenscholfield
Copy link

rubenscholfield commented Jan 12, 2017

Hello,
Commander Scholfield here.

@rubenscholfield
Copy link

rubenscholfield commented Jan 12, 2017

OK, see you...

reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of bitcoin#6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.

Conflicts:
	src/init.cpp
	src/main.cpp

Github-Pull: bitcoin#6274
Rebased-From: 02a6702
(cherry picked from commit be64204)

# Conflicts:
#	src/main.cpp
#	src/main.h
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.