Skip to content

Commit 929c892

Browse files
authored
Remove p2p alert leftovers (#3050)
* Drop ALERT debug category Was used for p2p alerts only * Drop `alert` p2p message handling in tests
1 parent 0599d3a commit 929c892

File tree

4 files changed

+1
-100
lines changed

4 files changed

+1
-100
lines changed

src/rpc/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ UniValue debug(const JSONRPCRequest& request)
136136
"Change debug category on the fly. Specify single category or use '+' to specify many.\n"
137137
"\nArguments:\n"
138138
"1. \"category\" (string, required) The name of the debug category to turn on. Can be one of the following:\n"
139-
" addrman, alert, bench, cmpctblock, coindb, db, http, leveldb, libevent, lock, mempool,\n"
139+
" addrman, bench, cmpctblock, coindb, db, http, leveldb, libevent, lock, mempool,\n"
140140
" mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, selectcoins, tor, zmq, dash\n"
141141
" (or specifically: chainlocks, gobject, instantsend, keepass, llmq, llmq-dkg, llmq-sigs,\n"
142142
" mnpayments, mnsync, privatesend, spork).\n"

src/util.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ const CLogCategoryDesc LogCategories[] =
277277
{BCLog::MNSYNC, "mnsync"},
278278
{BCLog::PRIVATESEND, "privatesend"},
279279
{BCLog::SPORK, "spork"},
280-
{BCLog::ALERT, "alert"},
281280
//End Dash
282281

283282
};

src/util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ namespace BCLog {
136136
MNSYNC = ((uint64_t)1 << 40),
137137
PRIVATESEND = ((uint64_t)1 << 41),
138138
SPORK = ((uint64_t)1 << 42),
139-
ALERT = ((uint64_t)1 << 43),
140139
//End Dash
141140

142141
ALL = ~(uint64_t)0,

test/functional/test_framework/mininode.py

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -593,82 +593,6 @@ def __repr__(self):
593593
% (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,
594594
time.ctime(self.nTime), self.nBits, self.nNonce, repr(self.vtx))
595595

596-
597-
class CUnsignedAlert(object):
598-
def __init__(self):
599-
self.nVersion = 1
600-
self.nRelayUntil = 0
601-
self.nExpiration = 0
602-
self.nID = 0
603-
self.nCancel = 0
604-
self.setCancel = []
605-
self.nMinVer = 0
606-
self.nMaxVer = 0
607-
self.setSubVer = []
608-
self.nPriority = 0
609-
self.strComment = b""
610-
self.strStatusBar = b""
611-
self.strReserved = b""
612-
613-
def deserialize(self, f):
614-
self.nVersion = struct.unpack("<i", f.read(4))[0]
615-
self.nRelayUntil = struct.unpack("<q", f.read(8))[0]
616-
self.nExpiration = struct.unpack("<q", f.read(8))[0]
617-
self.nID = struct.unpack("<i", f.read(4))[0]
618-
self.nCancel = struct.unpack("<i", f.read(4))[0]
619-
self.setCancel = deser_int_vector(f)
620-
self.nMinVer = struct.unpack("<i", f.read(4))[0]
621-
self.nMaxVer = struct.unpack("<i", f.read(4))[0]
622-
self.setSubVer = deser_string_vector(f)
623-
self.nPriority = struct.unpack("<i", f.read(4))[0]
624-
self.strComment = deser_string(f)
625-
self.strStatusBar = deser_string(f)
626-
self.strReserved = deser_string(f)
627-
628-
def serialize(self):
629-
r = b""
630-
r += struct.pack("<i", self.nVersion)
631-
r += struct.pack("<q", self.nRelayUntil)
632-
r += struct.pack("<q", self.nExpiration)
633-
r += struct.pack("<i", self.nID)
634-
r += struct.pack("<i", self.nCancel)
635-
r += ser_int_vector(self.setCancel)
636-
r += struct.pack("<i", self.nMinVer)
637-
r += struct.pack("<i", self.nMaxVer)
638-
r += ser_string_vector(self.setSubVer)
639-
r += struct.pack("<i", self.nPriority)
640-
r += ser_string(self.strComment)
641-
r += ser_string(self.strStatusBar)
642-
r += ser_string(self.strReserved)
643-
return r
644-
645-
def __repr__(self):
646-
return "CUnsignedAlert(nVersion %d, nRelayUntil %d, nExpiration %d, nID %d, nCancel %d, nMinVer %d, nMaxVer %d, nPriority %d, strComment %s, strStatusBar %s, strReserved %s)" \
647-
% (self.nVersion, self.nRelayUntil, self.nExpiration, self.nID,
648-
self.nCancel, self.nMinVer, self.nMaxVer, self.nPriority,
649-
self.strComment, self.strStatusBar, self.strReserved)
650-
651-
652-
class CAlert(object):
653-
def __init__(self):
654-
self.vchMsg = b""
655-
self.vchSig = b""
656-
657-
def deserialize(self, f):
658-
self.vchMsg = deser_string(f)
659-
self.vchSig = deser_string(f)
660-
661-
def serialize(self):
662-
r = b""
663-
r += ser_string(self.vchMsg)
664-
r += ser_string(self.vchSig)
665-
return r
666-
667-
def __repr__(self):
668-
return "CAlert(vchMsg.sz %d, vchSig.sz %d)" \
669-
% (len(self.vchMsg), len(self.vchSig))
670-
671-
672596
class PrefilledTransaction(object):
673597
def __init__(self, index=0, tx = None):
674598
self.index = index
@@ -1091,25 +1015,6 @@ def __repr__(self):
10911015
return "msg_addr(addrs=%s)" % (repr(self.addrs))
10921016

10931017

1094-
class msg_alert(object):
1095-
command = b"alert"
1096-
1097-
def __init__(self):
1098-
self.alert = CAlert()
1099-
1100-
def deserialize(self, f):
1101-
self.alert = CAlert()
1102-
self.alert.deserialize(f)
1103-
1104-
def serialize(self):
1105-
r = b""
1106-
r += self.alert.serialize()
1107-
return r
1108-
1109-
def __repr__(self):
1110-
return "msg_alert(alert=%s)" % (repr(self.alert), )
1111-
1112-
11131018
class msg_inv(object):
11141019
command = b"inv"
11151020

@@ -1667,7 +1572,6 @@ def on_close(self, conn):
16671572
self.connection = None
16681573

16691574
def on_addr(self, conn, message): pass
1670-
def on_alert(self, conn, message): pass
16711575
def on_block(self, conn, message): pass
16721576
def on_blocktxn(self, conn, message): pass
16731577
def on_cmpctblock(self, conn, message): pass
@@ -1776,7 +1680,6 @@ class NodeConn(asyncore.dispatcher):
17761680
b"version": msg_version,
17771681
b"verack": msg_verack,
17781682
b"addr": msg_addr,
1779-
b"alert": msg_alert,
17801683
b"inv": msg_inv,
17811684
b"getdata": msg_getdata,
17821685
b"getblocks": msg_getblocks,

0 commit comments

Comments
 (0)