| 305 | } |
| 306 | |
| 307 | static struct bitcoin_tx *sign_and_send_last(const tal_t *ctx, |
| 308 | struct lightningd *ld, |
| 309 | struct channel *channel, |
| 310 | const char *cmd_id, |
| 311 | const struct bitcoin_tx *last_tx, |
| 312 | const struct bitcoin_signature *last_sig) |
| 313 | { |
| 314 | struct bitcoin_txid txid; |
| 315 | struct anchor_details *adet; |
| 316 | struct bitcoin_tx *tx; |
| 317 | |
| 318 | tx = sign_last_tx(ctx, channel, last_tx, last_sig); |
| 319 | bitcoin_txid(tx, &txid); |
| 320 | wallet_transaction_add(ld->wallet, tx->wtx, 0, 0); |
| 321 | wallet_extract_owned_outputs(ld->wallet, tx->wtx, false, NULL, NULL); |
| 322 | |
| 323 | /* Remember anchor information for commit_tx_boost */ |
| 324 | adet = create_anchor_details(NULL, channel, tx); |
| 325 | |
| 326 | /* Keep broadcasting until we say stop (can fail due to dup, |
| 327 | * if they beat us to the broadcast). */ |
| 328 | broadcast_tx(channel, ld->topology, channel, tx, cmd_id, false, 0, |
| 329 | commit_tx_send_finished, NULL, take(adet)); |
| 330 | |
| 331 | return tx; |
| 332 | } |
| 333 | |
| 334 | /* FIXME: reorder! */ |
| 335 | static enum watch_result funding_spent(struct channel *channel, |
no test coverage detected