. Bitcoind represents hashes as little-endian for RPC. */
| 88 | |
| 89 | /* <sigh>. Bitcoind represents hashes as little-endian for RPC. */ |
| 90 | static inline void reverse_bytes(u8 *arr, size_t len) |
| 91 | { |
| 92 | unsigned int i; |
| 93 | |
| 94 | for (i = 0; i < len / 2; i++) { |
| 95 | unsigned char tmp = arr[i]; |
| 96 | arr[i] = arr[len - 1 - i]; |
| 97 | arr[len - 1 - i] = tmp; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | /* Parse hex string to get txid (reversed, a-la bitcoind). */ |
| 102 | bool bitcoin_txid_from_hex(const char *hexstr, size_t hexstr_len, |
no outgoing calls