| 248 | } |
| 249 | |
| 250 | static 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. |
nothing calls this directly
no test coverage detected