From: Elias Rohrer Date: Tue, 16 Jul 2024 08:28:58 +0000 (+0200) Subject: Clarify maximum length of an invoice description X-Git-Tag: v0.0.124-beta~47^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=fa7ecc56d7b2cb3d03cc55c96d66bdac2414b293;p=rust-lightning Clarify maximum length of an invoice description We previously stated in the docs that the invoice description can be at most `1023` bytes long, which is wrong. According to BOLT 11 it's at most 1023*5 bits (639 bytes) long. --- diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index e427bf3cc..d64da322a 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -1511,8 +1511,8 @@ impl TaggedField { impl Description { - /// Creates a new `Description` if `description` is at most 1023 __bytes__ long, - /// returns [`CreationError::DescriptionTooLong`] otherwise + /// Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes) + /// long, and returns [`CreationError::DescriptionTooLong`] otherwise. /// /// Please note that single characters may use more than one byte due to UTF8 encoding. pub fn new(description: String) -> Result {