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

Function peer_fulfilled_our_htlc

lightningd/peer_htlcs.c:1396–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1394}
1395
1396static bool peer_fulfilled_our_htlc(struct channel *channel,
1397 const struct fulfilled_htlc *fulfilled)
1398{
1399 struct lightningd *ld = channel->peer->ld;
1400 struct htlc_out *hout;
1401
1402 hout = find_htlc_out(&ld->htlcs_out, channel, fulfilled->id);
1403 if (!hout) {
1404 channel_internal_error(channel,
1405 "fulfilled_our_htlc unknown htlc %"PRIu64,
1406 fulfilled->id);
1407 return false;
1408 }
1409
1410 if (!htlc_out_update_state(channel, hout, RCVD_REMOVE_COMMIT))
1411 return false;
1412
1413 fulfill_our_htlc_out(channel, hout, &fulfilled->payment_preimage);
1414 return true;
1415}
1416
1417void onchain_fulfilled_htlc(struct channel *channel,
1418 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