Skip to content

Commit dee3ba7

Browse files
authored
Merge pull request #3185 from tnull/2024-07-clarify-max-description-length
Clarify maximum length of an invoice description
2 parents 6e73c37 + fa7ecc5 commit dee3ba7

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
@@ -1510,8 +1510,8 @@ impl TaggedField {
15101510

15111511
impl Description {
15121512

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

0 commit comments

Comments
 (0)