Browse Source

base58: Add function to just parse a ripemd160 hash

This is an intermediate step since the only difference between p2pkh and p2sh
is the argument that the parsing functions take, and parsing twice for that
reason alone is quite useless.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
htlc_accepted_hook
Christian Decker 6 years ago
parent
commit
5d185f43a8
  1. 6
      bitcoin/base58.c
  2. 4
      bitcoin/base58.h

6
bitcoin/base58.c

@ -103,6 +103,12 @@ bool p2sh_from_base58(bool *test_net,
return true;
}
bool ripemd160_from_base58(u8 *version, struct ripemd160 *rmd,
const char *base58, size_t base58_len)
{
return from_base58(version, rmd, base58, base58_len);
}
bool key_from_base58(const char *base58, size_t base58_len,
bool *test_net, struct privkey *priv, struct pubkey *key)
{

4
bitcoin/base58.h

@ -29,4 +29,8 @@ bool p2sh_from_base58(bool *test_net,
bool key_from_base58(const char *base58, size_t base58_len,
bool *test_net, struct privkey *priv, struct pubkey *key);
/* Decode a p2pkh or p2sh into the ripemd160 hash */
bool ripemd160_from_base58(u8 *version, struct ripemd160 *rmd,
const char *base58, size_t base58_len);
#endif /* LIGHTNING_BITCOIN_BASE58_H */

Loading…
Cancel
Save