mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Remove p2p alert leftovers (#3050)
* Drop ALERT debug category Was used for p2p alerts only * Drop `alert` p2p message handling in tests
This commit is contained in:
parent
0599d3a030
commit
929c892c05
@ -136,7 +136,7 @@ UniValue debug(const JSONRPCRequest& request)
|
|||||||
"Change debug category on the fly. Specify single category or use '+' to specify many.\n"
|
"Change debug category on the fly. Specify single category or use '+' to specify many.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"category\" (string, required) The name of the debug category to turn on. Can be one of the following:\n"
|
"1. \"category\" (string, required) The name of the debug category to turn on. Can be one of the following:\n"
|
||||||
" addrman, alert, bench, cmpctblock, coindb, db, http, leveldb, libevent, lock, mempool,\n"
|
" addrman, bench, cmpctblock, coindb, db, http, leveldb, libevent, lock, mempool,\n"
|
||||||
" mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, selectcoins, tor, zmq, dash\n"
|
" mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, selectcoins, tor, zmq, dash\n"
|
||||||
" (or specifically: chainlocks, gobject, instantsend, keepass, llmq, llmq-dkg, llmq-sigs,\n"
|
" (or specifically: chainlocks, gobject, instantsend, keepass, llmq, llmq-dkg, llmq-sigs,\n"
|
||||||
" mnpayments, mnsync, privatesend, spork).\n"
|
" mnpayments, mnsync, privatesend, spork).\n"
|
||||||
|
@ -277,7 +277,6 @@ const CLogCategoryDesc LogCategories[] =
|
|||||||
{BCLog::MNSYNC, "mnsync"},
|
{BCLog::MNSYNC, "mnsync"},
|
||||||
{BCLog::PRIVATESEND, "privatesend"},
|
{BCLog::PRIVATESEND, "privatesend"},
|
||||||
{BCLog::SPORK, "spork"},
|
{BCLog::SPORK, "spork"},
|
||||||
{BCLog::ALERT, "alert"},
|
|
||||||
//End Dash
|
//End Dash
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -136,7 +136,6 @@ namespace BCLog {
|
|||||||
MNSYNC = ((uint64_t)1 << 40),
|
MNSYNC = ((uint64_t)1 << 40),
|
||||||
PRIVATESEND = ((uint64_t)1 << 41),
|
PRIVATESEND = ((uint64_t)1 << 41),
|
||||||
SPORK = ((uint64_t)1 << 42),
|
SPORK = ((uint64_t)1 << 42),
|
||||||
ALERT = ((uint64_t)1 << 43),
|
|
||||||
//End Dash
|
//End Dash
|
||||||
|
|
||||||
ALL = ~(uint64_t)0,
|
ALL = ~(uint64_t)0,
|
||||||
|
@ -593,82 +593,6 @@ class CBlock(CBlockHeader):
|
|||||||
% (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,
|
% (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,
|
||||||
time.ctime(self.nTime), self.nBits, self.nNonce, repr(self.vtx))
|
time.ctime(self.nTime), self.nBits, self.nNonce, repr(self.vtx))
|
||||||
|
|
||||||
|
|
||||||
class CUnsignedAlert(object):
|
|
||||||
def __init__(self):
|
|
||||||
self.nVersion = 1
|
|
||||||
self.nRelayUntil = 0
|
|
||||||
self.nExpiration = 0
|
|
||||||
self.nID = 0
|
|
||||||
self.nCancel = 0
|
|
||||||
self.setCancel = []
|
|
||||||
self.nMinVer = 0
|
|
||||||
self.nMaxVer = 0
|
|
||||||
self.setSubVer = []
|
|
||||||
self.nPriority = 0
|
|
||||||
self.strComment = b""
|
|
||||||
self.strStatusBar = b""
|
|
||||||
self.strReserved = b""
|
|
||||||
|
|
||||||
def deserialize(self, f):
|
|
||||||
self.nVersion = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.nRelayUntil = struct.unpack("<q", f.read(8))[0]
|
|
||||||
self.nExpiration = struct.unpack("<q", f.read(8))[0]
|
|
||||||
self.nID = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.nCancel = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.setCancel = deser_int_vector(f)
|
|
||||||
self.nMinVer = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.nMaxVer = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.setSubVer = deser_string_vector(f)
|
|
||||||
self.nPriority = struct.unpack("<i", f.read(4))[0]
|
|
||||||
self.strComment = deser_string(f)
|
|
||||||
self.strStatusBar = deser_string(f)
|
|
||||||
self.strReserved = deser_string(f)
|
|
||||||
|
|
||||||
def serialize(self):
|
|
||||||
r = b""
|
|
||||||
r += struct.pack("<i", self.nVersion)
|
|
||||||
r += struct.pack("<q", self.nRelayUntil)
|
|
||||||
r += struct.pack("<q", self.nExpiration)
|
|
||||||
r += struct.pack("<i", self.nID)
|
|
||||||
r += struct.pack("<i", self.nCancel)
|
|
||||||
r += ser_int_vector(self.setCancel)
|
|
||||||
r += struct.pack("<i", self.nMinVer)
|
|
||||||
r += struct.pack("<i", self.nMaxVer)
|
|
||||||
r += ser_string_vector(self.setSubVer)
|
|
||||||
r += struct.pack("<i", self.nPriority)
|
|
||||||
r += ser_string(self.strComment)
|
|
||||||
r += ser_string(self.strStatusBar)
|
|
||||||
r += ser_string(self.strReserved)
|
|
||||||
return r
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "CUnsignedAlert(nVersion %d, nRelayUntil %d, nExpiration %d, nID %d, nCancel %d, nMinVer %d, nMaxVer %d, nPriority %d, strComment %s, strStatusBar %s, strReserved %s)" \
|
|
||||||
% (self.nVersion, self.nRelayUntil, self.nExpiration, self.nID,
|
|
||||||
self.nCancel, self.nMinVer, self.nMaxVer, self.nPriority,
|
|
||||||
self.strComment, self.strStatusBar, self.strReserved)
|
|
||||||
|
|
||||||
|
|
||||||
class CAlert(object):
|
|
||||||
def __init__(self):
|
|
||||||
self.vchMsg = b""
|
|
||||||
self.vchSig = b""
|
|
||||||
|
|
||||||
def deserialize(self, f):
|
|
||||||
self.vchMsg = deser_string(f)
|
|
||||||
self.vchSig = deser_string(f)
|
|
||||||
|
|
||||||
def serialize(self):
|
|
||||||
r = b""
|
|
||||||
r += ser_string(self.vchMsg)
|
|
||||||
r += ser_string(self.vchSig)
|
|
||||||
return r
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "CAlert(vchMsg.sz %d, vchSig.sz %d)" \
|
|
||||||
% (len(self.vchMsg), len(self.vchSig))
|
|
||||||
|
|
||||||
|
|
||||||
class PrefilledTransaction(object):
|
class PrefilledTransaction(object):
|
||||||
def __init__(self, index=0, tx = None):
|
def __init__(self, index=0, tx = None):
|
||||||
self.index = index
|
self.index = index
|
||||||
@ -1091,25 +1015,6 @@ class msg_addr(object):
|
|||||||
return "msg_addr(addrs=%s)" % (repr(self.addrs))
|
return "msg_addr(addrs=%s)" % (repr(self.addrs))
|
||||||
|
|
||||||
|
|
||||||
class msg_alert(object):
|
|
||||||
command = b"alert"
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.alert = CAlert()
|
|
||||||
|
|
||||||
def deserialize(self, f):
|
|
||||||
self.alert = CAlert()
|
|
||||||
self.alert.deserialize(f)
|
|
||||||
|
|
||||||
def serialize(self):
|
|
||||||
r = b""
|
|
||||||
r += self.alert.serialize()
|
|
||||||
return r
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "msg_alert(alert=%s)" % (repr(self.alert), )
|
|
||||||
|
|
||||||
|
|
||||||
class msg_inv(object):
|
class msg_inv(object):
|
||||||
command = b"inv"
|
command = b"inv"
|
||||||
|
|
||||||
@ -1667,7 +1572,6 @@ class NodeConnCB(object):
|
|||||||
self.connection = None
|
self.connection = None
|
||||||
|
|
||||||
def on_addr(self, conn, message): pass
|
def on_addr(self, conn, message): pass
|
||||||
def on_alert(self, conn, message): pass
|
|
||||||
def on_block(self, conn, message): pass
|
def on_block(self, conn, message): pass
|
||||||
def on_blocktxn(self, conn, message): pass
|
def on_blocktxn(self, conn, message): pass
|
||||||
def on_cmpctblock(self, conn, message): pass
|
def on_cmpctblock(self, conn, message): pass
|
||||||
@ -1776,7 +1680,6 @@ class NodeConn(asyncore.dispatcher):
|
|||||||
b"version": msg_version,
|
b"version": msg_version,
|
||||||
b"verack": msg_verack,
|
b"verack": msg_verack,
|
||||||
b"addr": msg_addr,
|
b"addr": msg_addr,
|
||||||
b"alert": msg_alert,
|
|
||||||
b"inv": msg_inv,
|
b"inv": msg_inv,
|
||||||
b"getdata": msg_getdata,
|
b"getdata": msg_getdata,
|
||||||
b"getblocks": msg_getblocks,
|
b"getblocks": msg_getblocks,
|
||||||
|
Loading…
Reference in New Issue
Block a user