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

Function to_base58

bitcoin/base58.c:12–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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