mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
gen: move an error check to catch all instances of failure
`m` might not be set on the optional set as well, so move this check down so that we now encompass both codepaths
This commit is contained in:
parent
48078f7572
commit
e8a10b019d
@ -1252,8 +1252,6 @@ for line in fileinput.input(options.files):
|
||||
# eg commit_sig,0,channel-id,8 OR
|
||||
# commit_sig,0,channel-id,u64
|
||||
m = find_message(messages + subtypes, parts[0])
|
||||
if m is None:
|
||||
raise ValueError('Unknown message or subtype {}'.format(parts[0]))
|
||||
elif len(parts) == 5:
|
||||
# eg.
|
||||
# channel_reestablish,48,your_last_per_commitment_secret,32,option209
|
||||
@ -1261,6 +1259,8 @@ for line in fileinput.input(options.files):
|
||||
else:
|
||||
raise ValueError('Line {} malformed'.format(line.rstrip()))
|
||||
|
||||
if m is None:
|
||||
raise ValueError('Unknown message or subtype {}'.format(parts[0]))
|
||||
f = Field(m.name, parts[2], parts[3], comments, prevfield, includes)
|
||||
m.addField(f)
|
||||
# If it used prevfield as lenvar, keep that for next
|
||||
|
Loading…
Reference in New Issue
Block a user