Skip to content

Commit b2b688a

Browse files
Merge #994: Correct progress display on searchdeterministiczerocoin
cdc2349 Correct progress display on searchdeterministiczerocoin (Zannick) Pull request description: ## Issue The progress bar shown in veil-qt on running `searchdeterministiczerocoin` works fine when starting from 0, but is stuck at 1% for other starting values. ## Solution The progress items of the individual threads have already accounted for their start points, so we don't need to subtract the overall start point again. ## Testing Run e.g. `searchdeterministiczerocoin 100 100 2`. Tree-SHA512: 68825b5831972298236c11494ef50dc68592668afd120eeda913b1227ced74b8cd719bee17ff6cdf4a3403e7b580145274157566a91aaffd65f8b442703e47ff
2 parents 0354b87 + cdc2349 commit b2b688a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/veil/zerocoin/zwallet.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ bool CzWallet::DeterministicSearch(int nCountStart, int nCountEnd, int* nThreade
392392
}
393393
}
394394

395-
int percentageDone = std::max(1, std::min(99, (int)((progress_current - progress_begin) / (progress_end - progress_begin) * 100)));
395+
// items complete = progress_current
396+
// items total = progress_end - progress_begin
397+
int percentageDone = std::max(1, std::min(99, (int)(progress_current / (progress_end - progress_begin) * 100)));
396398
uiInterface.ShowProgress(_("Searching..."), percentageDone, 0);
397399
}
398400
if (nThreadedProgress == nullptr) {

0 commit comments

Comments
 (0)