mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 22:34:21 +01:00
bitcoind: use correct endianness for block hashes.
Like txids, we need to reverse them. We didn't, but then we only used them to pass to/from bitcoind. We're about to get them from the block header, so we need to fix that. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -36,3 +36,15 @@ struct bitcoin_block *bitcoin_block_from_hex(const tal_t *ctx,
|
||||
tal_free(linear_tx);
|
||||
return b;
|
||||
}
|
||||
|
||||
bool bitcoin_blkid_from_hex(const char *hexstr, size_t hexstr_len,
|
||||
struct sha256_double *blockid)
|
||||
{
|
||||
return bitcoin_txid_from_hex(hexstr, hexstr_len, blockid);
|
||||
}
|
||||
|
||||
bool bitcoin_blkid_to_hex(const struct sha256_double *blockid,
|
||||
char *hexstr, size_t hexstr_len)
|
||||
{
|
||||
return bitcoin_txid_to_hex(blockid, hexstr, hexstr_len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user