Fixes #10987.
Here are the steps to test the feature:
- start bitcoind, generate a couple of transactions and then stop:
0bitcoind -regtest -printtoconsole
1bitcoin-cli -regtest generate 100
- apply the following patch
0diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
1index 2478d67ce..8f8cea40c 100644
2--- a/src/wallet/wallet.cpp
3+++ b/src/wallet/wallet.cpp
4@@ -1671,6 +1671,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
5 }
6 while (pindex && !fAbortRescan && !ShutdownRequested())
7 {
8+ MilliSleep(500);
9 if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) {
10 double gvp = 0;
11 {
- start bitcoind with rescan flag, interrupt with CTRL+C and the output should look like:
0bitcoind -regtest -printtoconsole -rescan
1...
2^C2018-02-22 01:00:55 AddToWallet e8bfb4501b630ad2acb91e88ab0112a779766536d2c564b04faae45ae90e18f7
32018-02-22 01:00:55 Rescan interrupted by shutdown request at block 5. Progress=1.000000
42018-02-22 01:00:55 rescan 1774ms
52018-02-22 01:00:55 setKeyPool.size() = 1995
62018-02-22 01:00:55 mapWallet.size() = 10145
72018-02-22 01:00:55 mapAddressBook.size() = 3
82018-02-22 01:00:55 Shutdown: In progress...
92018-02-22 01:00:55 scheduler thread interrupt
102018-02-22 01:00:55 Shutdown: done