chaintopology: restore anchor timeout.

Instead of using wall-clock time, we use blocks.  This is simpler and
better for database restores.  And both sides will time out.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-11-09 17:14:22 +10:30
parent 1fe83f47a9
commit 6f360422d4
5 changed files with 38 additions and 0 deletions

View File

@@ -109,6 +109,9 @@ static void config_register_opts(struct lightningd_state *dstate)
opt_register_arg("--max-locktime-blocks", opt_set_u32, opt_show_u32,
&dstate->config.locktime_max,
"Maximum seconds peer can lock up our funds");
opt_register_arg("--anchor-onchain", opt_set_u32, opt_show_u32,
&dstate->config.anchor_onchain_wait,
"Blocks before we give up on pending anchor transaction");
opt_register_arg("--anchor-confirms", opt_set_u32, opt_show_u32,
&dstate->config.anchor_confirms,
"Confirmations required for anchor transaction");
@@ -183,6 +186,9 @@ static const struct config testnet_config = {
/* They can have up to 3 days. */
.locktime_max = 3 * 6 * 24,
/* Testnet can have long runs of empty blocks. */
.anchor_onchain_wait = 100,
/* We're fairly trusting, under normal circumstances. */
.anchor_confirms = 1,
@@ -247,6 +253,9 @@ static const struct config mainnet_config = {
/* They can have up to 3 days. */
.locktime_max = 3 * 6 * 24,
/* You should get in within 10 blocks. */
.anchor_onchain_wait = 10,
/* We're fairly trusting, under normal circumstances. */
.anchor_confirms = 3,