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

Function commit_tx_boost

lightningd/anchorspend.c:609–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

commit_tx_send_finishedFunction · 0.70

Calls 2

amount_sat_eqFunction · 0.50

Tested by

no test coverage detected