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

Function refresh_anchor_spend

lightningd/anchorspend.c:560–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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