BitCoinCore Wallet Naming #21501

issue lutzd opened this issue on March 22, 2021
  1. lutzd commented at 11:00 AM on March 22, 2021: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    After creating full Block i had create New Wallet, i'd gave "DasOpiSeins" After reread i had seen that Walletnaming goes wrong: the PopUpMenu shows " asOpiSeins" only. May be the qt based container hide first Letter or the limit overlaying the 1st Letter<< the Windows File Explorer shows correct naming.

    <!--- What behavior did you expect? -->

    I want to see identical mames for WalletName as same as given during Creating, Opening (both inside BTC Core) and Fileexplorer (outside BTC Core)

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    I c btc_wallet_naming_01 btc_wallet_naming_02

    an can repeat this every time with every naming multiple times, same error 1st letter is hiding inside BTC Core Explorer

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    System information

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. lutzd added the label Bug on Mar 22, 2021
  3. MarcoFalke commented at 11:06 AM on March 22, 2021: member

    Which version of Bitcoin Core?

  4. ghost commented at 11:25 AM on March 22, 2021: none

    There was a similar issue earlier: #19928 which was fixed in https://github.com/bitcoin/bitcoin/pull/20080

  5. lutzd commented at 11:55 AM on March 22, 2021: none

    Oh thank you now i had reopen the created wallet and can watch that BTCCore #21501 (comment) (Version 0.21.0) didnt find the wrong metered path btc_wallet_opening_03 btc_wallet_opening_04 #21501 (comment) The given solution i didnt understand, iam not a c++ coder

  6. lutzd closed this on Mar 22, 2021

  7. ghost commented at 2:50 PM on March 22, 2021: none

    @lutzd Is the issue resolved? How can we reproduce this?

  8. lutzd commented at 8:34 AM on March 25, 2021: none

    Yes i can reproduce that issue. When creating a new Wallet, the first Letter seems to be ignored by the Userinterface AND by the Bitcoincore. @prayank23 No, the mentioned above issue is not for me. I had not used Lets start telling you:special Characters. @MarcoFalke My Bitcoin is Bitcoin Core Version v0.21.0 When creating the Wallet, the creation of the Filelink for the WalletLink is OK. You can see the correct Directoryname, refers to "DasOpiSeins", thats same as my created Wallet was named before. OK.

    BitCoin 04

    But when Open/reload the created Wallet with Name "DasOpiSeins" Bitcoin Core is looking for " asOpiSeins" or "asOpiSeins" only. The first letter "D" is removed/spaced by Core read/open process

    However hope you can read mine

    I had never check with other Leters, i think first to solve this issue. As you can see, the Core has removed the first letter when open to read. My System: WIN10x64, Build 19042.867, iCPU E5-1620 , 32GB Ram, ATI RX570 GraCa

    Be well Lutz

  9. ryanofsky commented at 1:18 PM on March 25, 2021: member

    I haven't looked at all the posts above, it is pretty clear looking at wallet listing code how Lutz's first character bug could arise when wallet_dir ends in a slash. It looks like this bug was introduced in ed2e18398b3ab657e98e3e1fe135cbf8dd94fda3 and could probably be fixed by:

    diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
    index cd49baeb786..191e15c494a 100644
    --- a/src/wallet/db.cpp
    +++ b/src/wallet/db.cpp
    @@ -12,7 +12,7 @@
     
     std::vector<fs::path> ListDatabases(const fs::path& wallet_dir)
     {
    -    const size_t offset = wallet_dir.string().size() + 1;
    +    const size_t offset = wallet_dir.string().size() + (wallet_dir.has_filename() ? 1 : 0);
         std::vector<fs::path> paths;
         boost::system::error_code ec;
     
    
  10. MarcoFalke commented at 4:50 PM on March 25, 2021: member

    Wasn't #20080 supposed to fix this?

  11. ryanofsky commented at 5:14 PM on March 25, 2021: member

    Wasn't #20080 supposed to fix this?

    I don't think #20080 covers the case where a -walletdir config option is set directly, instead of being derived from -datadir. Also, it looks like #20080 is just removing "." path elements not empty "" path elements which might result in trailing slashes. But I'm not sure about the details. Ideally the ListDatabases function should be able to list any path without caring how about the exact format. According to ed2e18398b3ab657e98e3e1fe135cbf8dd94fda3 it could be using boost::filesystem::lexically_relative but instead is using more fragile size_t offset approach for compatibility with an old version of Boost. C++17 apparently also has a lexically_relative method (https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal)

  12. promag commented at 5:22 PM on March 25, 2021: member

    @ryanofsky looks like std lexically_relative fit the job.

  13. lutzd commented at 9:09 PM on April 10, 2021: none

    @ryanofsky looks like std lexically_relative fit the job.

    Hallo João, hallo Russell, it sounds good, but what i have to do to confirm the Core running properly? Ther first-letter-missing issue is not compiled correctly in newest version pof my bitcoin core, didn`t it?. Pls let me know how to handle

  14. ghost commented at 9:13 PM on April 10, 2021: none

    @lutzd I would suggest you to reopen this issue as it's not resolved. Also do you remember if you used any special characters while creating this wallet?

  15. meshcollider referenced this in commit 69577a27ab on Jun 9, 2021
  16. sidhujag referenced this in commit a150948159 on Jun 9, 2021
  17. DrahtBot locked this on Aug 18, 2022

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-13 18:14 UTC

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