mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
daemon: time options use opt_time.
Currently this mean --bitcoin-poll; we're going to change the other time options to block heights anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6c7facfd2d
commit
fe1ba96332
@ -67,7 +67,7 @@ static void start_poll_chaintips(struct lightningd_state *dstate);
|
||||
|
||||
static void next_topology_timer(struct lightningd_state *dstate)
|
||||
{
|
||||
new_reltimer(dstate, dstate, time_from_sec(dstate->config.poll_seconds),
|
||||
new_reltimer(dstate, dstate, dstate->config.poll_time,
|
||||
start_poll_chaintips, dstate);
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "jsonrpc.h"
|
||||
#include "lightningd.h"
|
||||
#include "log.h"
|
||||
#include "opt_time.h"
|
||||
#include "peer.h"
|
||||
#include "secrets.h"
|
||||
#include "timeout.h"
|
||||
@ -14,6 +15,7 @@
|
||||
#include <ccan/opt/opt.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <ccan/time/time.h>
|
||||
#include <ccan/timer/timer.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
@ -98,9 +100,9 @@ static void config_register_opts(struct lightningd_state *dstate)
|
||||
opt_register_arg("--max-expiry", opt_set_u32, opt_show_u32,
|
||||
&dstate->config.max_expiry,
|
||||
"Maximum number of seconds to accept an HTLC before expiry");
|
||||
opt_register_arg("--bitcoind-poll", opt_set_u32, opt_show_u32,
|
||||
&dstate->config.poll_seconds,
|
||||
"Seconds between polling for new transactions");
|
||||
opt_register_arg("--bitcoind-poll", opt_set_time, opt_show_time,
|
||||
&dstate->config.poll_time,
|
||||
"Time between polling for new transactions");
|
||||
}
|
||||
|
||||
#define MINUTES 60
|
||||
@ -151,7 +153,7 @@ static void default_config(struct config *config)
|
||||
/* Don't lock up channel for more than 5 days. */
|
||||
config->max_expiry = 5 * DAYS;
|
||||
|
||||
config->poll_seconds = 30;
|
||||
config->poll_time = time_from_sec(30);
|
||||
}
|
||||
|
||||
static void check_config(struct lightningd_state *dstate)
|
||||
|
@ -41,8 +41,8 @@ struct config {
|
||||
/* Minimum/maximum time for an expiring HTLC (seconds). */
|
||||
u32 min_expiry, max_expiry;
|
||||
|
||||
/* How long (seconds) between polling bitcoind. */
|
||||
u32 poll_seconds;
|
||||
/* How long between polling bitcoind. */
|
||||
struct timerel poll_time;
|
||||
};
|
||||
|
||||
/* Here's where the global variables hide! */
|
||||
|
@ -211,7 +211,7 @@ mkdir $DIR1 $DIR2
|
||||
|
||||
cat > $DIR1/config <<EOF
|
||||
log-level=debug
|
||||
bitcoind-poll=1
|
||||
bitcoind-poll=1s
|
||||
min-expiry=900
|
||||
bitcoin-datadir=$DATADIR
|
||||
locktime=600
|
||||
@ -219,7 +219,7 @@ EOF
|
||||
|
||||
cat > $DIR2/config <<EOF
|
||||
log-level=debug
|
||||
bitcoind-poll=1
|
||||
bitcoind-poll=1s
|
||||
min-expiry=900
|
||||
bitcoin-datadir=$DATADIR
|
||||
locktime=600
|
||||
|
Loading…
Reference in New Issue
Block a user