diff --git a/lightningd/gossip_msg.c b/lightningd/gossip_msg.c index 3722b844f..8b16cd30d 100644 --- a/lightningd/gossip_msg.c +++ b/lightningd/gossip_msg.c @@ -25,3 +25,17 @@ void towire_gossip_getnodes_entry(u8 **pptr, const struct gossip_getnodes_entry } towire_u16(pptr, entry->port); } + +void fromwire_route_hop(const u8 **pptr, size_t *max, struct route_hop *entry) +{ + fromwire_pubkey(pptr, max, &entry->nodeid); + entry->amount = fromwire_u32(pptr, max); + entry->delay = fromwire_u32(pptr, max); +} +void towire_route_hop(u8 **pptr, const struct route_hop *entry) +{ + towire_pubkey(pptr, &entry->nodeid); + towire_u32(pptr, entry->amount); + towire_u32(pptr, entry->delay); +} + diff --git a/lightningd/gossip_msg.h b/lightningd/gossip_msg.h index 40e7843d6..cb3908bb6 100644 --- a/lightningd/gossip_msg.h +++ b/lightningd/gossip_msg.h @@ -2,6 +2,7 @@ #define LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H #include "config.h" #include +#include struct gossip_getnodes_entry { struct pubkey nodeid; @@ -12,4 +13,7 @@ struct gossip_getnodes_entry { void fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr, size_t *max, struct gossip_getnodes_entry *entry); void towire_gossip_getnodes_entry(u8 **pptr, const struct gossip_getnodes_entry *entry); +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); + #endif /* LIGHTNING_LIGHTGNINGD_GOSSIP_MSG_H */