Пример #1
0
 def parse_tlv2(self, tlv):
     cltv_expiry, remainder, err = Namespace.pop_tu32(tlv.l, tlv.v)
     if err:
         return None, err
     if len(remainder) != 0:
         return None, "unexpected remaining bytes"
     return {'tlv_type_name': "tlv2", 'cltv_expiry': cltv_expiry}, None
Пример #2
0
 def parse_outgoing_cltv_value(tlv):
     outgoing_cltv_value, remainder, err = Namespace.pop_tu32(tlv.l, tlv.v)
     if err:
         return None, err
     if len(remainder) != 0:
         return None, "unexpected remaining bytes"
     return {
         'tlv_type_name': 'outgoing_cltv_value',
         'outgoing_cltv_value': outgoing_cltv_value
     }, None