Shows progress dialog for rpc importwallet.

Shows progress dialog for rpc importwallet.

160 | @@ -161,7 +161,13 @@ Value importwallet(const Array& params, bool fHelp) 161 | 162 | bool fGood = true; 163 | 164 | + int nLineCount = std::count(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>(), '\n');
So this reads the entire file twice, once to count the number of lines?
Personally I'd prefer progress based on the amount of bytes, as this can be done without a second pass.
update:
160 | @@ -161,7 +161,12 @@ Value importwallet(const Array& params, bool fHelp) 161 | 162 | bool fGood = true; 163 | 164 | + int nFilesize = file.tellg(); 165 | + file.seekg (0, file.beg);
No space before the bracket.
ACK
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/d80f95ed3ecf2897446623292b11e08d2edba262 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.
160 | @@ -161,7 +161,12 @@ Value importwallet(const Array& params, bool fHelp) 161 | 162 | bool fGood = true; 163 | 164 | + int nFilesize = file.tellg();
This shouldn't be an int, but a std::streampos (or at least some larger integer type like int64_t). Not that I expect any 2GB+ wallets any time soon, of course :)