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

@@ -362,8 +362,9 @@ struct txwatch *watch_txid(const tal_t *ctx UNNEEDED,
struct chain_topology *topo UNNEEDED,
struct channel *channel UNNEEDED,
const struct bitcoin_txid *txid UNNEEDED,
enum watch_result (*cb)(struct channel *channel UNNEEDED,
const struct bitcoin_txid * UNNEEDED,
enum watch_result (*cb)(struct lightningd *ld UNNEEDED,
struct channel *channel UNNEEDED,
const struct bitcoin_txid * UNNEEDED,
unsigned int depth))
{ fprintf(stderr, "watch_txid called!\n"); abort(); }
/* Generated stub for watch_txo */