@@ -151,12 +151,14 @@ static size_t btc_get_address(const uint8_t *seed,
151151 char * address );
152152
153153/**
154- * @brief Takes and sends the uncompressed public key to the host as
154+ * @brief Takes and sends the uncompressed public key and address to the host as
155155 * btc_result_t
156156 *
157157 * @param public_key An immutable reference to uncompressed public key buffer
158+ * @param address An immutable reference to the address buffer
158159 */
159- static void send_public_key (const uint8_t * public_key );
160+ static void send_public_key_response (const uint8_t * public_key ,
161+ const char * address );
160162
161163/*****************************************************************************
162164 * STATIC VARIABLES
@@ -260,11 +262,13 @@ static size_t btc_get_address(const uint8_t *seed,
260262 return address_length ;
261263}
262264
263- static void send_public_key (const uint8_t * public_key ) {
265+ static void send_public_key_response (const uint8_t * public_key ,
266+ const char * address ) {
264267 btc_result_t response = init_btc_result (BTC_RESULT_GET_PUBLIC_KEY_TAG );
265268 response .get_public_key .which_response =
266269 BTC_GET_PUBLIC_KEY_RESPONSE_RESULT_TAG ;
267270 memcpy (response .get_public_key .result .public_key , public_key , 65 );
271+ memcpy (response .get_public_key .result .address , address , strnlen (address , 70 ));
268272 btc_send_result (& response );
269273}
270274
@@ -328,7 +332,7 @@ void btc_get_pub_key(btc_query_t *query) {
328332 if (0 < length &&
329333 true == core_scroll_page (ui_text_receive_on , msg , btc_send_error )) {
330334 set_app_flow_status (BTC_GET_PUBLIC_KEY_STATUS_VERIFY );
331- send_public_key (public_key );
335+ send_public_key_response (public_key , msg );
332336 delay_scr_init (ui_text_check_cysync_app , DELAY_TIME );
333337 }
334338}
0 commit comments