wallet: fix scanning progress calculation for single block range
Summary:
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 is a backport of core#20344
Test Plan:
With UBSAN:
ninja && ninja check
Reviewers: #bitcoin_abc, deadalnix, Fabien
Reviewed By: #bitcoin_abc, deadalnix, Fabien
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D10193