CWallet* pwalletMain;
CClientUIInterface uiInterface;
+std::string strWalletFileName;
//////////////////////////////////////////////////////////////////////////////
//
" -gen " + _("Generate coins") + "\n" +
" -gen=0 " + _("Don't generate coins") + "\n" +
" -datadir=<dir> " + _("Specify data directory") + "\n" +
+ " -wallet=<dir> " + _("Specify wallet file (within data directory)") + "\n" +
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
" -dblogsize=<n> " + _("Set database disk log size in megabytes (default: 100)") + "\n" +
" -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" +
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
std::string strDataDir = GetDataDir().string();
+ std::string strWalletFileName = GetArg("-wallet", "wallet.dat");
+
+ // strWalletFileName must be a plain filename without a directory
+ if (strWalletFileName != boost::filesystem::basename(strWalletFileName) + boost::filesystem::extension(strWalletFileName))
+ return InitError(strprintf(_("Wallet %s resides outside data directory %s."), strWalletFileName.c_str(), strDataDir.c_str()));
// Make sure only a single Bitcoin process is using the data directory.
boost::filesystem::path pathLockFile = GetDataDir() / ".lock";
if (GetBoolArg("-salvagewallet"))
{
// Recover readable keypairs:
- if (!CWalletDB::Recover(bitdb, "wallet.dat", true))
+ if (!CWalletDB::Recover(bitdb, strWalletFileName, true))
return false;
}
- if (filesystem::exists(GetDataDir() / "wallet.dat"))
+ if (filesystem::exists(GetDataDir() / strWalletFileName))
{
- CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover);
+ CDBEnv::VerifyResult r = bitdb.Verify(strWalletFileName, CWalletDB::Recover);
if (r == CDBEnv::RECOVER_OK)
{
string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!"
printf("Loading wallet...\n");
nStart = GetTimeMillis();
bool fFirstRun = true;
- pwalletMain = new CWallet("wallet.dat");
+ pwalletMain = new CWallet(strWalletFileName);
DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);
if (nLoadWalletRet != DB_LOAD_OK)
{
pindexRescan = pindexGenesisBlock;
else
{
- CWalletDB walletdb("wallet.dat");
+ CWalletDB walletdb(strWalletFileName);
CBlockLocator locator;
if (walletdb.ReadBestBlock(locator))
pindexRescan = locator.GetBlockIndex();
<translation>Don't generate coins</translation>
</message>
<message>
+ <location line="-17"/>
+ <source>Specify wallet file (within data directory)</source>
+ <translation>Specify wallet file (within data directory)</translation>
+ </message>
+ <message>
<location line="+60"/>
<source>Specify data directory</source>
<translation>Specify data directory</translation>
<translation>This help message</translation>
</message>
<message>
+ <location line="-122"/>
+ <source>Wallet %s resides outside data directory %s.</source>
+ <translation>Wallet %s resides outside data directory %s.</translation>
+ </message>
+ <message>
<location line="-131"/>
<source>Cannot obtain a lock on data directory %s. NovaCoin is probably already running.</source>
<translation>Cannot obtain a lock on data directory %s. NovaCoin is probably already running.</translation>
<translation>Указать pid-файл (по умолчанию: novacoin.pid)</translation>
</message>
<message>
+ <location line="-17"/>
+ <source>Specify wallet file (within data directory)</source>
+ <translation>Указать файл кошелька (в пределах DATA директории)</translation>
+ </message>
+ <message>
<location line="-47"/>
<source>Generate coins</source>
<translation>Генерировать монеты</translation>
<message>
<location line="+2"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка инициализации окружения БД %s! Для восстановления СДЕЛАЙТЕ РЕЗЕРВНУЮ КОПИЮ этой директории, затем удалите из нее все, кроме wallet.dat.</translation>
</message>
<message>
<location line="+13"/>
<message>
<location line="+1"/>
<source>Verifying database integrity...</source>
- <translation type="unfinished"></translation>
+ <translation>Проверка целостности базы данных...</translation>
</message>
<message>
<location line="+2"/>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
- <translation type="unfinished"></translation>
+ <translation>wallet.dat поврежден, восстановление не удалось</translation>
</message>
<message>
<location line="-43"/>
<translation>Эта справка</translation>
</message>
<message>
+ <location line="-122"/>
+ <source>Wallet %s resides outside data directory %s.</source>
+ <translation>Кошелек %s находится вне рабочей директории %s.</translation>
+ </message>
+ <message>
<location line="-131"/>
<source>Cannot obtain a lock on data directory %s. NovaCoin is probably already running.</source>
<translation>Невозможно установить блокировку на рабочую директорию %s. Возможно, бумажник уже запущен.</translation>