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

Function htlc_out_update_state

lightningd/peer_htlcs.c:78–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static bool htlc_out_update_state(struct channel *channel,
79 struct htlc_out *hout,
80 enum htlc_state newstate)
81{
82 if (!state_update_ok(channel, hout->hstate, newstate, hout->key.id,
83 "out"))
84 return false;
85
86 bool we_filled = false;
87 wallet_htlc_update(channel->peer->ld->wallet, hout->dbid, newstate,
88 hout->preimage,
89 max_unsigned(channel->next_index[LOCAL],
90 channel->next_index[REMOTE]),
91 0, hout->failonion,
92 hout->failmsg, &we_filled,
93 hout->key.id,
94 hout->key.channel,
95 LOCAL,
96 &hout->payment_hash,
97 hout->cltv_expiry,
98 hout->msat);
99
100 hout->hstate = newstate;
101 return true;
102}
103
104static void cstat_accumulate(struct channel *c,
105 struct amount_msat *val,

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