mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user