@@ -1134,24 +1134,15 @@ function triggertx_function(trigger_elem) {
11341134 triggertx_function ( trigger_elem ) ;
11351135 return
11361136 }
1137- const use_random = cs_node ( currency , "Use random address" , true ) . selected ,
1138- derives = check_derivations ( currency ) ,
1139- address_list = filter_addressli ( currency , "checked" , true ) ,
1140- first_address = address_list . first ( ) ,
1141- manual_addresses = address_list . not ( ".seed" ) ,
1142- address_count = manual_addresses . length ,
1143- random_pool = ( address_count > 1 ) ? manual_addresses : first_address ,
1144- random_index = generate_random_number ( 1 , address_count ) - 1 ,
1145- selected_address = ( use_random === true ) ? ( first_address . hasClass ( "seed" ) ) ? first_address : manual_addresses . eq ( random_index ) : first_address ,
1146- address_data = selected_address . data ( ) ;
1137+ const address_data = get_address_data ( currency ) ;
11471138 if ( address_data ) {
11481139 const wallet_address = address_data . address ,
11491140 request_title = trigger_elem . attr ( "title" ) ,
11501141 saved_url = trigger_elem . data ( "url" ) ,
11511142 seed_id = address_data . seedid ;
11521143 if ( seed_id ) {
11531144 if ( seed_id != glob_let . bipid ) {
1154- if ( addr_whitelist ( wallet_address ) === true ) { } else {
1145+ if ( ! addr_whitelist ( wallet_address ) ) {
11551146 const dialog_data = {
11561147 "currency" : currency ,
11571148 "address" : wallet_address ,
@@ -1387,7 +1378,7 @@ function toggle_address() {
13871378 if ( address_item . hasClass ( "seedu" ) ) {
13881379 const wallet_address = address_data . address ,
13891380 seed_id = address_data . seedid ;
1390- if ( addr_whitelist ( wallet_address ) !== true ) {
1381+ if ( ! addr_whitelist ( wallet_address ) ) {
13911382 const dialog_data = {
13921383 "address" : wallet_address ,
13931384 "pli" : address_item ,
@@ -1399,7 +1390,7 @@ function toggle_address() {
13991390 }
14001391 } else if ( address_item . hasClass ( "xpubu" ) ) {
14011392 const wallet_address = address_data . address ;
1402- if ( addr_whitelist ( wallet_address ) !== true ) {
1393+ if ( ! addr_whitelist ( wallet_address ) ) {
14031394 const has_pub_key = has_xpub ( currency ) ,
14041395 pub_key_id = address_data . xpubid ;
14051396 if ( has_pub_key === false || ( has_pub_key && has_pub_key . key_id != pub_key_id ) ) {
@@ -2646,7 +2637,7 @@ function newrequest() {
26462637 seed_id = addr_data . seedid ;
26472638 if ( seed_id ) {
26482639 if ( seed_id !== glob_let . bipid ) {
2649- if ( addr_whitelist ( address ) !== true ) {
2640+ if ( ! addr_whitelist ( address ) ) {
26502641 const warning_data = {
26512642 "currency" : currency ,
26522643 "address" : address ,
@@ -2755,24 +2746,12 @@ function addressinfo() {
27552746 $ ( document ) . on ( "click" , ".address_info" , function ( ) {
27562747 const dialog_wrap = $ ( this ) . closest ( "ul" ) ,
27572748 dialog_data = dialog_wrap . data ( ) ,
2758- label = dialog_data . label || dialog_data . a_id || "" ,
27592749 currency = dialog_data . currency ,
2760- hasbip32 = has_bip32 ( currency ) ,
2761- bip32_data = hasbip32 ? get_bip32dat ( currency ) : null ,
2762- seed_id = dialog_data . seedid ,
2763- xpub_id = dialog_data . xpubid ,
2764- view_key = dialog_data . vk ,
2765- source_type = seed_id ? "seed" : xpub_id ? "xpub" : false ,
2766- is_seed = source_type === "seed" ,
2767- xpub = source_type === "xpub" ,
2768- active_xpub_data = active_xpub ( currency ) ,
2769- is_active_source = is_seed ? ( seed_id === glob_let . bipid ) : ( xpub ? ( active_xpub_data && xpub_id === active_xpub_data . key_id ) : false ) ,
2770- address = dialog_data . address ,
2771- addr_whitelist_status = addr_whitelist ( address ) ,
2772- restore_btn = is_seed ? ( glob_let . hasbip === true ) ? "" : "<div id='rest_seed' class='ref' data-seedid='" + seed_id + "'>" + tl ( "resoresecretphrase" ) + "</div>" : "" ,
2773- source_label = source_type ? ( is_active_source ) ? source_type + " <span class='icon-checkmark'>" : source_type + " (Unavailable)" + restore_btn : "external" ,
27742750 derive_index = dialog_data . derive_index ,
2775- purpose = dialog_data . purpose ;
2751+ purpose = dialog_data . purpose ,
2752+ address = dialog_data . address ,
2753+ hasbip32 = has_bip32 ( currency ) ,
2754+ bip32_data = hasbip32 ? get_bip32dat ( currency ) : null ;
27762755 let deriv_path = bip32_data ? bip32_data . root_path + derive_index : "" ;
27772756 if ( purpose ) {
27782757 const path_parts = deriv_path . split ( "/" ) ;
@@ -2783,15 +2762,27 @@ function addressinfo() {
27832762 dialog_data . bip32dat = bip32_data ,
27842763 dialog_data . address = address ;
27852764 const currency_icon = getcc_icon ( dialog_data . cmcid , dialog_data . ccsymbol + "-" + currency , dialog_data . erc20 ) ,
2786- path_info = is_seed ? "<li><strong>" + tl ( "derivationpath" ) + ":</strong> " + deriv_path + "</li>" : "" ,
2765+ xpub_id = dialog_data . xpubid ,
2766+ seed_id = dialog_data . seedid ,
2767+ source_type = seed_id ? "seed" : xpub_id ? "xpub" : false ,
27872768 pk_verified = "Unknown <span class='icon-checkmark'></span>" ,
2769+ show_label = tl ( "show" ) ,
2770+ addr_whitelist_status = addr_whitelist ( address ) ,
2771+ active_xpub_data = active_xpub ( currency ) ,
2772+ xpub = source_type === "xpub" ,
2773+ is_seed = source_type === "seed" ,
2774+ is_active_source = is_seed ? ( seed_id === glob_let . bipid ) : ( xpub ? ( active_xpub_data && xpub_id === active_xpub_data . key_id ) : false ) ,
2775+ view_key = dialog_data . vk ,
27882776 view_key_obj = view_key ? vk_obj ( view_key ) : false ,
27892777 view_key_data = view_key_obj ? ( is_seed && is_active_source ? "derive" : view_key_obj . vk ) : false ,
2790- show_label = tl ( "show" ) ,
27912778 pk_display = view_key_data ? "<span id='show_vk' class='ref' data-vk='" + view_key_data + "'>" + show_label + "</span>" :
2792- ( is_seed ? ( is_active_source ? "<span id='show_pk' class='ref'>" + show_label + "</span>" :
2793- ( addr_whitelist_status === true ? pk_verified : "Unknown" ) ) : pk_verified ) ;
2794- privatekey_label = tl ( "privatekey" ) ,
2779+ is_seed ? is_active_source ? "<span id='show_pk' class='ref'>" + show_label + "</span>" :
2780+ addr_whitelist_status ? pk_verified : "Unknown" : pk_verified ,
2781+ privatekey_label = tl ( "privatekey" ) ,
2782+ label = dialog_data . label || dialog_data . a_id || "" ,
2783+ restore_btn = is_seed ? ( glob_let . hasbip === true ) ? "" : "<div id='rest_seed' class='ref' data-seedid='" + seed_id + "'>" + tl ( "resoresecretphrase" ) + "</div>" : "" ,
2784+ source_label = source_type ? ( is_active_source ) ? source_type + " <span class='icon-checkmark'>" : source_type + " (Unavailable)" + restore_btn : "external" ,
2785+ path_info = is_seed ? "<li><strong>" + tl ( "derivationpath" ) + ":</strong> " + deriv_path + "</li>" : "" ,
27952786 info_content = $ ( "<div id='ad_info_wrap'><h2>" + currency_icon + " <span>" + label + "</span></h2><ul>\
27962787 <li><strong>" + tl ( "address" ) + ": </strong><span class='adbox adboxl select'>" + address + "</span>\
27972788 <div id='qrcodea' class='qrwrap flex'><div class='qrcode'></div>" + currency_icon + "</div>\
@@ -3692,7 +3683,7 @@ function recent_requests_list(recent_payments) {
36923683 explorer_url = blockexplorer_url ( currency , false , is_erc20 , tx_source , eth_layer ) + wallet_addr ;
36933684 request_html += "<li class='rp_li'>" + getcc_icon ( coin_id , coin_symbol + "-" + currency , is_erc20 ) + "<strong style='opacity:0.5'>" + short_date ( request_time ) + "</strong><br/>\
36943685 <a href='" + explorer_url + "' target='_blank' class='ref check_recent'>\
3695- <span class='select'>" + wallet_addr + "</span> <span class='icon-new-tab'></a></li>" ;
3686+ <span class='select'>" + wallet_addr + "</span> <span class='icon-new-tab'></span></ a></li>" ;
36963687 }
36973688 } ) ;
36983689 return request_html ;
0 commit comments