Merge #13079: Fix rescanblockchain rpc to properly report progress
Summary:
16be13345 Fix rescanblockchain rpc to property report progress (Ben Woosley)
Pull request description:
Previously it assumed tip in all cases. This also extracts a RescanVerificationProgress helper object whose role is to manage reporting, in order to simplify ScanForWalletTransactions - more lines in total, but much simpler to follow the core logic.
Tree-SHA512: 5ebed0c56fae4ccfe613ff1d7082cb6da5a86635a8993ed3af70b500a4ea43074121aea9219b2f0321fbfeb7efcb964bdc2199297a64ca0fa85d9d07aa637d40
Backport of Core PR13079
https://github.com/bitcoin/bitcoin/pull/13079/
Test Plan:
make check ./bitcoind --printtoconsole ./bitcoin-cli rescanblockchain 0 1300000
Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc
Reviewed By: deadalnix, Fabien, O1 Bitcoin ABC, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D4112