diff --git a/lightningd/gossip_msg.c b/lightningd/gossip_msg.c index f7cf544cc..12d7b3729 100644 --- a/lightningd/gossip_msg.c +++ b/lightningd/gossip_msg.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -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) { diff --git a/lightningd/gossip_msg.h b/lightningd/gossip_msg.h index 704e3f960..66f382e30 100644 --- a/lightningd/gossip_msg.h +++ b/lightningd/gossip_msg.h @@ -4,6 +4,8 @@ #include #include +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(