diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -54,7 +54,7 @@ return ret.str(); } -std::string DecodeDumpString(const std::string &str) { +static std::string DecodeDumpString(const std::string &str) { std::stringstream ret; for (unsigned int pos = 0; pos < str.length(); pos++) { uint8_t c = str[pos]; @@ -207,10 +207,10 @@ return true; } -void ImportAddress(CWallet *, const CTxDestination &dest, - const std::string &strLabel); -void ImportScript(CWallet *const pwallet, const CScript &script, - const std::string &strLabel, bool isRedeemScript) { +static void ImportAddress(CWallet *, const CTxDestination &dest, + const std::string &strLabel); +static void ImportScript(CWallet *const pwallet, const CScript &script, + const std::string &strLabel, bool isRedeemScript) { if (!isRedeemScript && ::IsMine(*pwallet, script) == ISMINE_SPENDABLE) { throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the " "private key for this address or " @@ -238,8 +238,8 @@ } } -void ImportAddress(CWallet *const pwallet, const CTxDestination &dest, - const std::string &strLabel) { +static void ImportAddress(CWallet *const pwallet, const CTxDestination &dest, + const std::string &strLabel) { CScript script = GetScriptForDestination(dest); ImportScript(pwallet, script, strLabel, false); // add to address book or update label @@ -911,8 +911,8 @@ return reply; } -UniValue ProcessImport(CWallet *const pwallet, const UniValue &data, - const int64_t timestamp) { +static UniValue ProcessImport(CWallet *const pwallet, const UniValue &data, + const int64_t timestamp) { try { bool success = false; @@ -1280,7 +1280,7 @@ } } -int64_t GetImportTimestamp(const UniValue &data, int64_t now) { +static int64_t GetImportTimestamp(const UniValue &data, int64_t now) { if (data.exists("timestamp")) { const UniValue ×tamp = data["timestamp"]; if (timestamp.isNum()) { diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -109,7 +109,7 @@ } } -void WalletTxToJSON(const CWalletTx &wtx, UniValue &entry) { +static void WalletTxToJSON(const CWalletTx &wtx, UniValue &entry) { int confirms = wtx.GetDepthInMainChain(); entry.pushKV("confirmations", confirms); if (wtx.IsCoinBase()) { @@ -138,7 +138,7 @@ } } -std::string LabelFromValue(const UniValue &value) { +static std::string LabelFromValue(const UniValue &value) { std::string label = value.get_str(); if (label == "*") { throw JSONRPCError(RPC_WALLET_INVALID_LABEL_NAME, "Invalid label name"); @@ -223,7 +223,8 @@ return dest; } -UniValue getlabeladdress(const Config &config, const JSONRPCRequest &request) { +static UniValue getlabeladdress(const Config &config, + const JSONRPCRequest &request) { CWallet *const pwallet = GetWalletForJSONRPCRequest(request); if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { return NullUniValue; @@ -311,7 +312,7 @@ return EncodeDestination(dest); } -UniValue setlabel(const Config &config, const JSONRPCRequest &request) { +static UniValue setlabel(const Config &config, const JSONRPCRequest &request) { CWallet *const pwallet = GetWalletForJSONRPCRequest(request); if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { return NullUniValue; @@ -823,8 +824,8 @@ return ValueFromAmount(nAmount); } -UniValue getreceivedbylabel(const Config &config, - const JSONRPCRequest &request) { +static UniValue getreceivedbylabel(const Config &config, + const JSONRPCRequest &request) { CWallet *const pwallet = GetWalletForJSONRPCRequest(request); if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { return NullUniValue; @@ -1368,8 +1369,8 @@ return tx->GetId().GetHex(); } -UniValue addmultisigaddress(const Config &config, - const JSONRPCRequest &request) { +static UniValue addmultisigaddress(const Config &config, + const JSONRPCRequest &request) { CWallet *const pwallet = GetWalletForJSONRPCRequest(request); if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { return NullUniValue; @@ -1481,8 +1482,8 @@ } }; -UniValue ListReceived(const Config &config, CWallet *const pwallet, - const UniValue ¶ms, bool by_label) { +static UniValue ListReceived(const Config &config, CWallet *const pwallet, + const UniValue ¶ms, bool by_label) { // Minimum confirmations int nMinDepth = 1; if (!params[0].isNull()) { @@ -1699,8 +1700,8 @@ return ListReceived(config, pwallet, request.params, false); } -UniValue listreceivedbylabel(const Config &config, - const JSONRPCRequest &request) { +static UniValue listreceivedbylabel(const Config &config, + const JSONRPCRequest &request) { CWallet *const pwallet = GetWalletForJSONRPCRequest(request); if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { return NullUniValue; @@ -1767,9 +1768,10 @@ * @param ret The UniValue into which the result is stored. * @param filter The "is mine" filter bool. */ -void ListTransactions(CWallet *const pwallet, const CWalletTx &wtx, - const std::string &strAccount, int nMinDepth, bool fLong, - UniValue &ret, const isminefilter &filter) { +static void ListTransactions(CWallet *const pwallet, const CWalletTx &wtx, + const std::string &strAccount, int nMinDepth, + bool fLong, UniValue &ret, + const isminefilter &filter) { Amount nFee; std::string strSentAccount; std::list listReceived; @@ -1847,8 +1849,8 @@ } } -void AcentryToJSON(const CAccountingEntry &acentry, - const std::string &strAccount, UniValue &ret) { +static void AcentryToJSON(const CAccountingEntry &acentry, + const std::string &strAccount, UniValue &ret) { bool fAllAccounts = (strAccount == std::string("*")); if (fAllAccounts || acentry.strAccount == strAccount) { @@ -4105,7 +4107,8 @@ } }; -UniValue DescribeWalletAddress(CWallet *pwallet, const CTxDestination &dest) { +static UniValue DescribeWalletAddress(CWallet *pwallet, + const CTxDestination &dest) { UniValue ret(UniValue::VOBJ); UniValue detail = DescribeAddress(dest); ret.pushKVs(detail); diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -266,9 +266,9 @@ } }; -bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, - CWalletScanState &wss, std::string &strType, - std::string &strErr) { +static bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, + CDataStream &ssValue, CWalletScanState &wss, + std::string &strType, std::string &strErr) { try { // Unserialize // Taking advantage of the fact that pair serialization is just the two