diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 96d01260d..1acb274df 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1146,6 +1146,9 @@ void CWallet::BuildWitnessCache(const CBlockIndex* pindex, bool witnessOnly) LogPrintf("%s: height=%d, startHeight=%d\n", __func__, height, startHeight); while (pblockindex) { + if (ShutdownRequested()) { + break; + } if (pblockindex->GetHeight() % 100 == 0 && pblockindex->GetHeight() < height - 5) { LogPrintf("Building Witnesses for block %i %.4f complete, %d remaining\n", pblockindex->GetHeight(), pblockindex->GetHeight() / double(height), height - pblockindex->GetHeight() );