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

Function htlc_out_update_state

lightningd/peer_htlcs.c:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static bool htlc_out_update_state(struct channel *channel,
76 struct htlc_out *hout,
77 enum htlc_state newstate)
78{
79 if (!state_update_ok(channel, hout->hstate, newstate, hout->key.id,
80 "out"))
81 return false;
82
83 bool we_filled = false;
84 wallet_htlc_update(channel->peer->ld->wallet, hout->dbid, newstate,
85 hout->preimage,
86 max_unsigned(channel->next_index[LOCAL],
87 channel->next_index[REMOTE]),
88 0, hout->failonion,
89 hout->failmsg, &we_filled);
90
91 hout->hstate = newstate;
92 return true;
93}
94
95static struct failed_htlc *mk_failed_htlc_badonion(const tal_t *ctx,
96 const struct htlc_in *hin,

Callers 3

peer_fulfilled_our_htlcFunction · 0.85
peer_failed_our_htlcFunction · 0.85
update_out_htlcFunction · 0.85

Calls 2

state_update_okFunction · 0.85
wallet_htlc_updateFunction · 0.85

Tested by

no test coverage detected