daemon/chaintopology: use struct topology for more functions, not lightningd_state

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-03-02 22:51:49 +10:30
parent 923526baf3
commit 61e576ef12
11 changed files with 166 additions and 138 deletions

View File

@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
| SECP256K1_CONTEXT_SIGN);
dstate->bitcoind = new_bitcoind(dstate, dstate->base_log);
dstate->topology = new_topology(dstate);
dstate->bitcoind = new_bitcoind(dstate, dstate->base_log);
/* Handle options and config; move to .lightningd */
register_opts(dstate);
@@ -87,7 +87,9 @@ int main(int argc, char *argv[])
db_init(dstate);
/* Initialize block topology. */
setup_topology(dstate->topology, dstate->bitcoind);
setup_topology(dstate->topology, dstate->bitcoind, &dstate->timers,
dstate->config.poll_time,
get_peer_min_block(dstate));
/* Create RPC socket (if any) */
setup_jsonrpc(dstate, dstate->rpc_filename);