| 6086 | |
| 6087 | |
| 6088 | bool readFileVanity(char *fileName) { |
| 6089 | FILE *fileDescriptor; |
| 6090 | int i,k,len; |
| 6091 | char aux[100],*hextemp; |
| 6092 | |
| 6093 | fileDescriptor = fopen(fileName,"r"); |
| 6094 | if(fileDescriptor == NULL) { |
| 6095 | if(vanity_rmd_targets == 0) { |
| 6096 | fprintf(stderr,"[E] There aren't any vanity targets\n"); |
| 6097 | return false; |
| 6098 | } |
| 6099 | } |
| 6100 | else { |
| 6101 | while(!feof(fileDescriptor)) { |
| 6102 | hextemp = fgets(aux,100,fileDescriptor); |
| 6103 | if(hextemp == aux) { |
| 6104 | trim(aux," \t\n\r"); |
| 6105 | len = strlen(aux); |
| 6106 | if(len > 0 && len < 36){ |
| 6107 | if(isValidBase58String(aux)) { |
| 6108 | addvanity(aux); |
| 6109 | } |
| 6110 | else { |
| 6111 | fprintf(stderr,"[E] the string \"%s\" is not valid Base58, omiting it\n",aux); |
| 6112 | } |
| 6113 | } |
| 6114 | } |
| 6115 | } |
| 6116 | fclose(fileDescriptor); |
| 6117 | } |
| 6118 | |
| 6119 | N = vanity_rmd_total; |
| 6120 | if(!initBloomFilter(vanity_bloom,N)) |
| 6121 | return false; |
| 6122 | |
| 6123 | for(i = 0; i < vanity_rmd_targets ; i++) { |
| 6124 | for(k = 0; k < vanity_rmd_limits[i]; k++) { |
| 6125 | bloom_add(vanity_bloom, vanity_rmd_limit_values_A[i][k] ,vanity_rmd_minimun_bytes_check_length); |
| 6126 | } |
| 6127 | } |
| 6128 | return true; |
| 6129 | } |
| 6130 | |
| 6131 | bool readFileAddress(char *fileName) { |
| 6132 | FILE *fileDescriptor; |
no test coverage detected