| 215 | } |
| 216 | |
| 217 | bool derive_htlc_basepoint(const struct secret *seed, |
| 218 | struct pubkey *htlc_basepoint, |
| 219 | struct secret *htlc_secret) |
| 220 | { |
| 221 | struct keys keys; |
| 222 | |
| 223 | derive_keys(seed, &keys); |
| 224 | |
| 225 | if (htlc_basepoint) { |
| 226 | if (!pubkey_from_privkey(&keys.h, htlc_basepoint)) |
| 227 | return false; |
| 228 | } |
| 229 | |
| 230 | if (htlc_secret) |
| 231 | *htlc_secret = keys.h.secret; |
| 232 | |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | void towire_basepoints(u8 **pptr, const struct basepoints *b) |
| 237 | { |