wire: update to latest version of the spec.

The main change here is that the previously-optional open/accept
fields and reestablish fields are now compulsory (everyone was
including them anyway).  In fact, the open/accept is a TLV
because it was actually the same format.

For more details, see lightning-rfc/f068dd0d8dfa5ae75feedd99f269e23be4777381

Changelog-Removed: protocol: support for optioned form of reestablish messages now compulsory.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-06-22 14:36:03 +09:30
committed by Christian Decker
parent a66415a43e
commit 93d04d08d0
18 changed files with 123 additions and 164 deletions

View File

@@ -64,7 +64,7 @@ size_t bigsize_get(const u8 *p, size_t max, bigsize_t *val)
}
*val = ((u64)p[1] << 8) + p[2];
if (*val < 0xfd) {
SUPERVERBOSE("decoded varint is not canonical");
SUPERVERBOSE("decoded bigsize is not canonical");
return 0;
}
return 3;
@@ -76,7 +76,7 @@ size_t bigsize_get(const u8 *p, size_t max, bigsize_t *val)
*val = ((u64)p[1] << 24) + ((u64)p[2] << 16)
+ ((u64)p[3] << 8) + p[4];
if ((*val >> 16) == 0) {
SUPERVERBOSE("decoded varint is not canonical");
SUPERVERBOSE("decoded bigsize is not canonical");
return 0;
}
return 5;
@@ -90,7 +90,7 @@ size_t bigsize_get(const u8 *p, size_t max, bigsize_t *val)
+ ((u64)p[5] << 24) + ((u64)p[6] << 16)
+ ((u64)p[7] << 8) + p[8];
if ((*val >> 32) == 0) {
SUPERVERBOSE("decoded varint is not canonical");
SUPERVERBOSE("decoded bigsize is not canonical");
return 0;
}
return 9;