mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
Update to new spec: differentiate channel_id and short_channel_id.
The spec 4af8e1841151f0c6e8151979d6c89d11839b2f65 uses a 32-byte 'channel-id' field, not to be confused with the 8-byte short ID used by gossip. Rename appropriately, and update to the new handshake protocol. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -21,8 +21,10 @@ class FieldType(object):
|
||||
def _typesize(typename):
|
||||
if typename == 'pad':
|
||||
return 1
|
||||
elif typename == 'struct channel_id':
|
||||
elif typename == 'struct short_channel_id':
|
||||
return 8
|
||||
elif typename == 'struct channel_id':
|
||||
return 32
|
||||
elif typename == 'struct ipv6':
|
||||
return 16
|
||||
elif typename == 'secp256k1_ecdsa_signature':
|
||||
@@ -104,6 +106,9 @@ class Field(object):
|
||||
if fieldname.startswith('pad'):
|
||||
return FieldType('pad')
|
||||
|
||||
if fieldname.endswith('short_channel_id'):
|
||||
return FieldType('struct short_channel_id')
|
||||
|
||||
if fieldname.endswith('channel_id'):
|
||||
return FieldType('struct channel_id')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user