Files
lightning/lightningd/gossip_msg.h
Rusty Russell 28553308e2 gossip: make channel_announce-set fields unset until channel announce.
Use a negative timestamp as the flag for this, making the test simple.
This allows valgrind to detect that we're accessing them prematurely,
including across the wire on gossip_getchannels_entry.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-09-03 02:01:54 +02:00

38 lines
1.1 KiB
C

#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H
#define LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H
#include "config.h"
#include <bitcoin/pubkey.h>
#include <gossipd/routing.h>
struct gossip_getnodes_entry {
struct pubkey nodeid;
struct ipaddr *addresses;
};
struct gossip_getchannels_entry {
struct pubkey source, destination;
bool active;
struct short_channel_id short_channel_id;
u16 flags;
s64 last_update_timestamp; /* -1 means never */
/* These are only set if last_update_timestamp >= 0 */
u32 delay;
u32 fee_per_kw;
};
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);
void fromwire_gossip_getchannels_entry(const u8 **pptr, size_t *max,
struct gossip_getchannels_entry *entry);
void towire_gossip_getchannels_entry(
u8 **pptr, const struct gossip_getchannels_entry *entry);
#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */