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

Function sign_and_send_last

lightningd/peer_control.c:272–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272static 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
294void drop_to_chain(struct lightningd *ld, struct channel *channel,
295 bool cooperative)

Callers 1

drop_to_chainFunction · 0.85

Calls 6

sign_last_txFunction · 0.85
remove_sigFunction · 0.85
bitcoin_txidClass · 0.70
broadcast_txFunction · 0.70
wallet_transaction_addFunction · 0.50

Tested by

no test coverage detected