mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 06:54:30 +01:00
bolt11: fix encoding of x and c fields.
Fixes: #374 Reported-by: Nadav Ivgi Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
1648eb548a
commit
60c30214c1
@@ -760,7 +760,7 @@ static void push_varlen_field(u5 **data, char type, u64 val)
|
||||
assert(bech32_charset_rev[(unsigned char)type] >= 0);
|
||||
push_varlen_uint(data, bech32_charset_rev[(unsigned char)type], 5);
|
||||
|
||||
for (size_t nbits = 5; nbits < 65; nbits++) {
|
||||
for (size_t nbits = 5; nbits < 65; nbits += 5) {
|
||||
if ((val >> nbits) == 0) {
|
||||
push_varlen_uint(data, nbits / 5, 10);
|
||||
push_varlen_uint(data, val, nbits);
|
||||
|
||||
Reference in New Issue
Block a user