mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-08 06:49:31 +01:00
d241bd762c
gossip_getnodes_entry was used by gossipd for reporting nodes, and for reporting peers. But the local_features field is only available for peers, and most other fields are only available from node_announcement. Note that the connectd change actually means we get less information about peers: gossipd used to do the node lookup for peers and include the node_announcement information if it had it. Since generate_wire.py can't create arrays-of-arrays, we add a 'struct peer_features' to encapsulate the two feature arrays for each peer, and for convenience we add it to lightningd/gossip_msg. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
51 lines
1.4 KiB
C
51 lines
1.4 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 peer_features {
|
|
u8 *local_features;
|
|
u8 *global_features;
|
|
};
|
|
|
|
struct gossip_getnodes_entry {
|
|
struct pubkey nodeid;
|
|
u8 *global_features;
|
|
s64 last_timestamp; /* -1 means never: following fields ignored */
|
|
struct wireaddr *addresses;
|
|
u8 *alias;
|
|
u8 color[3];
|
|
};
|
|
|
|
struct gossip_getchannels_entry {
|
|
struct pubkey source, destination;
|
|
u64 satoshis;
|
|
struct short_channel_id short_channel_id;
|
|
u16 flags;
|
|
bool public;
|
|
u32 last_update_timestamp;
|
|
u32 delay;
|
|
u32 base_fee_msat;
|
|
u32 fee_per_millionth;
|
|
};
|
|
|
|
struct gossip_getnodes_entry *
|
|
fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr, size_t *max);
|
|
void towire_gossip_getnodes_entry(u8 **pptr,
|
|
const struct gossip_getnodes_entry *entry);
|
|
|
|
struct peer_features *
|
|
fromwire_peer_features(const tal_t *ctx, const u8 **pptr, size_t *max);
|
|
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_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 */
|