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

Function peer_fulfilled_our_htlc

lightningd/peer_htlcs.c:1662–1681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1660}
1661
1662static bool peer_fulfilled_our_htlc(struct channel *channel,
1663 const struct fulfilled_htlc *fulfilled)
1664{
1665 struct lightningd *ld = channel->peer->ld;
1666 struct htlc_out *hout;
1667
1668 hout = find_htlc_out(ld->htlcs_out, channel, fulfilled->id);
1669 if (!hout) {
1670 channel_internal_error(channel,
1671 "fulfilled_our_htlc unknown htlc %"PRIu64,
1672 fulfilled->id);
1673 return false;
1674 }
1675
1676 if (!htlc_out_update_state(channel, hout, RCVD_REMOVE_COMMIT))
1677 return false;
1678
1679 fulfill_our_htlc_out(channel, hout, &fulfilled->payment_preimage);
1680 return true;
1681}
1682
1683void onchain_fulfilled_htlc(struct channel *channel,
1684 const struct preimage *preimage)

Callers 1

peer_got_commitsigFunction · 0.85

Calls 4

find_htlc_outFunction · 0.85
htlc_out_update_stateFunction · 0.85
fulfill_our_htlc_outFunction · 0.85
channel_internal_errorFunction · 0.70

Tested by

no test coverage detected