mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
0b484b111e
We can save significant space by combining both sides: so much that we can reduce the WIRE_LEN_LIMIT to something sane again. MCP results from 5 runs, min-max(mean +/- stddev): store_load_msec:34467-36764(35517.8+/-7.7e+02) vsz_kb:2637488 store_rewrite_sec:35.310000-36.580000(35.816+/-0.44) listnodes_sec:1.140000-2.780000(1.596+/-0.6) listchannels_sec:55.390000-58.110000(56.998+/-0.99) routing_sec:30.330000-30.920000(30.642+/-0.19) peer_write_all_sec:50.640000-53.360000(51.822+/-0.91) MCP notable changes from previous patch (>1 stddev): -store_rewrite_sec:34.720000-35.130000(34.94+/-0.14) +store_rewrite_sec:35.310000-36.580000(35.816+/-0.44) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
64 lines
1.8 KiB
C
64 lines
1.8 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 route_info;
|
|
|
|
struct peer_features {
|
|
u8 *localfeatures;
|
|
u8 *globalfeatures;
|
|
};
|
|
|
|
struct gossip_getnodes_entry {
|
|
struct node_id nodeid;
|
|
s64 last_timestamp; /* -1 means never: following fields ignored */
|
|
u8 *globalfeatures;
|
|
struct wireaddr *addresses;
|
|
u8 alias[32];
|
|
u8 color[3];
|
|
};
|
|
|
|
struct gossip_halfchannel_entry {
|
|
u8 message_flags;
|
|
u8 channel_flags;
|
|
u32 last_update_timestamp;
|
|
u32 delay;
|
|
u32 base_fee_msat;
|
|
u32 fee_per_millionth;
|
|
};
|
|
|
|
struct gossip_getchannels_entry {
|
|
struct node_id node[2];
|
|
struct amount_sat sat;
|
|
struct short_channel_id short_channel_id;
|
|
bool public;
|
|
bool local_disabled;
|
|
/* NULL if we haven't received an update */
|
|
struct gossip_halfchannel_entry *e[2];
|
|
};
|
|
|
|
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_route_info(const u8 **pprt, size_t *max, struct route_info *entry);
|
|
void towire_route_info(u8 **pprt, const struct route_info *entry);
|
|
|
|
struct gossip_getchannels_entry *
|
|
fromwire_gossip_getchannels_entry(const tal_t *ctx,
|
|
const u8 **pptr, size_t *max);
|
|
void towire_gossip_getchannels_entry(
|
|
u8 **pptr, const struct gossip_getchannels_entry *entry);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */
|