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

Function htlcs_index_inc

lightningd/peer_htlcs.c:3077–3097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3075#endif /* COMPAT_V061 */
3076
3077static u64 htlcs_index_inc(struct lightningd *ld,
3078 u64 htlc_id,
3079 const struct channel *channel,
3080 const struct sha256 *payment_hash,
3081 enum side owner,
3082 u32 expiry,
3083 struct amount_msat amount,
3084 enum htlc_state hstate,
3085 enum wait_index idx)
3086{
3087 return wait_index_increment(ld, ld->wallet->db,
3088 WAIT_SUBSYSTEM_HTLCS, idx,
3089 "state", htlc_state_name(hstate),
3090 "short_channel_id", fmt_short_channel_id(tmpctx, channel_scid_or_local_alias(channel)),
3091 "direction", owner == LOCAL ? "out": "in",
3092 "=htlc_id", tal_fmt(tmpctx, "%"PRIu64, htlc_id),
3093 "=cltv_expiry", tal_fmt(tmpctx, "%"PRIu32, expiry),
3094 "payment_hash", fmt_sha256(tmpctx, payment_hash),
3095 "=amount_msat", tal_fmt(tmpctx, "%"PRIu64, amount.millisatoshis), /* Raw: JSON output */
3096 NULL);
3097}
3098
3099void htlcs_index_deleted(struct lightningd *ld,
3100 const struct channel *channel,

Callers 2

htlcs_index_createdFunction · 0.85

Calls 5

fmt_short_channel_idFunction · 0.85
fmt_sha256Function · 0.85
wait_index_incrementFunction · 0.70
htlc_state_nameFunction · 0.50

Tested by

no test coverage detected