Skip to content

Commit fa7ecc5

Browse files
committed
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.
1 parent dd5d297 commit fa7ecc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning-invoice/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,8 +1511,8 @@ impl TaggedField {
15111511

15121512
impl Description {
15131513

1514-
/// Creates a new `Description` if `description` is at most 1023 __bytes__ long,
1515-
/// returns [`CreationError::DescriptionTooLong`] otherwise
1514+
/// Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes)
1515+
/// long, and returns [`CreationError::DescriptionTooLong`] otherwise.
15161516
///
15171517
/// Please note that single characters may use more than one byte due to UTF8 encoding.
15181518
pub fn new(description: String) -> Result<Description, CreationError> {

0 commit comments

Comments
 (0)