Remove one character less from wallet path
After testing lot of random strings with special chars in
wallet_name, I found that the issue was not related to special characters in the name. Reviewing PR #21907 helped me resolve the issue.
Real issue: If the path mentioned in walletdir is a root directory, first character of the wallet name or path is removed
Solution: if statement to check walletdir is a root directory
Fixes: #21510 https://github.com/bitcoin/bitcoin/issues/21501 Related PR: #20080
Consider the wallet directories w1 and w2 saved in D:\. Run bitcoind.exe -walletdir=D:\, Results for bitcoin-cli.exe listwalletdir:
Before this PR:
{
"wallets": [
{
"name": "1"
},
{
"name": "2"
}
]
}
After this PR:
"wallets": [
{
"name": "w1"
},
{
"name": "w2"
}
]
}