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

Function new_payment_hash_description

plugins/bkpr/descriptions.c:115–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static struct payment_hash_desc *
116new_payment_hash_description(struct descriptions *descriptions,
117 const struct sha256 *payment_hash,
118 const char *desc TAKES)
119{
120 struct payment_hash_desc *phd;
121
122 phd = payment_hash_desc_htable_get(descriptions->by_payment_hash, payment_hash);
123 if (phd) {
124 tal_free(phd->desc);
125 phd->desc = tal_strdup(phd, desc);
126 } else {
127 phd = tal(descriptions->by_payment_hash, struct payment_hash_desc);
128 phd->payment_hash = *payment_hash;
129 phd->desc = tal_strdup(phd, desc);
130 payment_hash_desc_htable_add(descriptions->by_payment_hash, phd);
131 }
132 return phd;
133}
134
135void add_payment_hash_description(struct command *cmd,
136 struct bkpr *bkpr,

Callers 2

init_descriptionsFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected