mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
3e733afb2b
This clarifies things a fair bit: we simply add and remove from the gossip_store directly. Before this series: (--disable-developer, -Og) store_load_msec:20669-20902(20822.2+/-82) vsz_kb:439704-439712(439706+/-3.2) listnodes_sec:0.890000-1.000000(0.92+/-0.04) listchannels_sec:11.960000-13.380000(12.576+/-0.49) routing_sec:3.070000-5.970000(4.814+/-1.2) peer_write_all_sec:28.490000-30.580000(29.532+/-0.78) After: (--disable-developer, -Og) store_load_msec:19722-20124(19921.6+/-1.4e+02) vsz_kb:288320 listnodes_sec:0.860000-0.980000(0.912+/-0.056) listchannels_sec:10.790000-12.260000(11.65+/-0.5) routing_sec:2.540000-4.950000(4.262+/-0.88) peer_write_all_sec:17.570000-19.500000(18.048+/-0.73) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
23 lines
613 B
C
23 lines
613 B
C
#ifndef LIGHTNING_GOSSIPD_BROADCAST_H
|
|
#define LIGHTNING_GOSSIPD_BROADCAST_H
|
|
#include "config.h"
|
|
|
|
#include <ccan/list/list.h>
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <ccan/tal/tal.h>
|
|
|
|
/* This is nested inside a node, chan or half_chan; rewriting the store can
|
|
* cause it to change! */
|
|
struct broadcastable {
|
|
/* This is also the offset within the gossip_store; even with 1M
|
|
* channels we still have a factor of 8 before this wraps. */
|
|
u32 index;
|
|
u32 timestamp;
|
|
};
|
|
|
|
static inline void broadcastable_init(struct broadcastable *bcast)
|
|
{
|
|
bcast->index = 0;
|
|
}
|
|
#endif /* LIGHTNING_GOSSIPD_BROADCAST_H */
|