refactor: Making timers independent of the lightningd_state

The `dstate` reference was only an indirection to the `timers`
sub-structure anyway, so removing this indirection allows us to reuse
the timers in the subdaemon arch.
This commit is contained in:
Christian Decker
2017-02-04 15:32:02 +01:00
parent 597687d1f0
commit 1c4c874d3f
6 changed files with 22 additions and 21 deletions

View File

@@ -259,7 +259,7 @@ static void remote_changes_pending(struct peer *peer)
{
if (!peer->commit_timer) {
log_debug(peer->log, "remote_changes_pending: adding timer");
peer->commit_timer = new_reltimer(peer->dstate, peer,
peer->commit_timer = new_reltimer(&peer->dstate->timers, peer,
peer->dstate->config.commit_time,
try_commit, peer);
} else
@@ -4415,7 +4415,7 @@ static void reconnect_failed(struct io_conn *conn, struct peer *peer)
}
log_debug(peer->log, "Setting timer to re-connect");
new_reltimer(peer->dstate, peer, time_from_sec(15), try_reconnect, peer);
new_reltimer(&peer->dstate->timers, peer, time_from_sec(15), try_reconnect, peer);
}
static struct io_plan *init_conn(struct io_conn *conn, struct peer *peer)