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

Function sign_and_send_last

lightningd/peer_control.c:307–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307static 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! */
335static enum watch_result funding_spent(struct channel *channel,

Callers 1

drop_to_chainFunction · 0.85

Calls 5

sign_last_txFunction · 0.85
bitcoin_txidClass · 0.70
create_anchor_detailsFunction · 0.70
wallet_transaction_addFunction · 0.50

Tested by

no test coverage detected