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

Function refresh_anchor_spend

lightningd/anchorspend.c:559–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559static bool refresh_anchor_spend(struct channel *channel,
560 const struct bitcoin_tx **tx,
561 struct one_anchor *anch)
562{
563 struct bitcoin_tx *replace;
564 struct amount_sat old_fee = anch->anchor_spend_fee;
565
566 replace = spend_anchor(tal_parent(*tx), channel, anch);
567 if (replace) {
568 struct bitcoin_txid txid;
569
570 bitcoin_txid(replace, &txid);
571 log_info(channel->log, "RBF anchor %s commit tx spend %s: fee was %s now %s",
572 anch->commit_side == LOCAL ? "local" : "remote",
573 fmt_bitcoin_txid(tmpctx, &txid),
574 fmt_amount_sat(tmpctx, old_fee),
575 fmt_amount_sat(tmpctx, anch->anchor_spend_fee));
576 log_debug(channel->log, "RBF anchor spend: Old tx %s new %s",
577 fmt_bitcoin_tx(tmpctx, *tx),
578 fmt_bitcoin_tx(tmpctx, replace));
579 tal_free(*tx);
580 *tx = replace;
581 }
582 return true;
583}
584
585static void create_and_broadcast_anchor(struct channel *channel,
586 struct one_anchor *anch)

Callers

nothing calls this directly

Calls 8

spend_anchorFunction · 0.85
tal_parentFunction · 0.85
log_infoClass · 0.85
fmt_bitcoin_txidFunction · 0.85
fmt_bitcoin_txFunction · 0.85
tal_freeFunction · 0.85
bitcoin_txidClass · 0.70
fmt_amount_satFunction · 0.50

Tested by

no test coverage detected