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

Function htlc_in_update_state

lightningd/peer_htlcs.c:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54static bool htlc_in_update_state(struct channel *channel,
55 struct htlc_in *hin,
56 enum htlc_state newstate)
57{
58 if (!state_update_ok(channel, hin->hstate, newstate, hin->key.id, "in"))
59 return false;
60
61 wallet_htlc_update(channel->peer->ld->wallet,
62 hin->dbid, newstate, hin->preimage,
63 max_unsigned(channel->next_index[LOCAL],
64 channel->next_index[REMOTE]),
65 hin->badonion, hin->failonion, NULL,
66 hin->we_filled,
67 hin->key.id,
68 hin->key.channel,
69 REMOTE,
70 &hin->payment_hash,
71 hin->cltv_expiry,
72 hin->msat);
73
74 hin->hstate = newstate;
75 return true;
76}
77
78static bool htlc_out_update_state(struct channel *channel,
79 struct htlc_out *hout,

Callers 5

fail_in_htlcFunction · 0.85
fulfill_htlcFunction · 0.85
peer_accepted_htlcFunction · 0.85
update_in_htlcFunction · 0.85

Calls 2

state_update_okFunction · 0.85
wallet_htlc_updateFunction · 0.85

Tested by

no test coverage detected