mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 19:53:27 +01:00
Drop upgrade-cancel callback registration for a generic "resumeable"
Instead of passing a StartShutdown reference all the way up from txdb, give ShowProgress a "resumeable" boolean, which is used to inform the user if the action will be resumed, but cancel is always allowed by just calling StartShutdown().
This commit is contained in:
@@ -3563,12 +3563,12 @@ bool LoadChainTip(const CChainParams& chainparams)
|
||||
|
||||
CVerifyDB::CVerifyDB()
|
||||
{
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), 0);
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), 0, false);
|
||||
}
|
||||
|
||||
CVerifyDB::~CVerifyDB()
|
||||
{
|
||||
uiInterface.ShowProgress("", 100);
|
||||
uiInterface.ShowProgress("", 100, false);
|
||||
}
|
||||
|
||||
bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth)
|
||||
@@ -3598,7 +3598,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
||||
LogPrintf("[%d%%]...", percentageDone);
|
||||
reportDone = percentageDone/10;
|
||||
}
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone);
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, false);
|
||||
if (pindex->nHeight < chainActive.Height()-nCheckDepth)
|
||||
break;
|
||||
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
|
||||
@@ -3649,7 +3649,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
||||
CBlockIndex *pindex = pindexState;
|
||||
while (pindex != chainActive.Tip()) {
|
||||
boost::this_thread::interruption_point();
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, 100 - (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * 50))));
|
||||
uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, 100 - (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * 50))), false);
|
||||
pindex = chainActive.Next(pindex);
|
||||
CBlock block;
|
||||
if (!ReadBlockFromDisk(block, pindex, chainparams.GetConsensus()))
|
||||
@@ -3696,7 +3696,7 @@ bool ReplayBlocks(const CChainParams& params, CCoinsView* view)
|
||||
if (hashHeads.empty()) return true; // We're already in a consistent state.
|
||||
if (hashHeads.size() != 2) return error("ReplayBlocks(): unknown inconsistent state");
|
||||
|
||||
uiInterface.ShowProgress(_("Replaying blocks..."), 0);
|
||||
uiInterface.ShowProgress(_("Replaying blocks..."), 0, false);
|
||||
LogPrintf("Replaying blocks\n");
|
||||
|
||||
const CBlockIndex* pindexOld = nullptr; // Old tip during the interrupted flush.
|
||||
@@ -3747,7 +3747,7 @@ bool ReplayBlocks(const CChainParams& params, CCoinsView* view)
|
||||
|
||||
cache.SetBestBlock(pindexNew->GetBlockHash());
|
||||
cache.Flush();
|
||||
uiInterface.ShowProgress("", 100);
|
||||
uiInterface.ShowProgress("", 100, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user