mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-18 12:34:21 +01:00
sphinx: fix payload amount encoding
it was changed to 64 bits
This commit is contained in:
@@ -336,9 +336,9 @@ static void serialize_hop_data(tal_t *ctx, u8 *dst, const struct hop_data *data)
|
||||
u8 *buf = tal_arr(ctx, u8, 0);
|
||||
towire_u8(&buf, data->realm);
|
||||
towire_short_channel_id(&buf, &data->channel_id);
|
||||
towire_u32(&buf, data->amt_forward);
|
||||
towire_u64(&buf, data->amt_forward);
|
||||
towire_u32(&buf, data->outgoing_cltv);
|
||||
towire_pad(&buf, 16);
|
||||
towire_pad(&buf, 12);
|
||||
towire(&buf, data->hmac, SECURITY_PARAMETER);
|
||||
memcpy(dst, buf, tal_len(buf));
|
||||
tal_free(buf);
|
||||
@@ -350,9 +350,9 @@ static void deserialize_hop_data(struct hop_data *data, const u8 *src)
|
||||
size_t max = HOP_DATA_SIZE;
|
||||
data->realm = fromwire_u8(&cursor, &max);
|
||||
fromwire_short_channel_id(&cursor, &max, &data->channel_id);
|
||||
data->amt_forward = fromwire_u32(&cursor, &max);
|
||||
data->amt_forward = fromwire_u64(&cursor, &max);
|
||||
data->outgoing_cltv = fromwire_u32(&cursor, &max);
|
||||
fromwire_pad(&cursor, &max, 16);
|
||||
fromwire_pad(&cursor, &max, 12);
|
||||
fromwire(&cursor, &max, &data->hmac, SECURITY_PARAMETER);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ enum route_next_case {
|
||||
struct hop_data {
|
||||
u8 realm;
|
||||
struct short_channel_id channel_id;
|
||||
u32 amt_forward;
|
||||
u64 amt_forward;
|
||||
u32 outgoing_cltv;
|
||||
/* Padding omitted, will be zeroed */
|
||||
u8 hmac[SECURITY_PARAMETER];
|
||||
|
||||
Reference in New Issue
Block a user