pool: alert.
This commit is contained in:
parent
1d55cd1b7e
commit
455dc027ee
@ -1221,16 +1221,31 @@ Pool.prototype._handleAlert = function _handleAlert(alert, peer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (now >= alert.relayUntil || now >= alert.expiration) {
|
||||
this.logger.warning('Peer sent an expired alert packet (%s).', peer.hostname);
|
||||
if (now >= alert.expiration) {
|
||||
this.logger.warning(
|
||||
'Peer sent an expired alert packet (%s).',
|
||||
peer.hostname);
|
||||
this.logger.debug(alert);
|
||||
return;
|
||||
}
|
||||
|
||||
if (alert.id === 0x7fffffff) {
|
||||
if (!(alert.expiration === 0x7fffffff
|
||||
&& alert.cancel === 0x7fffffff - 1
|
||||
&& alert.minVer === 0
|
||||
&& alert.maxVer === 0x7fffffff
|
||||
&& alert.subVers.length === 0
|
||||
&& alert.priority === 0x7fffffff
|
||||
&& alert.statusBar === 'URGENT: Alert key compromised, upgrade required')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.warning('Received alert from peer (%s).', peer.hostname);
|
||||
this.logger.warning(alert);
|
||||
|
||||
this.sendAlert(alert);
|
||||
if (now < alert.relayUntil)
|
||||
this.sendAlert(alert);
|
||||
|
||||
this.emit('alert', alert, peer);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user