Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
27e0ea2358
  1. 5
      wire/fromwire.c
  2. 3
      wire/towire.c

5
wire/fromwire.c

@ -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);
}

3
wire/towire.c

@ -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);
}

Loading…
Cancel
Save