Stop building witnesses if shutdown requested, fixes #330

This commit is contained in:
Duke
2023-10-23 09:49:50 -04:00
parent 41d6d037d8
commit ae0ff73548

View File

@@ -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() );