txwatch: hand ld to callback, don't assume channel is non-NULL.

We're about to use the txwatch facility for UTXOs, where there's no channel,
so allow that the be NULL, and hand the struct lightningd which callers
want anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-13 12:35:33 +09:30
committed by Christian Decker
parent 5d23698665
commit 05f12edf60
5 changed files with 36 additions and 22 deletions

View File

@@ -508,12 +508,12 @@ send_error:
peer_start_openingd(peer, &cs, peer_fd, gossip_fd, error);
}
static enum watch_result funding_lockin_cb(struct channel *channel,
static enum watch_result funding_lockin_cb(struct lightningd *ld,
struct channel *channel,
const struct bitcoin_txid *txid,
unsigned int depth)
{
const char *txidstr;
struct lightningd *ld = channel->peer->ld;
txidstr = type_to_string(channel, struct bitcoin_txid, txid);
log_debug(channel->log, "Funding tx %s depth %u of %u",