| 652 | } |
| 653 | |
| 654 | bool bitcoin_txid_from_hex(const char *hexstr, size_t hexstr_len, |
| 655 | struct bitcoin_txid *txid) |
| 656 | { |
| 657 | if (!hex_decode(hexstr, hexstr_len, txid, sizeof(*txid))) |
| 658 | return false; |
| 659 | reverse_bytes(txid->shad.sha.u.u8, sizeof(txid->shad.sha.u.u8)); |
| 660 | return true; |
| 661 | } |
| 662 | |
| 663 | bool bitcoin_txid_to_hex(const struct bitcoin_txid *txid, |
| 664 | char *hexstr, size_t hexstr_len) |