@@ -52,14 +52,14 @@ fn device_main(
5252 loop {
5353 let rng_seed: u64 = rng. r#gen :: < u64 > ( ) ;
5454
55- let mut found_flag_slice = [ 0.0f32 ; 1 ] ;
55+ let mut found_matches_slice = [ 0.0f32 ; 1 ] ;
5656 let mut found_private_key = [ 0u8 ; 32 ] ;
5757 let mut found_public_key = [ 0u8 ; 32 ] ;
5858 let mut found_bs58_encoded_public_key = [ 0u8 ; 64 ] ;
5959 let mut found_thread_idx_slice = [ 0u32 ; 1 ] ;
6060
6161 let vanity_prefix_dev = vanity_prefix_bytes. as_dbuf ( ) ?;
62- let found_flag_slice_dev = found_flag_slice . as_dbuf ( ) ?;
62+ let found_matches_slice_dev = found_matches_slice . as_dbuf ( ) ?;
6363 let found_private_key_dev = found_private_key. as_dbuf ( ) ?;
6464 let found_public_key_dev = found_public_key. as_dbuf ( ) ?;
6565 let found_bs58_encoded_public_key_dev = found_bs58_encoded_public_key. as_dbuf ( ) ?;
@@ -73,7 +73,7 @@ fn device_main(
7373 vanity_prefix_dev. as_device_ptr( ) ,
7474 vanity_prefix_len,
7575 rng_seed,
76- found_flag_slice_dev . as_device_ptr( ) ,
76+ found_matches_slice_dev . as_device_ptr( ) ,
7777 found_private_key_dev. as_device_ptr( ) ,
7878 found_public_key_dev. as_device_ptr( ) ,
7979 found_bs58_encoded_public_key_dev. as_device_ptr( ) ,
@@ -88,30 +88,28 @@ fn device_main(
8888 global_stats. add_launch ( operations_per_launch) ;
8989
9090 // Check if we found a match
91- found_flag_slice_dev . copy_to ( & mut found_flag_slice ) ?;
91+ found_matches_slice_dev . copy_to ( & mut found_matches_slice ) ?;
9292
93- if found_flag_slice[ 0 ] != 0.0 {
93+ let found_matches = found_matches_slice[ 0 ] ;
94+ if found_matches != 0.0 {
9495 // We found a match! Copy results back to host
9596 found_private_key_dev. copy_to ( & mut found_private_key) ?;
9697 found_public_key_dev. copy_to ( & mut found_public_key) ?;
9798 found_bs58_encoded_public_key_dev. copy_to ( & mut found_bs58_encoded_public_key) ?;
9899 found_thread_idx_slice_dev. copy_to ( & mut found_thread_idx_slice) ?;
99100
100- global_stats. add_matches ( found_flag_slice [ 0 ] as usize ) ;
101+ global_stats. add_matches ( found_matches as usize ) ;
101102
102103 // Format results
103104 let found_thread_idx = found_thread_idx_slice[ 0 ] ;
104105 let wallet_formatted_result = hex:: encode ( [ found_private_key, found_public_key] . concat ( ) ) ;
105- let public_key_string = String :: from_utf8 ( found_bs58_encoded_public_key. to_vec ( ) ) . unwrap ( ) ;
106+ let encoded_public_key_string = String :: from_utf8 ( found_bs58_encoded_public_key. to_vec ( ) ) . unwrap ( ) ;
107+ println ! ( "[{ordinal}] First match: seed = {rng_seed} thread_idx = {found_thread_idx} encoded_public_key = {encoded_public_key_string} wallet = {wallet_formatted_result}" ) ;
106108
107109 // Print stats using global counters
108110 global_stats. print_stats (
109111 ordinal,
110- found_flag_slice[ 0 ] ,
111- & public_key_string,
112- & wallet_formatted_result,
113- rng_seed,
114- found_thread_idx
112+ found_matches,
115113 ) ;
116114 }
117115 }
0 commit comments