MCPcopy Create free account
hub / github.com/ElementsProject/lightning / reverse_bytes

Function reverse_bytes

bitcoin/tx.h:90–99  ·  view source on GitHub ↗

. Bitcoind represents hashes as little-endian for RPC. */

Source from the content-addressed store, hash-verified

88
89/* <sigh>. Bitcoind represents hashes as little-endian for RPC. */
90static 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). */
102bool bitcoin_txid_from_hex(const char *hexstr, size_t hexstr_len,

Callers 6

bitcoin_txid_from_hexFunction · 0.85
bitcoin_txid_to_hexFunction · 0.85
bitcoin_blkid_from_hexFunction · 0.85
bitcoin_blkid_to_hexFunction · 0.85
mainFunction · 0.85
do_account_eventsFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68