@@ -259,6 +259,25 @@ def msg_ser(self, f):
259259 def __repr__ (self ):
260260 return "msg_getdata(inv=%s)" % (repr (self .inv ))
261261
262+ class msg_notfound (MsgSerializable ):
263+ command = b"notfound"
264+
265+ def __init__ (self , protover = PROTO_VERSION ):
266+ super (msg_notfound , self ).__init__ (protover )
267+ self .inv = []
268+
269+ @classmethod
270+ def msg_deser (cls , f , protover = PROTO_VERSION ):
271+ c = cls ()
272+ c .inv = VectorSerializer .stream_deserialize (CInv , f )
273+ return c
274+
275+ def msg_ser (self , f ):
276+ VectorSerializer .stream_serialize (CInv , self .inv , f )
277+
278+ def __repr__ (self ):
279+ return "msg_notfound(inv=%s)" % (repr (self .inv ))
280+
262281
263282class msg_getblocks (MsgSerializable ):
264283 command = b"getblocks"
@@ -423,6 +442,32 @@ def __repr__(self):
423442 return "msg_pong(0x%x)" % (self .nonce ,)
424443
425444
445+ class msg_reject (MsgSerializable ):
446+ command = b"reject"
447+
448+ def __init__ (self , protover = PROTO_VERSION ):
449+ super (msg_reject , self ).__init__ (protover )
450+ self .message = b'(Message Unitialized)'
451+ self .ccode = b'\0 '
452+ self .reason = b'(Reason Unitialized)'
453+
454+ @classmethod
455+ def msg_deser (cls , f , protover = PROTO_VERSION ):
456+ c = cls ()
457+ c .message = VarStringSerializer .stream_deserialize (f )
458+ c .ccode = struct .unpack (b"<c" , ser_read (f ,1 ))[0 ]
459+ c .reason = VarStringSerializer .stream_deserialize (f )
460+ return c
461+
462+ def msg_ser (self , f ):
463+ VarStringSerializer .stream_serialize (self .message , f )
464+ f .write (struct .pack (b"<c" , self .ccode ))
465+ VarStringSerializer .stream_serialize (self .reason , f )
466+
467+ def __repr__ (self ):
468+ return "msg_reject(messsage=%s, ccode=%s, reason=%s)" % (self .message , self .ccode , self .reason )
469+
470+
426471class msg_mempool (MsgSerializable ):
427472 command = b"mempool"
428473
@@ -440,9 +485,9 @@ def __repr__(self):
440485 return "msg_mempool()"
441486
442487msg_classes = [msg_version , msg_verack , msg_addr , msg_alert , msg_inv ,
443- msg_getdata , msg_getblocks , msg_getheaders ,
488+ msg_getdata , msg_notfound , msg_getblocks , msg_getheaders ,
444489 msg_headers , msg_tx , msg_block , msg_getaddr , msg_ping ,
445- msg_pong , msg_mempool ]
490+ msg_pong , msg_reject , msg_mempool ]
446491
447492messagemap = {}
448493for cls in msg_classes :
0 commit comments