MCPcopy Create free account
hub / github.com/ElementsProject/lightning / closeinfo_txid_confirmed

Function closeinfo_txid_confirmed

lightningd/chaintopology.c:250–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static enum watch_result closeinfo_txid_confirmed(struct lightningd *ld,
251 struct channel *channel,
252 const struct bitcoin_txid *txid,
253 const struct bitcoin_tx *tx,
254 unsigned int depth)
255{
256 /* Sanity check. */
257 if (tx != NULL) {
258 struct bitcoin_txid txid2;
259
260 bitcoin_txid(tx, &txid2);
261 if (!bitcoin_txid_eq(txid, &txid2)) {
262 channel_internal_error(channel, "Txid for %s is not %s",
263 type_to_string(tmpctx,
264 struct bitcoin_tx,
265 tx),
266 type_to_string(tmpctx,
267 struct bitcoin_txid,
268 txid));
269 return DELETE_WATCH;
270 }
271 }
272
273 /* We delete ourselves first time, so should not be reorged out!! */
274 assert(depth > 0);
275 /* Subtle: depth 1 == current block. */
276 wallet_confirm_tx(ld->wallet, txid,
277 get_block_height(ld->topology) + 1 - depth);
278 return DELETE_WATCH;
279}
280
281/* We need to know if close_info UTXOs (which the wallet doesn't natively know
282 * how to spend, so is not in the normal path) get reconfirmed.

Callers

nothing calls this directly

Calls 5

wallet_confirm_txFunction · 0.85
bitcoin_txidClass · 0.70
channel_internal_errorFunction · 0.70
get_block_heightFunction · 0.70
type_to_stringClass · 0.50

Tested by

no test coverage detected