From b61becd408a8e5073bf40e2067e90f8bcd2409eb Mon Sep 17 00:00:00 2001 From: sstone Date: Mon, 20 Jan 2020 10:39:52 +0100 Subject: [PATCH] BOLT 7: clarify how to decode empty buffers Channel queries use arrays (of short channel ids, timestamps, ...) encoded with a single byte for the encoding type followed by encoded data. If the encoded data is empty, it always decodes to an empty array, no matter what the encoding type is set to. --- 07-routing-gossip.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/07-routing-gossip.md b/07-routing-gossip.md index 6ae579d8a..5f68af79a 100644 --- a/07-routing-gossip.md +++ b/07-routing-gossip.md @@ -575,6 +575,8 @@ Encoding types: This encoding is also used for arrays of other types (timestamps, flags, ...), and specified with an `encoded_` prefix. For example, `encoded_timestamps` is an array of timestamps than can be either compressed (with a `1` prefix) or uncompressed (with a `0` prefix). +An empty encoded data buffer always decodes to an empty array, no matter what the encoding type is set to. + Note that a 65535-byte zlib message can decompress into 67632120 bytes[2](#reference-2), but since the only valid contents are unique 8-byte values, no more than 14 bytes can be duplicated