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

Function to_base58

bitcoin/base58.c:15–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <wally_core.h>
14
15static char *to_base58(const tal_t *ctx, u8 version,
16 const struct ripemd160 *rmd)
17{
18 char *out;
19 size_t total_length = sizeof(*rmd) + 1;
20 u8 buf[total_length];
21 buf[0] = version;
22 memcpy(buf + 1, rmd, sizeof(*rmd));
23
24 tal_wally_start();
25 if (wally_base58_from_bytes((const unsigned char *) buf,
26 total_length, BASE58_FLAG_CHECKSUM, &out)
27 != WALLY_OK)
28 out = NULL;
29 tal_wally_end_onto(ctx, out, char);
30
31 return out;
32}
33
34char *bitcoin_to_base58(const tal_t *ctx, const struct chainparams *chainparams,
35 const struct bitcoin_address *addr)

Callers 2

bitcoin_to_base58Function · 0.85
p2sh_to_base58Function · 0.85

Calls 1

tal_wally_startFunction · 0.85

Tested by

no test coverage detected