diff --git a/bip32.c b/bip32.c index ce617150b..f5b8b3331 100644 --- a/bip32.c +++ b/bip32.c @@ -380,6 +380,12 @@ void hdnode_get_address_raw(HDNode *node, uint32_t version, uint8_t *addr_raw) ecdsa_get_address_raw(node->public_key, version, addr_raw); } +void hdnode_get_address(HDNode *node, uint32_t version, char *addr, int addrsize) +{ + hdnode_fill_public_key(node); + ecdsa_get_address(node->public_key, version, addr, addrsize); +} + void hdnode_fill_public_key(HDNode *node) { if (node->public_key[0] != 0) diff --git a/bip32.h b/bip32.h index 4095deb81..24f674860 100644 --- a/bip32.h +++ b/bip32.h @@ -84,6 +84,7 @@ int hdnode_deserialize(const char *str, HDNode *node); int hdnode_serialize(const HDNode *node, uint32_t fingerprint, uint32_t version, char use_public, char *str, int strsize); void hdnode_get_address_raw(HDNode *node, uint32_t version, uint8_t *addr_raw); +void hdnode_get_address(HDNode *node, uint32_t version, char *addr, int addrsize); const curve_info *get_curve_by_name(const char *curve_name);