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

Function chan_extra_commit_htlc

plugins/renepay/chan_extra.c:664–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664enum renepay_errorcode
665chan_extra_commit_htlc(struct chan_extra_map *chan_extra_map,
666 const struct short_channel_id_dir *scidd,
667 struct amount_msat amount)
668{
669 struct chan_extra_half *h =
670 get_chan_extra_half_by_scid(chan_extra_map, scidd);
671 if (!h)
672 return RENEPAY_CHANNEL_NOT_FOUND;
673 if (!amount_msat_accumulate(&h->htlc_total, amount))
674 return RENEPAY_AMOUNT_OVERFLOW;
675 h->num_htlcs++;
676 return RENEPAY_NOERROR;
677}

Callers 1

uncertainty_commit_htlcsFunction · 0.85

Calls 2

amount_msat_accumulateFunction · 0.85

Tested by

no test coverage detected