| 113 | } |
| 114 | |
| 115 | static struct payment_hash_desc * |
| 116 | new_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 | |
| 135 | void add_payment_hash_description(struct command *cmd, |
| 136 | struct bkpr *bkpr, |
no test coverage detected