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

Function update_in_htlc

lightningd/peer_htlcs.c:1804–1824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802}
1803
1804static bool update_in_htlc(struct channel *channel,
1805 u64 id, enum htlc_state newstate)
1806{
1807 struct htlc_in *hin;
1808 struct lightningd *ld = channel->peer->ld;
1809
1810 hin = find_htlc_in(&ld->htlcs_in, channel, id);
1811 if (!hin) {
1812 channel_internal_error(channel, "Can't find in HTLC %"PRIu64, id);
1813 return false;
1814 }
1815
1816 if (!htlc_in_update_state(channel, hin, newstate))
1817 return false;
1818
1819 htlc_in_check(hin, __func__);
1820 if (newstate == SENT_REMOVE_ACK_REVOCATION)
1821 remove_htlc_in(channel, hin);
1822
1823 return true;
1824}
1825
1826static bool update_out_htlc(struct channel *channel,
1827 u64 id, enum htlc_state newstate)

Callers 2

changed_htlcFunction · 0.85
peer_sending_revocationFunction · 0.85

Calls 5

find_htlc_inFunction · 0.85
htlc_in_update_stateFunction · 0.85
htlc_in_checkFunction · 0.85
remove_htlc_inFunction · 0.85
channel_internal_errorFunction · 0.70

Tested by

no test coverage detected