| 39 | // ---------------------------------------------------------------------------- |
| 40 | |
| 41 | VanitySearch::VanitySearch(Secp256K1 *secp, vector<std::string> &inputPrefixes,string seed,int searchMode, |
| 42 | bool useGpu, bool stop, string outputFile, bool useSSE, uint32_t maxFound, |
| 43 | uint64_t rekey, bool caseSensitive, Point &startPubKey, bool paranoiacSeed) |
| 44 | :inputPrefixes(inputPrefixes) { |
| 45 | |
| 46 | this->secp = secp; |
| 47 | this->searchMode = searchMode; |
| 48 | this->useGpu = useGpu; |
| 49 | this->stopWhenFound = stop; |
| 50 | this->outputFile = outputFile; |
| 51 | this->useSSE = useSSE; |
| 52 | this->nbGPUThread = 0; |
| 53 | this->maxFound = maxFound; |
| 54 | this->rekey = rekey; |
| 55 | this->searchType = -1; |
| 56 | this->startPubKey = startPubKey; |
| 57 | this->hasPattern = false; |
| 58 | this->caseSensitive = caseSensitive; |
| 59 | this->startPubKeySpecified = !startPubKey.isZero(); |
| 60 | |
| 61 | lastRekey = 0; |
| 62 | prefixes.clear(); |
| 63 | |
| 64 | // Create a 65536 items lookup table |
| 65 | PREFIX_TABLE_ITEM t; |
| 66 | t.found = true; |
| 67 | t.items = NULL; |
| 68 | for(int i=0;i<65536;i++) |
| 69 | prefixes.push_back(t); |
| 70 | |
| 71 | // Check is inputPrefixes contains wildcard character |
| 72 | for (int i = 0; i < (int)inputPrefixes.size() && !hasPattern; i++) { |
| 73 | hasPattern = ((inputPrefixes[i].find('*') != std::string::npos) || |
| 74 | (inputPrefixes[i].find('?') != std::string::npos) ); |
| 75 | } |
| 76 | |
| 77 | if (!hasPattern) { |
| 78 | |
| 79 | // No wildcard used, standard search |
| 80 | // Insert prefixes |
| 81 | bool loadingProgress = (inputPrefixes.size() > 1000); |
| 82 | if (loadingProgress) |
| 83 | printf("[Building lookup16 0.0%%]\r"); |
| 84 | |
| 85 | nbPrefix = 0; |
| 86 | onlyFull = true; |
| 87 | for (int i = 0; i < (int)inputPrefixes.size(); i++) { |
| 88 | |
| 89 | PREFIX_ITEM it; |
| 90 | std::vector<PREFIX_ITEM> itPrefixes; |
| 91 | |
| 92 | if (!caseSensitive) { |
| 93 | |
| 94 | // For caseunsensitive search, loop through all possible combination |
| 95 | // and fill up lookup table |
| 96 | vector<string> subList; |
| 97 | enumCaseUnsentivePrefix(inputPrefixes[i], subList); |
| 98 |
nothing calls this directly
no test coverage detected