1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

BOLT 2: remove attempts to align signatures.

They're really a blob of bytes, and we weren't aligning them correctly in
two cases anyway.  This gets rid of gratuitous padding, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-11-29 12:58:13 +10:30
parent 351e0deda2
commit b228a2e77d
2 changed files with 3 additions and 4 deletions

View File

@ -198,7 +198,6 @@ signature, it will broadcast the funding transaction.
* [8:temporary-channel-id]
* [32:txid]
* [1:output-index]
* [1:pad]
* [64:signature]
#### Requirements
@ -735,7 +734,7 @@ The description of key derivation is in [BOLT #3](03-transactions.md#key-derivat
* [8:channel-id]
* [32:per-commitment-secret]
* [33:next-per-commitment-point]
* [3:padding]
* [1:padding]
* [2:num-htlc-timeouts]
* [num-htlc-timeouts*64:htlc-timeout-signature]

View File

@ -15,7 +15,7 @@ def guess_alignment(message,name,sizestr):
# - channel-id is size 8, but has alignment 4.
# - node_announcement.ipv6 has size 16, but alignment 4 (to align IPv4 addr).
# - node_announcement.alias is a string, so alignment 1
# - signatures have alignment 4, because why not.
# - signatures have no alignment requirement.
if match.group('name').startswith('pad'):
return 1
@ -29,7 +29,7 @@ def guess_alignment(message,name,sizestr):
return 1
if 'signature' in match.group('name'):
return 4
return 1
# Size can be variable.
try: