Skip to content

Commit

Permalink
Auto merge of zcash#1655 - ebfull:fix-bitcoin-strings, r=daira
Browse files Browse the repository at this point in the history
Change some Bitcoin strings to Zcash strings.

This addresses most of the user-facing ones (in help messages for example), thread names, but avoids things like tests and datastructure names.

**I slopped this together in a rush. Review it carefully!**
  • Loading branch information
zkbot committed Oct 26, 2016
2 parents 55d4f13 + 7662d72 commit dcea859
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 71 deletions.
12 changes: 6 additions & 6 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void Shutdown()
/// for example if the data directory was found to be locked.
/// Be sure that anything that writes files or flushes caches only does this if the respective
/// module was initialized.
RenameThread("bitcoin-shutoff");
RenameThread("zcash-shutoff");
mempool.AddTransactionsUpdated(1);
StopRPCThreads();
#ifdef ENABLE_WALLET
Expand Down Expand Up @@ -531,7 +531,7 @@ void CleanupBlockRevFiles()

void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
{
RenameThread("bitcoin-loadblk");
RenameThread("zcash-loadblk");
// -reindex
if (fReindex) {
#ifdef ENABLE_WALLET
Expand Down Expand Up @@ -926,7 +926,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)

// Sanity check
if (!InitSanityCheck())
return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));
return InitError(_("Initialization sanity check failed. Zcash is shutting down."));

std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET
Expand All @@ -942,9 +942,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
try {
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running."), strDataDir));
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Zcash is probably already running."), strDataDir));
} catch(const boost::interprocess::interprocess_exception& e) {
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running.") + " %s.", strDataDir, e.what()));
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Zcash is probably already running.") + " %s.", strDataDir, e.what()));
}

#ifndef WIN32
Expand All @@ -953,7 +953,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
LogPrintf("Zcash version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
LogPrintf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
#ifdef ENABLE_WALLET
LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0));
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
using namespace std;

#if defined(NDEBUG)
# error "Bitcoin cannot be compiled without assertions."
# error "Zcash cannot be compiled without assertions."
#endif

/**
Expand Down Expand Up @@ -1958,7 +1958,7 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
static CCheckQueue<CScriptCheck> scriptcheckqueue(128);

void ThreadScriptCheck() {
RenameThread("bitcoin-scriptch");
RenameThread("zcash-scriptch");
scriptcheckqueue.Thread();
}

Expand Down
8 changes: 4 additions & 4 deletions src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,16 @@ void StartRPCThreads()
unsigned char rand_pwd[32];
GetRandBytes(rand_pwd, 32);
uiInterface.ThreadSafeMessageBox(strprintf(
_("To use bitcoind, or the -server option to bitcoin-qt, you must set an rpcpassword in the configuration file:\n"
_("To use zcashd you must set an rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=bitcoinrpc\n"
"rpcuser=zcashrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" [email protected]\n"),
"for example: alertnotify=echo %%s | mail -s \"Zcash Alert\" [email protected]\n"),
GetConfigFile().string(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32)),
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::SECURE);
Expand Down Expand Up @@ -1068,7 +1068,7 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s
}

std::string HelpExampleCli(string methodname, string args){
return "> bitcoin-cli " + methodname + " " + args + "\n";
return "> zcash-cli " + methodname + " " + args + "\n";
}

std::string HelpExampleRpc(string methodname, string args){
Expand Down
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void RenameThread(const char* name);
*/
template <typename Callable> void TraceThread(const char* name, Callable func)
{
std::string s = strprintf("bitcoin-%s", name);
std::string s = strprintf("zcash-%s", name);
RenameThread(s.c_str());
try
{
Expand Down
16 changes: 8 additions & 8 deletions src/wallet/rpcdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ Value importprivkey(const Array& params, bool fHelp)

if (fHelp || params.size() < 1 || params.size() > 3)
throw runtime_error(
"importprivkey \"bitcoinprivkey\" ( \"label\" rescan )\n"
"importprivkey \"zcashprivkey\" ( \"label\" rescan )\n"
"\nAdds a private key (as returned by dumpprivkey) to your wallet.\n"
"\nArguments:\n"
"1. \"bitcoinprivkey\" (string, required) The private key (see dumpprivkey)\n"
"1. \"zcashprivkey\" (string, required) The private key (see dumpprivkey)\n"
"2. \"label\" (string, optional, default=\"\") An optional label\n"
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
Expand Down Expand Up @@ -182,7 +182,7 @@ Value importaddress(const Array& params, bool fHelp)
std::vector<unsigned char> data(ParseHex(params[0].get_str()));
script = CScript(data.begin(), data.end());
} else {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zcash address or script");
}

string strLabel = "";
Expand Down Expand Up @@ -321,7 +321,7 @@ Value importwallet_impl(const Array& params, bool fHelp, bool fImportZKeys)
}
catch (const std::runtime_error &e) {
LogPrint("zrpc","Importing detected an error: %s\n", e.what());
// Not a valid spending key, so carry on and see if it's a Bitcoin style address.
// Not a valid spending key, so carry on and see if it's a Zcash style address.
}
}

Expand Down Expand Up @@ -388,11 +388,11 @@ Value dumpprivkey(const Array& params, bool fHelp)

if (fHelp || params.size() != 1)
throw runtime_error(
"dumpprivkey \"bitcoinaddress\"\n"
"\nReveals the private key corresponding to 'bitcoinaddress'.\n"
"dumpprivkey \"zcashaddress\"\n"
"\nReveals the private key corresponding to 'zcashaddress'.\n"
"Then the importprivkey can be used with this output\n"
"\nArguments:\n"
"1. \"bitcoinaddress\" (string, required) The bitcoin address for the private key\n"
"1. \"zcashaddress\" (string, required) The zcash address for the private key\n"
"\nResult:\n"
"\"key\" (string) The private key\n"
"\nExamples:\n"
Expand All @@ -408,7 +408,7 @@ Value dumpprivkey(const Array& params, bool fHelp)
string strAddress = params[0].get_str();
CBitcoinAddress address;
if (!address.SetString(strAddress))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zcash address");
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");
Expand Down
Loading

0 comments on commit dcea859

Please sign in to comment.