mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
gossip: Added --channel-update-interval argument
We'll pass this down to gossip and make sure to re-announce/update channels every so often. This is also used as a pruning timer, i.e., channels that have not been updated in 2 x channel-update-interval will be pruned from the local view. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
ad9bdd7844
commit
0419688b0c
@@ -68,6 +68,9 @@ struct config {
|
|||||||
|
|
||||||
/* Disable automatic reconnects */
|
/* Disable automatic reconnects */
|
||||||
bool no_reconnect;
|
bool no_reconnect;
|
||||||
|
|
||||||
|
/* Channel update interval */
|
||||||
|
u32 channel_update_interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lightningd {
|
struct lightningd {
|
||||||
|
|||||||
@@ -343,6 +343,9 @@ static const struct config testnet_config = {
|
|||||||
|
|
||||||
/* Automatically reconnect */
|
/* Automatically reconnect */
|
||||||
.no_reconnect = false,
|
.no_reconnect = false,
|
||||||
|
|
||||||
|
/* Send a keepalive update at least every week, prune every twice that */
|
||||||
|
.channel_update_interval = 1209600/2,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* aka. "Dude, where's my coins?" */
|
/* aka. "Dude, where's my coins?" */
|
||||||
@@ -401,6 +404,9 @@ static const struct config mainnet_config = {
|
|||||||
|
|
||||||
/* Automatically reconnect */
|
/* Automatically reconnect */
|
||||||
.no_reconnect = false,
|
.no_reconnect = false,
|
||||||
|
|
||||||
|
/* Send a keepalive update at least every week, prune every twice that */
|
||||||
|
.channel_update_interval = 1209600/2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void check_config(struct lightningd *ld)
|
static void check_config(struct lightningd *ld)
|
||||||
@@ -521,6 +527,12 @@ void register_opts(struct lightningd *ld)
|
|||||||
"RRGGBB hex color for node");
|
"RRGGBB hex color for node");
|
||||||
opt_register_arg("--alias", opt_set_alias, NULL, ld,
|
opt_register_arg("--alias", opt_set_alias, NULL, ld,
|
||||||
"Up to 32-byte alias for node");
|
"Up to 32-byte alias for node");
|
||||||
|
|
||||||
|
opt_register_arg(
|
||||||
|
"--channel-update-interval=<s>", opt_set_u32, opt_show_u32,
|
||||||
|
&ld->config.channel_update_interval,
|
||||||
|
"Time in seconds between channel updates for our own channels.");
|
||||||
|
|
||||||
opt_register_logging(ld->log);
|
opt_register_logging(ld->log);
|
||||||
opt_register_version();
|
opt_register_version();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user