do not truncate .dat extension for wallets in gui #12795

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:nowalletprune changing 1 files +1 −5
  1. instagibbs commented at 7:27 PM on March 26, 2018: member

    Truncating the extension results in wallet name ambiguity and the inability to use the wallet in GUI debug rpc console.

    Resolves #12794

  2. do not truncate .dat extension for wallets in gui fc7c32fc68
  3. MarcoFalke commented at 7:31 PM on March 26, 2018: member

    utACK fc7c32fc68f2c2618644f9bea6176c63940706b3

  4. ryanofsky commented at 8:11 PM on March 26, 2018: member

    utACK fc7c32fc68f2c2618644f9bea6176c63940706b3

  5. promag commented at 8:19 PM on March 26, 2018: member

    Tested ACK fc7c32f.

    Running bitcoin-qt -regtest -wallet=w1 -wallet=w2 -wallet=/tmp/foo.dat -wallet=/tmp/foo:

    • RPC listwallets: <img width="310" alt="screen shot 2018-03-26 at 21 17 36" src="https://user-images.githubusercontent.com/3534524/37930615-2c2f58b4-313b-11e8-90ec-5e589ae243d8.png">

    • Console selector: <img width="288" alt="screen shot 2018-03-26 at 21 17 28" src="https://user-images.githubusercontent.com/3534524/37930621-32055fae-313b-11e8-9a44-c8ddd8793653.png">

    • Wallet view selector: <img width="272" alt="screen shot 2018-03-26 at 21 17 13" src="https://user-images.githubusercontent.com/3534524/37930632-3a1e63de-313b-11e8-84d5-836a73f75c23.png">

  6. instagibbs commented at 8:40 PM on March 26, 2018: member

    @promag could you also check you can do wallet calls with *.dat properly?

  7. practicalswift commented at 8:55 PM on March 26, 2018: contributor

    utACK fc7c32fc68f2c2618644f9bea6176c63940706b3

  8. jnewbery commented at 9:02 PM on March 26, 2018: member

    utACK fc7c32fc68f2c2618644f9bea6176c63940706b3

  9. promag commented at 9:24 PM on March 26, 2018: member

    @instagibbs switching between foo.dat and foo and calling getbalance yields different results, so works as expected.

  10. randolf approved
  11. randolf commented at 9:32 PM on March 26, 2018: contributor

    This change improves the quality of the software because it presents information to the user more accurately.

  12. instagibbs commented at 9:39 PM on March 26, 2018: member

    @MarcoFalke 2nd time this particular job timed out: https://travis-ci.org/bitcoin/bitcoin/jobs/358567658

  13. MarcoFalke commented at 9:49 PM on March 26, 2018: member

    @instagibbs Its fine to ignore, I guess.

  14. luke-jr commented at 10:33 PM on March 26, 2018: member

    NACK, users should not be exposed to file extensions...

  15. instagibbs commented at 10:37 PM on March 26, 2018: member

    @luke-jr they already are, they're just not exposed to .dat...

    If we simply disallow files with names that clash, maybe?

  16. promag commented at 10:40 PM on March 26, 2018: member

    users should not be exposed to file extensions

    Why? Is that a some sort of UI best practice? Specially after #11687 I fail to see an alternative.

  17. luke-jr commented at 10:41 PM on March 26, 2018: member

    What do you mean they already are?

    I don't see any reason to disallow names that clash - but it should be harmless as well since that would be immensely confusing to users anyway.

    Why? Is that a some sort of UI best practice? Specially after #11687 I fail to see an alternative.

    The alternative is to use the wallet selected, despite visual appearance (which shouldn't matter).

    (Note that the original multiwallet PR didn't have this bug; it was introduced with regressions in jonas's branch that somehow got merged despite me pointing out out over and over.)

  18. instagibbs commented at 10:44 PM on March 26, 2018: member

    @luke-jr current behavior in master allows blah.wallet, blah.dat, blah, side by side. Which is why I suggested disallowing collisions as a different fix.

  19. luke-jr commented at 10:46 PM on March 26, 2018: member

    @instagibbs They should all show simply "blah", and work correctly if the user bothers to figure out which is which.

  20. ryanofsky commented at 10:47 PM on March 26, 2018: member

    NACK, users should not be exposed to file extensions...

    Should be little risk of this, because since #11687 new wallets are created as directories instead of files. The only way a user would be shown a .dat extension (or any berkeleydb data filename) is if they explicitly configured bitcoin to load a .dat file rather than a wallet directory.

  21. instagibbs commented at 10:49 PM on March 26, 2018: member

    @luke-jr I'm sorry that's far more unfriendly; users shouldn't be confronted with two identical labels

  22. fanquake added the label GUI on Mar 26, 2018
  23. luke-jr commented at 10:51 PM on March 26, 2018: member

    @instagibbs Ordinarily, they won't be, because naming two wallets the same thing is dumb. @ryanofsky That only affects new wallets AFAIK?

  24. ryanofsky commented at 11:09 PM on March 26, 2018: member

    @ryanofsky That only affects new wallets AFAIK?

    That's right, new wallets are created as directories with separate berkeleydb environments, but for backwards compatibility it's still possible to load individual .dat files in a shared environment.

    In general I agree that it's bad to expose file extensions in the UI, and thankfully going forward this will not happen in either the gui or regular daemon because of the switch to wallet directories.

    In the backwards compatible case it seems more counterintuitive to drop ".dat" suffixes, than to simply use filenames as provided by the user without transforming them. Not transforming filenames has the advantage that wallets can be identified with the same names everywhere: on the command line, in conf files, in listwallets and getwalletinfo output, and in the gui. This means fewer opportunities for confusion.

    It would be really ugly if the software were adding extensions automatically and then leaking them into the gui, exposing internal layout of wallet databases. But that's not what is happening here. What's happening here is that the user is specifying a filename with an extension and the software is automatically removing it, making it more difficult than it needs to be to identify and distinguish wallets. Better, IMO, to just use names exactly as provided by the user.

  25. eklitzke approved
  26. jonasschnelli commented at 8:12 AM on March 27, 2018: contributor

    utACK fc7c32fc68f2c2618644f9bea6176c63940706b3 Travis issue seems unrelated.

    From the GUI perspective, users don't want to deal with filename. They want to create wallets and give them a name and eventually rename them later as well as use all sorts of special characters.

    In the long run, the GUI should allow to dynamically create wallets where the user given wallet name could be completely different then the filename (filename could be a uuid similar to how other GUI applications work [like calendar apps]).

  27. jonasschnelli merged this on Mar 27, 2018
  28. jonasschnelli closed this on Mar 27, 2018

  29. jonasschnelli referenced this in commit 68484d64fd on Mar 27, 2018
  30. Sjors commented at 8:55 AM on March 27, 2018: member

    I think it makes sense to show the full file name for older wallets, to prevent confusion.

    It would be nice if there was a way to "upgrade" them.

    If we do want to make legacy wallet file names look pretty, I would suggest stripping the file extension, then checking for duplicates and showing the full file name in those cases.

    Adding name metadata to the wallet payload makes sense too, although decades of word processors have accustomed people to file names matching the window title when they open a document.

  31. PastaPastaPasta referenced this in commit 7205f8aa5d on Sep 27, 2020
  32. PastaPastaPasta referenced this in commit 69ef071ee2 on Nov 1, 2020
  33. MarcoFalke 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