mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
type_to_string: add secp256k1_ecdsa_signature.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
25a37fafae
commit
7d68554787
@ -4,6 +4,7 @@
|
||||
#include "shadouble.h"
|
||||
#include "signature.h"
|
||||
#include "tx.h"
|
||||
#include "type_to_string.h"
|
||||
#include "utils.h"
|
||||
#include <assert.h>
|
||||
#include <ccan/cast/cast.h>
|
||||
@ -254,3 +255,13 @@ bool sig_valid(const secp256k1_ecdsa_signature *sig)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static char *signature_to_hexstr(const tal_t *ctx,
|
||||
const secp256k1_ecdsa_signature *sig)
|
||||
{
|
||||
u8 der[72];
|
||||
size_t len = signature_to_der(der, sig);
|
||||
|
||||
return tal_hexstr(ctx, der, len);
|
||||
}
|
||||
REGISTER_TYPE_TO_STRING(secp256k1_ecdsa_signature, signature_to_hexstr);
|
||||
|
@ -21,6 +21,7 @@ union printable_types {
|
||||
const secp256k1_pubkey *secp256k1_pubkey;
|
||||
const struct channel_id *channel_id;
|
||||
const struct privkey *privkey;
|
||||
const secp256k1_ecdsa_signature *secp256k1_ecdsa_signature;
|
||||
const char *charp_;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user