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

Function derive_htlc_scripts

onchaind/onchaind.c:1789–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1787}
1788
1789static u8 **derive_htlc_scripts(const struct htlc_stub *htlcs, enum side side)
1790{
1791 size_t i;
1792 u8 **htlc_scripts = tal_arr(htlcs, u8 *, tal_count(htlcs));
1793
1794 for (i = 0; i < tal_count(htlcs); i++) {
1795 if (htlcs[i].owner == side)
1796 htlc_scripts[i] = htlc_offered_wscript(htlc_scripts,
1797 &htlcs[i].ripemd,
1798 keyset,
1799 option_anchor_outputs,
1800 option_anchors_zero_fee_htlc_tx);
1801 else {
1802 /* FIXME: remove abs_locktime */
1803 struct abs_locktime ltime;
1804 if (!blocks_to_abs_locktime(htlcs[i].cltv_expiry,
1805 &ltime))
1806 status_failed(STATUS_FAIL_INTERNAL_ERROR,
1807 "Could not convert cltv_expiry %u to locktime",
1808 htlcs[i].cltv_expiry);
1809 htlc_scripts[i] = htlc_received_wscript(htlc_scripts,
1810 &htlcs[i].ripemd,
1811 &ltime,
1812 keyset,
1813 option_anchor_outputs,
1814 option_anchors_zero_fee_htlc_tx);
1815 }
1816 }
1817 return htlc_scripts;
1818}
1819
1820static size_t resolve_our_htlc_ourcommit(struct tracked_output *out,
1821 const size_t *matches,

Callers 3

handle_our_unilateralFunction · 0.85
handle_their_cheatFunction · 0.85
handle_their_unilateralFunction · 0.85

Calls 4

blocks_to_abs_locktimeFunction · 0.85
htlc_offered_wscriptFunction · 0.50
status_failedFunction · 0.50
htlc_received_wscriptFunction · 0.50

Tested by

no test coverage detected