lightningd: remove watch_tx() in favor of watch_txid().

It was a wrapper only used in one place anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-10-02 09:29:51 +10:30
parent 5cf536d4b1
commit 4eb2f95e16
3 changed files with 3 additions and 29 deletions

View File

@ -255,7 +255,8 @@ 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,
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++)

View File

@ -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,

View File

@ -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,