aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-09-07 09:20:55 -0700
committerJonas Schnelli <dev@jonasschnelli.ch>2017-09-07 09:21:04 -0700
commitea729d55b4dbd17a53ced474a8457d4759cfb5a5 (patch)
tree2efe97d55ff48f1ab18010ffa011cb369a59b07c /src/validation.cpp
parent9c8f3655cc68f038b4739e95879ea65a1d476227 (diff)
parentee4d1493e2a871b26201580c5a990a1df7a5e3f7 (diff)
downloadbitcoin-ea729d55b4dbd17a53ced474a8457d4759cfb5a5.tar.xz
Merge #10770: Drop upgrade-cancel callback registration for a generic "cancelable"
ee4d1493e Drop upgrade-cancel callback registration for a generic "resumeable" (Matt Corallo) Pull request description: Instead of passing a StartShutdown reference all the way up from txdb, give ShowProgress a "cancelable" boolean, as StartShutdown is pretty much always what you'll want to use to cancel. Use the same boolean to allow cancel during initial block verification. Tree-SHA512: 515817aaa4b9e3e856200e00be9c2d44ecfa2d4f288fe3e02116105fe85de2650c13076ee7e45396ec1ce6ab45e53b0477cddda7cfdee5b3bd0589cb81a4c346
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index d8788548ff..0bd1ec672b 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3570,12 +3570,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)
@@ -3605,7 +3605,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)) {
@@ -3656,7 +3656,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()))
@@ -3703,7 +3703,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.
@@ -3754,7 +3754,7 @@ bool ReplayBlocks(const CChainParams& params, CCoinsView* view)
cache.SetBestBlock(pindexNew->GetBlockHash());
cache.Flush();
- uiInterface.ShowProgress("", 100);
+ uiInterface.ShowProgress("", 100, false);
return true;
}