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:
Rusty Russell 2018-01-10 13:13:23 +10:30 committed by Christian Decker
parent 55909a7a39
commit 27e0ea2358
2 changed files with 4 additions and 10 deletions

View file

@ -100,10 +100,7 @@ void fromwire_pubkey(const u8 **cursor, size_t *max, struct pubkey *pubkey)
if (!fromwire(cursor, max, der, sizeof(der)))
return;
/* FIXME: Handing dummy keys through here is dumb.
* See towire_gossip_resolve_channel_reply --RR */
if (!memeqzero(der, sizeof(der))
&& !pubkey_from_der(der, sizeof(der), pubkey))
if (!pubkey_from_der(der, sizeof(der), pubkey))
fromwire_fail(cursor, max);
}

View file

@ -50,12 +50,9 @@ void towire_pubkey(u8 **pptr, const struct pubkey *pubkey)
u8 output[PUBKEY_DER_LEN];
size_t outputlen = sizeof(output);
if (pubkey)
secp256k1_ec_pubkey_serialize(secp256k1_ctx, output, &outputlen,
&pubkey->pubkey,
SECP256K1_EC_COMPRESSED);
else
memset(output, 0, sizeof(output));
towire(pptr, output, outputlen);
}