[Qt] importwallet progress #4055

pull cozz wants to merge 1 commits into bitcoin:master from cozz:cozz7 changing 1 files +7 −1
  1. cozz commented at 6:44 PM on April 14, 2014: contributor

    Shows progress dialog for rpc importwallet.

    importwallet

  2. in src/rpcdump.cpp:None in 6aef55f9e7 outdated
     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');
    


    laanwj commented at 12:06 PM on April 18, 2014:

    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.

  3. cozz commented at 6:21 PM on April 18, 2014: contributor

    update:

    • progress is now based on the amount of bytes instead of lines
  4. in src/rpcdump.cpp:None in 50e75ae00e outdated
     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);
    


    sipa commented at 9:50 PM on April 18, 2014:

    No space before the bracket.

  5. sipa commented at 9:52 PM on April 18, 2014: member

    ACK

  6. BitcoinPullTester commented at 10:47 PM on April 18, 2014: none

    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.

  7. in src/rpcdump.cpp:None in d80f95ed3e outdated
     160 | @@ -161,7 +161,12 @@ Value importwallet(const Array& params, bool fHelp)
     161 |  
     162 |      bool fGood = true;
     163 |  
     164 | +    int nFilesize = file.tellg();
    


    laanwj commented at 3:01 PM on April 22, 2014:

    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 :)

  8. laanwj added this to the milestone 0.9.2 on Apr 22, 2014
  9. [Qt] importwallet progress bb1f1c90d6
  10. cozz commented at 2:59 PM on April 23, 2014: contributor

    update:

    • use int64_t for filesize

    I did some quick tests with #4085. It works for me.

  11. laanwj merged this on Apr 23, 2014
  12. laanwj closed this on Apr 23, 2014

  13. laanwj referenced this in commit 97730c9b7f on Apr 23, 2014
  14. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me