protocol: remove support for uncompressed pubkeys.

There's no good reason to support them, and this way every key is 33 bytes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-03-30 16:54:16 +10:30
parent 8c468c1e15
commit b6943b9198
10 changed files with 20 additions and 49 deletions

View File

@@ -102,7 +102,7 @@ static void add_number(u8 **script, u32 num)
static void add_push_key(u8 **scriptp, const struct pubkey *key)
{
add_push_bytes(scriptp, key->der, pubkey_derlen(key));
add_push_bytes(scriptp, key->der, sizeof(key->der));
}
static void add_push_sig(u8 **scriptp, const struct bitcoin_signature *sig)
@@ -129,11 +129,7 @@ static void add_push_sig(u8 **scriptp, const struct bitcoin_signature *sig)
/* Is a < b? (If equal we don't care) */
static bool key_less(const struct pubkey *a, const struct pubkey *b)
{
/* Shorter one wins. */
if (pubkey_derlen(a) != pubkey_derlen(b))
return pubkey_derlen(a) < pubkey_derlen(b);
return memcmp(a->der, b->der, pubkey_derlen(a)) < 0;
return memcmp(a->der, b->der, sizeof(a->der)) < 0;
}
/* tal_count() gives the length of the script. */