type_to_string: support sha256_double.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-03-08 13:54:14 +10:30 committed by Christian Decker
parent 61e3c0c23e
commit 5eea772c53
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "shadouble.h"
#include <ccan/mem/mem.h>
#include <common/type_to_string.h>
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);

View File

@ -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;