Browse Source

type_to_string: support sha256_double.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
5eea772c53
  1. 2
      bitcoin/shadouble.c
  2. 1
      common/type_to_string.h

2
bitcoin/shadouble.c

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

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

Loading…
Cancel
Save