wallet: fix scanning progress calculation for single block range

If the blockchain is rescanned for a single block (i.e. start and stop hashes
are equal, and with that also the estimated verification progress) the progress
calculation could lead to a NaN value caused by a division by zero, resulting in
an invalid JSON result for the getwalletinfo RPC.  Fixed by setting the progress
to zero in that special case.

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
Sebastian Falbesoner
2020-11-08 18:37:47 +01:00
parent 7e373294a5
commit 5e146022da
2 changed files with 5 additions and 2 deletions

View File

@@ -1,7 +1,6 @@
# -fsanitize=undefined suppressions
# =================================
float-divide-by-zero:validation.cpp
float-divide-by-zero:wallet/wallet.cpp
# -fsanitize=integer suppressions
# ===============================