daemon: config file support.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-01-22 06:41:49 +10:30
parent bf3080ca09
commit a5aa7b9abd
2 changed files with 115 additions and 0 deletions

View File

@@ -3,10 +3,32 @@
#include "config.h"
#include "bitcoin/pubkey.h"
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>
#include <ccan/timer/timer.h>
#include <secp256k1.h>
#include <stdio.h>
/* Various adjustable things. */
struct config {
/* How long do we want them to lock up their funds? (seconds) */
u32 rel_locktime;
/* How long do we let them lock up our funds? (seconds) */
u32 rel_locktime_max;
/* How many confirms until we consider an anchor "settled". */
u32 anchor_confirms;
/* How long will we accept them waiting? */
u32 anchor_confirms_max;
/* What are we prepared to pay in commitment fee (satoshis). */
u64 commitment_fee;
/* How little are we prepared to have them pay? */
u64 commitment_fee_min;
};
/* Here's where the global variables hide! */
struct lightningd_state {
/* Where all our logging goes. */
@@ -18,6 +40,9 @@ struct lightningd_state {
char *config_dir;
char *rpc_filename;
/* Configuration settings. */
struct config config;
/* Any pending timers. */
struct timers timers;