diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 0f7a33e9a..c55ea26fc 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -255,8 +255,9 @@ static void watch_tx_and_outputs(struct channel *channel, bitcoin_txid(tx, &outpoint.txid); /* Make txwatch a parent of txo watches, so we can unwatch together. */ - txw = watch_tx(channel->owner, ld->topology, channel, tx, - onchain_tx_watched); + txw = watch_txid(channel->owner, ld->topology, channel, + &outpoint.txid, + onchain_tx_watched); for (outpoint.n = 0; outpoint.n < tx->wtx->num_outputs; outpoint.n++) watch_txo(txw, ld->topology, channel, &outpoint, diff --git a/lightningd/watch.c b/lightningd/watch.c index d851b69b7..dacc19359 100644 --- a/lightningd/watch.c +++ b/lightningd/watch.c @@ -168,23 +168,6 @@ bool watching_txid(const struct chain_topology *topo, return txwatch_hash_get(topo->txwatches, txid) != NULL; } -struct txwatch *watch_tx(const tal_t *ctx, - struct chain_topology *topo, - struct channel *channel, - const struct bitcoin_tx *tx, - enum watch_result (*cb)(struct lightningd *ld, - struct channel *channel, - const struct bitcoin_txid *, - const struct bitcoin_tx *, - unsigned int depth)) -{ - struct bitcoin_txid txid; - - bitcoin_txid(tx, &txid); - /* FIXME: Save populate txwatch->tx here, too! */ - return watch_txid(ctx, topo, channel, &txid, cb); -} - struct txowatch *watch_txo(const tal_t *ctx, struct chain_topology *topo, struct channel *channel, diff --git a/lightningd/watch.h b/lightningd/watch.h index dbdd43d4e..d722eb9d7 100644 --- a/lightningd/watch.h +++ b/lightningd/watch.h @@ -40,16 +40,6 @@ struct txwatch *watch_txid(const tal_t *ctx, const struct bitcoin_tx *, unsigned int depth)); -struct txwatch *watch_tx(const tal_t *ctx, - struct chain_topology *topo, - struct channel *channel, - const struct bitcoin_tx *tx, - enum watch_result (*cb)(struct lightningd *ld, - struct channel *, - const struct bitcoin_txid *, - const struct bitcoin_tx *, - unsigned int depth)); - struct txowatch *watch_txo(const tal_t *ctx, struct chain_topology *topo, struct channel *channel,