@@ -946,7 +946,7 @@ def __repr__(self):
946
946
class msg_version :
947
947
__slots__ = ("addrFrom" , "addrTo" , "nNonce" , "nRelay" , "nServices" ,
948
948
"nStartingHeight" , "nTime" , "nVersion" , "strSubVer" )
949
- command = b"version"
949
+ msgtype = b"version"
950
950
951
951
def __init__ (self ):
952
952
self .nVersion = MY_VERSION
@@ -1004,7 +1004,7 @@ def __repr__(self):
1004
1004
1005
1005
class msg_verack :
1006
1006
__slots__ = ()
1007
- command = b"verack"
1007
+ msgtype = b"verack"
1008
1008
1009
1009
def __init__ (self ):
1010
1010
pass
@@ -1021,7 +1021,7 @@ def __repr__(self):
1021
1021
1022
1022
class msg_addr :
1023
1023
__slots__ = ("addrs" ,)
1024
- command = b"addr"
1024
+ msgtype = b"addr"
1025
1025
1026
1026
def __init__ (self ):
1027
1027
self .addrs = []
@@ -1038,7 +1038,7 @@ def __repr__(self):
1038
1038
1039
1039
class msg_inv :
1040
1040
__slots__ = ("inv" ,)
1041
- command = b"inv"
1041
+ msgtype = b"inv"
1042
1042
1043
1043
def __init__ (self , inv = None ):
1044
1044
if inv is None :
@@ -1058,7 +1058,7 @@ def __repr__(self):
1058
1058
1059
1059
class msg_getdata :
1060
1060
__slots__ = ("inv" ,)
1061
- command = b"getdata"
1061
+ msgtype = b"getdata"
1062
1062
1063
1063
def __init__ (self , inv = None ):
1064
1064
self .inv = inv if inv is not None else []
@@ -1075,7 +1075,7 @@ def __repr__(self):
1075
1075
1076
1076
class msg_getblocks :
1077
1077
__slots__ = ("locator" , "hashstop" )
1078
- command = b"getblocks"
1078
+ msgtype = b"getblocks"
1079
1079
1080
1080
def __init__ (self ):
1081
1081
self .locator = CBlockLocator ()
@@ -1099,7 +1099,7 @@ def __repr__(self):
1099
1099
1100
1100
class msg_tx :
1101
1101
__slots__ = ("tx" ,)
1102
- command = b"tx"
1102
+ msgtype = b"tx"
1103
1103
1104
1104
def __init__ (self , tx = CTransaction ()):
1105
1105
self .tx = tx
@@ -1123,7 +1123,7 @@ def serialize(self):
1123
1123
1124
1124
class msg_block :
1125
1125
__slots__ = ("block" ,)
1126
- command = b"block"
1126
+ msgtype = b"block"
1127
1127
1128
1128
def __init__ (self , block = None ):
1129
1129
if block is None :
@@ -1142,12 +1142,12 @@ def __repr__(self):
1142
1142
1143
1143
1144
1144
# for cases where a user needs tighter control over what is sent over the wire
1145
- # note that the user must supply the name of the command , and the data
1145
+ # note that the user must supply the name of the msgtype , and the data
1146
1146
class msg_generic :
1147
- __slots__ = ("command " , "data" )
1147
+ __slots__ = ("msgtype " , "data" )
1148
1148
1149
- def __init__ (self , command , data = None ):
1150
- self .command = command
1149
+ def __init__ (self , msgtype , data = None ):
1150
+ self .msgtype = msgtype
1151
1151
self .data = data
1152
1152
1153
1153
def serialize (self ):
@@ -1165,7 +1165,7 @@ def serialize(self):
1165
1165
1166
1166
class msg_getaddr :
1167
1167
__slots__ = ()
1168
- command = b"getaddr"
1168
+ msgtype = b"getaddr"
1169
1169
1170
1170
def __init__ (self ):
1171
1171
pass
@@ -1182,7 +1182,7 @@ def __repr__(self):
1182
1182
1183
1183
class msg_ping :
1184
1184
__slots__ = ("nonce" ,)
1185
- command = b"ping"
1185
+ msgtype = b"ping"
1186
1186
1187
1187
def __init__ (self , nonce = 0 ):
1188
1188
self .nonce = nonce
@@ -1201,7 +1201,7 @@ def __repr__(self):
1201
1201
1202
1202
class msg_pong :
1203
1203
__slots__ = ("nonce" ,)
1204
- command = b"pong"
1204
+ msgtype = b"pong"
1205
1205
1206
1206
def __init__ (self , nonce = 0 ):
1207
1207
self .nonce = nonce
@@ -1220,7 +1220,7 @@ def __repr__(self):
1220
1220
1221
1221
class msg_mempool :
1222
1222
__slots__ = ()
1223
- command = b"mempool"
1223
+ msgtype = b"mempool"
1224
1224
1225
1225
def __init__ (self ):
1226
1226
pass
@@ -1237,7 +1237,7 @@ def __repr__(self):
1237
1237
1238
1238
class msg_notfound :
1239
1239
__slots__ = ("vec" , )
1240
- command = b"notfound"
1240
+ msgtype = b"notfound"
1241
1241
1242
1242
def __init__ (self , vec = None ):
1243
1243
self .vec = vec or []
@@ -1254,7 +1254,7 @@ def __repr__(self):
1254
1254
1255
1255
class msg_sendheaders :
1256
1256
__slots__ = ()
1257
- command = b"sendheaders"
1257
+ msgtype = b"sendheaders"
1258
1258
1259
1259
def __init__ (self ):
1260
1260
pass
@@ -1275,7 +1275,7 @@ def __repr__(self):
1275
1275
# hash_stop (hash of last desired block header, 0 to get as many as possible)
1276
1276
class msg_getheaders :
1277
1277
__slots__ = ("hashstop" , "locator" ,)
1278
- command = b"getheaders"
1278
+ msgtype = b"getheaders"
1279
1279
1280
1280
def __init__ (self ):
1281
1281
self .locator = CBlockLocator ()
@@ -1301,7 +1301,7 @@ def __repr__(self):
1301
1301
# <count> <vector of block headers>
1302
1302
class msg_headers :
1303
1303
__slots__ = ("headers" ,)
1304
- command = b"headers"
1304
+ msgtype = b"headers"
1305
1305
1306
1306
def __init__ (self , headers = None ):
1307
1307
self .headers = headers if headers is not None else []
@@ -1322,7 +1322,7 @@ def __repr__(self):
1322
1322
1323
1323
class msg_merkleblock :
1324
1324
__slots__ = ("merkleblock" ,)
1325
- command = b"merkleblock"
1325
+ msgtype = b"merkleblock"
1326
1326
1327
1327
def __init__ (self , merkleblock = None ):
1328
1328
if merkleblock is None :
@@ -1342,7 +1342,7 @@ def __repr__(self):
1342
1342
1343
1343
class msg_filterload :
1344
1344
__slots__ = ("data" , "nHashFuncs" , "nTweak" , "nFlags" )
1345
- command = b"filterload"
1345
+ msgtype = b"filterload"
1346
1346
1347
1347
def __init__ (self , data = b'00' , nHashFuncs = 0 , nTweak = 0 , nFlags = 0 ):
1348
1348
self .data = data
@@ -1371,7 +1371,7 @@ def __repr__(self):
1371
1371
1372
1372
class msg_filteradd :
1373
1373
__slots__ = ("data" )
1374
- command = b"filteradd"
1374
+ msgtype = b"filteradd"
1375
1375
1376
1376
def __init__ (self , data ):
1377
1377
self .data = data
@@ -1390,7 +1390,7 @@ def __repr__(self):
1390
1390
1391
1391
class msg_filterclear :
1392
1392
__slots__ = ()
1393
- command = b"filterclear"
1393
+ msgtype = b"filterclear"
1394
1394
1395
1395
def __init__ (self ):
1396
1396
pass
@@ -1407,7 +1407,7 @@ def __repr__(self):
1407
1407
1408
1408
class msg_feefilter :
1409
1409
__slots__ = ("feerate" ,)
1410
- command = b"feefilter"
1410
+ msgtype = b"feefilter"
1411
1411
1412
1412
def __init__ (self , feerate = 0 ):
1413
1413
self .feerate = feerate
@@ -1426,7 +1426,7 @@ def __repr__(self):
1426
1426
1427
1427
class msg_sendcmpct :
1428
1428
__slots__ = ("announce" , "version" )
1429
- command = b"sendcmpct"
1429
+ msgtype = b"sendcmpct"
1430
1430
1431
1431
def __init__ (self ):
1432
1432
self .announce = False
@@ -1448,7 +1448,7 @@ def __repr__(self):
1448
1448
1449
1449
class msg_cmpctblock :
1450
1450
__slots__ = ("header_and_shortids" ,)
1451
- command = b"cmpctblock"
1451
+ msgtype = b"cmpctblock"
1452
1452
1453
1453
def __init__ (self , header_and_shortids = None ):
1454
1454
self .header_and_shortids = header_and_shortids
@@ -1468,7 +1468,7 @@ def __repr__(self):
1468
1468
1469
1469
class msg_getblocktxn :
1470
1470
__slots__ = ("block_txn_request" ,)
1471
- command = b"getblocktxn"
1471
+ msgtype = b"getblocktxn"
1472
1472
1473
1473
def __init__ (self ):
1474
1474
self .block_txn_request = None
@@ -1488,7 +1488,7 @@ def __repr__(self):
1488
1488
1489
1489
class msg_blocktxn :
1490
1490
__slots__ = ("block_transactions" ,)
1491
- command = b"blocktxn"
1491
+ msgtype = b"blocktxn"
1492
1492
1493
1493
def __init__ (self ):
1494
1494
self .block_transactions = BlockTransactions ()
0 commit comments