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

Function commit_tx_boost

lightningd/anchorspend.c:610–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608}
609
610void commit_tx_boost(struct channel *channel,
611 struct anchor_details *adet,
612 bool success)
613{
614 enum side side;
615
616 if (!adet)
617 return;
618
619 /* If it's in our mempool, we should consider boosting it.
620 * Otherwise, try boosting peers' commitment txs. */
621 if (success)
622 side = LOCAL;
623 else
624 side = REMOTE;
625
626 /* Ones we've already launched will use refresh_anchor_spend */
627 for (size_t i = 0; i < tal_count(adet->anchors); i++) {
628 if (adet->anchors[i].commit_side != side)
629 continue;
630 if (amount_sat_eq(adet->anchors[i].anchor_spend_fee,
631 AMOUNT_SAT(0))) {
632 create_and_broadcast_anchor(channel, &adet->anchors[i]);
633 }
634 }
635}

Callers 1

commit_tx_send_finishedFunction · 0.70

Calls 2

amount_sat_eqFunction · 0.50

Tested by

no test coverage detected