| 231 | } |
| 232 | |
| 233 | bool derive_htlc_basepoint(const struct secret *seed, |
| 234 | struct pubkey *htlc_basepoint, |
| 235 | struct secret *htlc_secret) |
| 236 | { |
| 237 | struct keys keys; |
| 238 | |
| 239 | derive_keys(seed, &keys); |
| 240 | |
| 241 | if (htlc_basepoint) { |
| 242 | if (!pubkey_from_privkey(&keys.h, htlc_basepoint)) |
| 243 | return false; |
| 244 | } |
| 245 | |
| 246 | if (htlc_secret) |
| 247 | *htlc_secret = keys.h.secret; |
| 248 | |
| 249 | return true; |
| 250 | } |
| 251 | |
| 252 | void towire_basepoints(u8 **pptr, const struct basepoints *b) |
| 253 | { |