diff --git a/common/derive_basepoints.c b/common/derive_basepoints.c index 964b03f7f..0414c2fee 100644 --- a/common/derive_basepoints.c +++ b/common/derive_basepoints.c @@ -11,7 +11,7 @@ bool derive_basepoints(const struct privkey *seed, struct sha256 *shaseed) { struct keys { - struct privkey f, r, p, d; + struct privkey f, r, h, p, d; struct sha256 shaseed; } keys; @@ -22,8 +22,7 @@ bool derive_basepoints(const struct privkey *seed, secrets->funding_privkey = keys.f; secrets->revocation_basepoint_secret = keys.r.secret; secrets->payment_basepoint_secret = keys.p.secret; - /* We currently make htlc_basepoint_secret the same */ - secrets->htlc_basepoint_secret = keys.p.secret; + secrets->htlc_basepoint_secret = keys.h.secret; secrets->delayed_payment_basepoint_secret = keys.d.secret; } @@ -34,8 +33,8 @@ bool derive_basepoints(const struct privkey *seed, if (basepoints) { if (!pubkey_from_privkey(&keys.r, &basepoints->revocation) - || !pubkey_from_privkey(&keys.p, &basepoints->htlc) || !pubkey_from_privkey(&keys.p, &basepoints->payment) + || !pubkey_from_privkey(&keys.h, &basepoints->htlc) || !pubkey_from_privkey(&keys.d, &basepoints->delayed_payment)) return false; }