bitcoin: create new wrapper type bitcoin_txid, log backward endianness.

It's just a sha256_double, but importantly when we convert it to a
string (in type_to_string, which is used in logging) we use
bitcoin_txid_to_hex() so it's reversed as people expect.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-12-18 17:11:52 +10:30
parent ed2158c334
commit 0237e0b28c
46 changed files with 181 additions and 171 deletions

View File

@@ -7,7 +7,6 @@
#include <common/initial_commit_tx.h>
struct keyset;
struct sha256_double;
/**
* commit_tx_num_untrimmed: how many of these htlc outputs will commit tx have?
@@ -43,7 +42,7 @@ size_t commit_tx_num_untrimmed(const struct htlc **htlcs,
* transaction, so we carefully use the terms "self" and "other" here.
*/
struct bitcoin_tx *commit_tx(const tal_t *ctx,
const struct sha256_double *funding_txid,
const struct bitcoin_txid *funding_txid,
unsigned int funding_txout,
u64 funding_satoshis,
enum side funder,