mirror of
https://github.com/lightning/bolts.git
synced 2025-03-10 09:10:07 +01:00
Bolt 1: Clarify the definition of tu fields (#1073)
Truncated integer fields, e.g. tu16 cannot have leading zeros judging by the implementations of the parsers, which are used across the different ln implementations. The `can` imposed that it is not necessary to truncate the fields to values of information. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
This commit is contained in:
parent
50b2df24a2
commit
5635a3657e
1 changed files with 5 additions and 5 deletions
|
@ -224,12 +224,12 @@ Various fundamental types are referred to in the message specifications:
|
|||
* `u32`: a 4 byte unsigned integer
|
||||
* `u64`: an 8 byte unsigned integer
|
||||
|
||||
Inside TLV records which contain a single value, leading zeros in
|
||||
integers can be omitted:
|
||||
For the final value in TLV records, truncated integers may be used. Leading zeros in
|
||||
truncated integers MUST be omitted:
|
||||
|
||||
* `tu16`: a 0 to 2 byte unsigned integer
|
||||
* `tu32`: a 0 to 4 byte unsigned integer
|
||||
* `tu64`: a 0 to 8 byte unsigned integer
|
||||
* `tu16`: a 0 to 2 byte truncated unsigned integer
|
||||
* `tu32`: a 0 to 4 byte truncated unsigned integer
|
||||
* `tu64`: a 0 to 8 byte truncated unsigned integer
|
||||
|
||||
When used to encode amounts, the previous fields MUST comply with the upper
|
||||
bound of 21 million BTC:
|
||||
|
|
Loading…
Add table
Reference in a new issue