Browse Source

gossip_msg: marshal functions for struct route_info.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
fee-tracking2
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
89fbae4198
  1. 19
      lightningd/gossip_msg.c
  2. 5
      lightningd/gossip_msg.h

19
lightningd/gossip_msg.c

@ -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)
{

5
lightningd/gossip_msg.h

@ -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(

Loading…
Cancel
Save