MCPcopy Create free account
hub / github.com/JeanLucPons/VanitySearch / updateFound

Method updateFound

Vanity.cpp:729–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727// ----------------------------------------------------------------------------
728
729void VanitySearch::updateFound() {
730
731 // Check if all prefixes has been found
732 // Needed only if stopWhenFound is asked
733 if (stopWhenFound) {
734
735 if (hasPattern) {
736
737 bool allFound = true;
738 for (int i = 0; i < (int)inputPrefixes.size(); i++) {
739 allFound &= patternFound[i];
740 }
741 endOfSearch = allFound;
742
743 } else {
744
745 bool allFound = true;
746 for (int i = 0; i < (int)usedPrefix.size(); i++) {
747 bool iFound = true;
748 prefix_t p = usedPrefix[i];
749 if (!prefixes[p].found) {
750 if (prefixes[p].items) {
751 for (int j = 0; j < (int)prefixes[p].items->size(); j++) {
752 iFound &= *((*prefixes[p].items)[j].found);
753 }
754 }
755 prefixes[usedPrefix[i]].found = iFound;
756 }
757 allFound &= iFound;
758 }
759 endOfSearch = allFound;
760
761 // Update difficulty to the next most probable item
762 _difficulty = getDiffuclty();
763
764 }
765
766 }
767
768}
769
770// ----------------------------------------------------------------------------
771

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected