mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
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:
@@ -19,6 +19,7 @@ type2size = {
|
||||
'struct pubkey': 33,
|
||||
'struct sha256': 32,
|
||||
'struct sha256_double': 32,
|
||||
'struct bitcoin_txid': 32,
|
||||
'u64': 8,
|
||||
'u32': 4,
|
||||
'u16': 2,
|
||||
@@ -78,6 +79,7 @@ partialtypemap = {
|
||||
'features': FieldType('u8'),
|
||||
'channel_id': FieldType('struct channel_id'),
|
||||
'chain_hash': FieldType('struct sha256_double'),
|
||||
'funding_txid': FieldType('struct bitcoin_txid'),
|
||||
'pad': FieldType('pad'),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user