mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 21:24:22 +01:00
gossip_msg: marshal functions for struct route_info.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
95c9a73fbb
commit
89fbae4198
@@ -1,3 +1,4 @@
|
||||
#include <common/bolt11.h>
|
||||
#include <common/wireaddr.h>
|
||||
#include <lightningd/gossip_msg.h>
|
||||
#include <wire/wire.h>
|
||||
@@ -77,6 +78,24 @@ void towire_route_hop(u8 **pptr, const struct route_hop *entry)
|
||||
towire_u32(pptr, entry->delay);
|
||||
}
|
||||
|
||||
void fromwire_route_info(const u8 **pptr, size_t *max, struct route_info *entry)
|
||||
{
|
||||
fromwire_pubkey(pptr, max, &entry->pubkey);
|
||||
fromwire_short_channel_id(pptr, max, &entry->short_channel_id);
|
||||
entry->fee_base_msat = fromwire_u32(pptr, max);
|
||||
entry->fee_proportional_millionths = fromwire_u32(pptr, max);
|
||||
entry->cltv_expiry_delta = fromwire_u16(pptr, max);
|
||||
}
|
||||
|
||||
void towire_route_info(u8 **pptr, const struct route_info *entry)
|
||||
{
|
||||
towire_pubkey(pptr, &entry->pubkey);
|
||||
towire_short_channel_id(pptr, &entry->short_channel_id);
|
||||
towire_u32(pptr, entry->fee_base_msat);
|
||||
towire_u32(pptr, entry->fee_proportional_millionths);
|
||||
towire_u16(pptr, entry->cltv_expiry_delta);
|
||||
}
|
||||
|
||||
void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max,
|
||||
struct gossip_getchannels_entry *entry)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <gossipd/routing.h>
|
||||
|
||||
struct route_info;
|
||||
|
||||
struct peer_features {
|
||||
u8 *localfeatures;
|
||||
u8 *globalfeatures;
|
||||
@@ -44,6 +46,9 @@ void towire_peer_features(u8 **pptr, const struct peer_features *features);
|
||||
void fromwire_route_hop(const u8 **pprt, size_t *max, struct route_hop *entry);
|
||||
void towire_route_hop(u8 **pprt, const struct route_hop *entry);
|
||||
|
||||
void fromwire_route_info(const u8 **pprt, size_t *max, struct route_info *entry);
|
||||
void towire_route_info(u8 **pprt, const struct route_info *entry);
|
||||
|
||||
void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max,
|
||||
struct gossip_getchannels_entry *entry);
|
||||
void towire_gossip_getchannels_entry(
|
||||
|
||||
Reference in New Issue
Block a user