| 270 | } |
| 271 | |
| 272 | static void sign_and_send_last(struct lightningd *ld, |
| 273 | struct channel *channel, |
| 274 | const char *cmd_id, |
| 275 | struct bitcoin_tx *last_tx, |
| 276 | struct bitcoin_signature *last_sig) |
| 277 | { |
| 278 | struct bitcoin_txid txid; |
| 279 | |
| 280 | sign_last_tx(channel, last_tx, last_sig); |
| 281 | bitcoin_txid(last_tx, &txid); |
| 282 | wallet_transaction_add(ld->wallet, last_tx->wtx, 0, 0); |
| 283 | wallet_transaction_annotate(ld->wallet, &txid, |
| 284 | channel->last_tx_type, |
| 285 | channel->dbid); |
| 286 | |
| 287 | /* Keep broadcasting until we say stop (can fail due to dup, |
| 288 | * if they beat us to the broadcast). */ |
| 289 | broadcast_tx(ld->topology, channel, last_tx, cmd_id, false, NULL); |
| 290 | |
| 291 | remove_sig(last_tx); |
| 292 | } |
| 293 | |
| 294 | void drop_to_chain(struct lightningd *ld, struct channel *channel, |
| 295 | bool cooperative) |
no test coverage detected