mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
wire: remove special zero-key handling.
We used to use a hack for gossip_resolve_channel_reply, where we'd send a NULL key on failure. It's now been neatened to use a counter, so we don't need this. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
55909a7a39
commit
27e0ea2358
2 changed files with 4 additions and 10 deletions
|
@ -100,10 +100,7 @@ void fromwire_pubkey(const u8 **cursor, size_t *max, struct pubkey *pubkey)
|
||||||
if (!fromwire(cursor, max, der, sizeof(der)))
|
if (!fromwire(cursor, max, der, sizeof(der)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* FIXME: Handing dummy keys through here is dumb.
|
if (!pubkey_from_der(der, sizeof(der), pubkey))
|
||||||
* See towire_gossip_resolve_channel_reply --RR */
|
|
||||||
if (!memeqzero(der, sizeof(der))
|
|
||||||
&& !pubkey_from_der(der, sizeof(der), pubkey))
|
|
||||||
fromwire_fail(cursor, max);
|
fromwire_fail(cursor, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,12 +50,9 @@ void towire_pubkey(u8 **pptr, const struct pubkey *pubkey)
|
||||||
u8 output[PUBKEY_DER_LEN];
|
u8 output[PUBKEY_DER_LEN];
|
||||||
size_t outputlen = sizeof(output);
|
size_t outputlen = sizeof(output);
|
||||||
|
|
||||||
if (pubkey)
|
secp256k1_ec_pubkey_serialize(secp256k1_ctx, output, &outputlen,
|
||||||
secp256k1_ec_pubkey_serialize(secp256k1_ctx, output, &outputlen,
|
&pubkey->pubkey,
|
||||||
&pubkey->pubkey,
|
SECP256K1_EC_COMPRESSED);
|
||||||
SECP256K1_EC_COMPRESSED);
|
|
||||||
else
|
|
||||||
memset(output, 0, sizeof(output));
|
|
||||||
|
|
||||||
towire(pptr, output, outputlen);
|
towire(pptr, output, outputlen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue