mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
type_to_string: add secp256k1_ecdsa_signature.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "shadouble.h"
|
#include "shadouble.h"
|
||||||
#include "signature.h"
|
#include "signature.h"
|
||||||
#include "tx.h"
|
#include "tx.h"
|
||||||
|
#include "type_to_string.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ccan/cast/cast.h>
|
#include <ccan/cast/cast.h>
|
||||||
@@ -254,3 +255,13 @@ bool sig_valid(const secp256k1_ecdsa_signature *sig)
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
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 secp256k1_pubkey *secp256k1_pubkey;
|
||||||
const struct channel_id *channel_id;
|
const struct channel_id *channel_id;
|
||||||
const struct privkey *privkey;
|
const struct privkey *privkey;
|
||||||
|
const secp256k1_ecdsa_signature *secp256k1_ecdsa_signature;
|
||||||
const char *charp_;
|
const char *charp_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user