Skip to content

Commit

Permalink
skip output/bloom if input proc fn returns nonzero
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancdotorg committed Oct 31, 2015
1 parent 67efaa4 commit 169691f
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions brainflayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,27 +498,28 @@ int main(int argc, char **argv) {
if (nopt_mod && raw_lines % nopt_mod != nopt_rem) { continue; }
}
line[line_read] = 0;
input2hash160(line, line_read);
if (bloom) {
if (bloom_chk_hash160(bloom, hash160_uncmp.ul)) {
if (!fopt || hsearchf(ffile, &hash160_uncmp)) {
if (vopt && ofile == stdout && isatty(fileno(stdout))) fprintf(ofile, "\033[0K");
fprintresult(ofile, &hash160_uncmp, 'u', topt, line);
++olines;
if (input2hash160(line, line_read) == 0) {
if (bloom) {
if (bloom_chk_hash160(bloom, hash160_uncmp.ul)) {
if (!fopt || hsearchf(ffile, &hash160_uncmp)) {
if (vopt && ofile == stdout && isatty(fileno(stdout))) fprintf(ofile, "\033[0K");
fprintresult(ofile, &hash160_uncmp, 'u', topt, line);
++olines;
}
}
}
if (bloom_chk_hash160(bloom, hash160_compr.ul)) {
if (!fopt || hsearchf(ffile, &hash160_compr)) {
if (vopt && ofile == stdout && isatty(fileno(stdout))) fprintf(ofile, "\033[0K");
fprintresult(ofile, &hash160_compr, 'c', topt, line);
++olines;
if (bloom_chk_hash160(bloom, hash160_compr.ul)) {
if (!fopt || hsearchf(ffile, &hash160_compr)) {
if (vopt && ofile == stdout && isatty(fileno(stdout))) fprintf(ofile, "\033[0K");
fprintresult(ofile, &hash160_compr, 'c', topt, line);
++olines;
}
}
} else if (Lopt) {
fprintlookup(ofile, &hash160_uncmp, &hash160_compr, priv256, topt, line);
} else {
fprintresult(ofile, &hash160_uncmp, 'u', topt, line);
fprintresult(ofile, &hash160_compr, 'c', topt, line);
}
} else if (Lopt) {
fprintlookup(ofile, &hash160_uncmp, &hash160_compr, priv256, topt, line);
} else {
fprintresult(ofile, &hash160_uncmp, 'u', topt, line);
fprintresult(ofile, &hash160_compr, 'c', topt, line);
}
} else {
if (!vopt) break;
Expand Down

0 comments on commit 169691f

Please sign in to comment.