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

Function reverse_bytes

bitcoin/tx.c:643–652  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

641
642/* <sigh>. Bitcoind represents hashes as little-endian for RPC. */
643static void reverse_bytes(u8 *arr, size_t len)
644{
645 unsigned int i;
646
647 for (i = 0; i < len / 2; i++) {
648 unsigned char tmp = arr[i];
649 arr[i] = arr[len - 1 - i];
650 arr[len - 1 - i] = tmp;
651 }
652}
653
654bool bitcoin_txid_from_hex(const char *hexstr, size_t hexstr_len,
655 struct bitcoin_txid *txid)

Callers 3

bitcoin_txid_from_hexFunction · 0.85
bitcoin_txid_to_hexFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68