Class AlertMessage

Alerts are signed messages that are broadcast on the peer-to-peer network if they match a hard-coded signing key.
The private keys are held by a small group of core Bitcoin developers, and alerts may be broadcast in the event of
an available upgrade or a serious network problem. Alerts have an expiration time, data that specifies what
set of software versions it matches and the ability to cancel them by broadcasting another type of alert.

The right course of action on receiving an alert is usually to either ensure a human will see it (display on screen,
log, email), or if you decide to use alerts for notifications that are specific to your app in some way, to parse it.
For example, you could treat it as an upgrade notification specific to your app. Satoshi designed alerts to ensure
that software upgrades could be distributed independently of a hard-coded website, in order to allow everything to
be purely peer-to-peer. You don't have to use this of course, and indeed it often makes more sense not to.

setExpiration

getId

public long getId()

The numeric identifier of this alert. Each alert should have a unique ID, but the signer can choose any number.
If an alert is broadcast with a cancel field higher than this ID, this alert is considered cancelled.

Returns:

uint32

setId

public void setId(long id)

getCancel

public long getCancel()

A marker that results in any alerts with an ID lower than this value to be considered cancelled.

Returns:

uint32

setCancel

public void setCancel(long cancel)

getMinVer

public long getMinVer()

The inclusive lower bound on software versions that are considered for the purposes of this alert. Bitcoin Core
compares this against a protocol version field, but as long as the subVer field is used to restrict it your
alerts could use any version numbers.

Returns:

uint32

setMinVer

public void setMinVer(long minVer)

getMaxVer

public long getMaxVer()

The inclusive upper bound on software versions considered for the purposes of this alert. Bitcoin Core
compares this against a protocol version field, but as long as the subVer field is used to restrict it your
alerts could use any version numbers.