From 5eea772c5390757234e75a297a0acc338edcd42b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Mar 2018 13:54:14 +1030 Subject: [PATCH] type_to_string: support sha256_double. Signed-off-by: Rusty Russell --- bitcoin/shadouble.c | 2 ++ common/type_to_string.h | 1 + 2 files changed, 3 insertions(+) diff --git a/bitcoin/shadouble.c b/bitcoin/shadouble.c index c229b9744..01b51a2db 100644 --- a/bitcoin/shadouble.c +++ b/bitcoin/shadouble.c @@ -1,5 +1,6 @@ #include "shadouble.h" #include +#include void sha256_double(struct sha256_double *shadouble, const void *p, size_t len) { @@ -12,3 +13,4 @@ void sha256_double_done(struct sha256_ctx *shactx, struct sha256_double *res) sha256_done(shactx, &res->sha); sha256(&res->sha, &res->sha, sizeof(res->sha)); } +REGISTER_TYPE_TO_HEXSTR(sha256_double); diff --git a/common/type_to_string.h b/common/type_to_string.h index d0b6b12ea..bee4cbd67 100644 --- a/common/type_to_string.h +++ b/common/type_to_string.h @@ -11,6 +11,7 @@ union printable_types { const struct bitcoin_txid *bitcoin_txid; const struct bitcoin_blkid *bitcoin_blkid; const struct sha256 *sha256; + const struct sha256_double *sha256_double; const struct ripemd160 *ripemd160; const struct rel_locktime *rel_locktime; const struct abs_locktime *abs_locktime;