



Nice!
Tested this with various checkblocks and checklevel values (including 0) and it worked for me. ACK
427 | @@ -427,7 +428,11 @@ Value verifychain(const Array& params, bool fHelp) 428 | if (params.size() > 1) 429 | nCheckDepth = params[1].get_int(); 430 | 431 | - return VerifyDB(nCheckLevel, nCheckDepth); 432 | + uiInterface.ShowProgress(_("Verifying blocks..."), 0);
Not very clean that the different calls with uiInterface.ShowProgress("Verifying blocks..."... are called from two very different places.
Right - would be better to have this all contained to VerifyDB.
Yes not so clean, I did that because there are a lot of "return" statements in VerifyDB(..), so I would need to add a signal before every "return" in VerifyDB(..). I will change it.
Just create a a class "VerifyingBlocks" and use RAII. Every return path will hit the destructor, so do the signal there.
update:
ACK core changes.
1027 | +class CVerifyDB { 1028 | +public: 1029 | + 1030 | + CVerifyDB(int nCheckLevelIn, int nCheckDepthIn) 1031 | + { 1032 | + nCheckLevel = nCheckLevelIn;
I'd prefer moving all the implementation to main.cpp, instead of specifying it in the header. This also avoids having to make main.h depend on ui_interface.h
Agree.
update:
2967 | @@ -2968,7 +2968,17 @@ bool static LoadBlockIndexDB() 2968 | return true; 2969 | } 2970 | 2971 | -bool VerifyDB(int nCheckLevel, int nCheckDepth) 2972 | +void CVerifyDB::Init()
Nit: Why use Init() and Finialize() instead of CVerifyDB() and ~CVerifyDB()?
Agree with @brandondahler here. Those methods are redundant.
update:
198 | @@ -198,7 +199,37 @@ QString ClientModel::formatClientStartupTime() const 199 | return QDateTime::fromTime_t(nClientStartupTime).toString(); 200 | } 201 | 202 | +void ClientModel::showProgress(const QString &title, int nProgress)
Displaying a dialog box in the model code is a bit questionable - that's supposed to happen in some view - the model should only pass on or process signals from the core.
I remember I got that feedback too once :). And I remember I decided you were right.
update:
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/06a91d9698762fe56fca3bd33484bddc9f020405 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
ACK