mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
daemon: --closing-fee
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6bdaa5d1ca
commit
9f560a9494
@ -84,6 +84,9 @@ static void config_register_opts(struct lightningd_state *dstate)
|
||||
opt_register_arg("--min-commit-fee", opt_set_u64, opt_show_u64,
|
||||
&dstate->config.commitment_fee_min,
|
||||
"Minimum satoshis to accept for commitment transaction fee");
|
||||
opt_register_arg("--closing-fee", opt_set_u64, opt_show_u64,
|
||||
&dstate->config.closing_fee,
|
||||
"Satoshis to use for mutual close transaction fee");
|
||||
opt_register_arg("--bitcoind-poll", opt_set_u32, opt_show_u32,
|
||||
&dstate->config.poll_seconds,
|
||||
"Seconds between polling for new transactions");
|
||||
@ -114,9 +117,27 @@ static void default_config(struct config *config)
|
||||
/* Don't accept less than double the current standard fee. */
|
||||
config->commitment_fee_min = 10000;
|
||||
|
||||
/* Use this for mutual close. */
|
||||
config->closing_fee = 10000;
|
||||
|
||||
config->poll_seconds = 30;
|
||||
}
|
||||
|
||||
static void check_config(struct lightningd_state *dstate)
|
||||
{
|
||||
if (dstate->config.closing_fee > dstate->config.commitment_fee)
|
||||
fatal("Closing fee %"PRIu64
|
||||
" can't exceed commitment fee %"PRIu64,
|
||||
dstate->config.closing_fee,
|
||||
dstate->config.commitment_fee);
|
||||
|
||||
if (dstate->config.commitment_fee_min > dstate->config.commitment_fee)
|
||||
fatal("Minumum fee %"PRIu64
|
||||
" can't exceed commitment fee %"PRIu64,
|
||||
dstate->config.commitment_fee_min,
|
||||
dstate->config.commitment_fee);
|
||||
}
|
||||
|
||||
static struct lightningd_state *lightningd_state(void)
|
||||
{
|
||||
struct lightningd_state *dstate = tal(NULL, struct lightningd_state);
|
||||
@ -203,6 +224,8 @@ int main(int argc, char *argv[])
|
||||
if (argc != 1)
|
||||
errx(1, "no arguments accepted");
|
||||
|
||||
check_config(dstate);
|
||||
|
||||
check_bitcoind_config(dstate);
|
||||
|
||||
/* Create RPC socket (if any) */
|
||||
|
@ -32,6 +32,9 @@ struct config {
|
||||
/* How little are we prepared to have them pay? */
|
||||
u64 commitment_fee_min;
|
||||
|
||||
/* What fee we use for the closing transaction (satoshis) */
|
||||
u64 closing_fee;
|
||||
|
||||
/* How long (seconds) between polling bitcoind. */
|
||||
u32 poll_seconds;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user