@@ -2345,6 +2345,41 @@ def __repr__(self):
2345
2345
(self .nVersion , repr (self .inputs ), self .txid , self .cycleHash )
2346
2346
2347
2347
2348
+ class msg_platformban :
2349
+ __slots__ = ("protx_hash" , "requested_height" , "quorum_hash" , "sig" )
2350
+ msgtype = b"platformban"
2351
+
2352
+ def __init__ (self , protx_hash = 0 , requested_height = 0 , quorum_hash = 0 , sig = b'\x00 ' * 96 ):
2353
+ self .protx_hash = protx_hash
2354
+ self .requested_height = requested_height
2355
+ self .quorum_hash = quorum_hash
2356
+ self .sig = sig
2357
+
2358
+ def deserialize (self , f ):
2359
+ self .protx_hash = deser_uint256 (f )
2360
+ self .requested_height = struct .unpack ("<I" , f .read (4 ))[0 ]
2361
+ self .quorum_hash = deser_uint256 (f )
2362
+ self .sig = f .read (96 )
2363
+
2364
+ def serialize (self ):
2365
+ r = b""
2366
+ r += ser_uint256 (self .protx_hash )
2367
+ r += struct .pack ("<I" , self .requested_height )
2368
+ r += ser_uint256 (self .quorum_hash )
2369
+ r += self .sig
2370
+ return r
2371
+
2372
+ def calc_sha256 (self ):
2373
+ r = b""
2374
+ r += ser_uint256 (self .protx_hash )
2375
+ r += struct .pack ("<I" , self .requested_height )
2376
+ return uint256_from_str (hash256 (r ))
2377
+
2378
+ def __repr__ (self ):
2379
+ return "msg_platformban(protx_hash=%064x requested_height=%d, quorum_hash=%064x)" % \
2380
+ (self .protx_hash , self .requested_height , self .quorum_hash )
2381
+
2382
+
2348
2383
class msg_qsigshare :
2349
2384
__slots__ = ("sig_shares" ,)
2350
2385
msgtype = b"qsigshare"
0 commit comments