| 6339 | |
| 6340 | |
| 6341 | bool readFileVanity(char *fileName) { |
| 6342 | FILE *fileDescriptor; |
| 6343 | int i,k,len; |
| 6344 | char aux[100],*hextemp; |
| 6345 | |
| 6346 | fileDescriptor = fopen(fileName,"r"); |
| 6347 | if(fileDescriptor == NULL) { |
| 6348 | if(vanity_rmd_targets == 0) { |
| 6349 | fprintf(stderr,"[E] There aren't any vanity targets\n"); |
| 6350 | return false; |
| 6351 | } |
| 6352 | } |
| 6353 | else { |
| 6354 | while(!feof(fileDescriptor)) { |
| 6355 | hextemp = fgets(aux,100,fileDescriptor); |
| 6356 | if(hextemp == aux) { |
| 6357 | trim(aux," \t\n\r"); |
| 6358 | len = strlen(aux); |
| 6359 | if(len > 0 && len < 36){ |
| 6360 | if(isValidBase58String(aux)) { |
| 6361 | addvanity(aux); |
| 6362 | } |
| 6363 | else { |
| 6364 | fprintf(stderr,"[E] the string \"%s\" is not valid Base58, omiting it\n",aux); |
| 6365 | } |
| 6366 | } |
| 6367 | } |
| 6368 | } |
| 6369 | fclose(fileDescriptor); |
| 6370 | } |
| 6371 | |
| 6372 | N = vanity_rmd_total; |
| 6373 | if(!initBloomFilter(vanity_bloom,N)) |
| 6374 | return false; |
| 6375 | |
| 6376 | |
| 6377 | for(i = 0;i < vanity_rmd_targets; i++) { |
| 6378 | for(k = 0; k < vanity_rmd_limits[i]; k++) { |
| 6379 | /* |
| 6380 | if(FLAGDEBUG) { |
| 6381 | printf("[D] i %i ; k %i\n",i,k); |
| 6382 | hextemp = tohex((char*)vanity_rmd_limit_values_A[i][k],vanity_rmd_minimun_bytes_check_length); |
| 6383 | printf("[D] Adding %s\n",hextemp); |
| 6384 | fflush(stdout); |
| 6385 | free(hextemp); |
| 6386 | } |
| 6387 | */ |
| 6388 | bloom_add(vanity_bloom, vanity_rmd_limit_values_A[i][k] ,vanity_rmd_minimun_bytes_check_length); |
| 6389 | } |
| 6390 | } |
| 6391 | return true; |
| 6392 | } |
| 6393 | |
| 6394 | bool readFileAddress(char *fileName) { |
| 6395 | FILE *fileDescriptor; |
no test coverage detected