diff --git a/contrib/dash-qt.pro b/contrib/dash-qt.pro index 5ce552cedf..2c2c45b799 100644 --- a/contrib/dash-qt.pro +++ b/contrib/dash-qt.pro @@ -19,7 +19,8 @@ FORMS += \ ../src/qt/forms/sendcoinsdialog.ui \ ../src/qt/forms/sendcoinsentry.ui \ ../src/qt/forms/signverifymessagedialog.ui \ - ../src/qt/forms/transactiondescdialog.ui + ../src/qt/forms/transactiondescdialog.ui \ + ../src/qt/forms/createwalletdialog.ui RESOURCES += \ ../src/qt/dash.qrc diff --git a/doc/release-notes-16394.md b/doc/release-notes-16394.md new file mode 100644 index 0000000000..f09cba4b6d --- /dev/null +++ b/doc/release-notes-16394.md @@ -0,0 +1,4 @@ +RPC changes +----------- +`createwallet` now returns a warning if an empty string is used as an encryption password, and does not encrypt the wallet, instead of raising an error. +This makes it easier to disable encryption but also specify other options when using the `bitcoin-cli` tool. diff --git a/src/Makefile.am b/src/Makefile.am index 6922115bbd..3a7fac96f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -311,6 +311,7 @@ BITCOIN_CORE_H = \ util/string.h \ util/time.h \ util/threadnames.h \ + util/translation.h \ util/vector.h \ util/url.h \ util/validation.h \ diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index ff39e7ea6b..c668fe5377 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -14,6 +14,7 @@ QT_FORMS_UI = \ qt/forms/appearancewidget.ui \ qt/forms/askpassphrasedialog.ui \ qt/forms/coincontroldialog.ui \ + qt/forms/createwalletdialog.ui \ qt/forms/editaddressdialog.ui \ qt/forms/governancelist.ui \ qt/forms/helpmessagedialog.ui \ @@ -37,6 +38,7 @@ QT_MOC_CPP = \ qt/moc_addresstablemodel.cpp \ qt/moc_appearancewidget.cpp \ qt/moc_askpassphrasedialog.cpp \ + qt/moc_createwalletdialog.cpp \ qt/moc_bantablemodel.cpp \ qt/moc_bitcoinaddressvalidator.cpp \ qt/moc_bitcoinamountfield.cpp \ @@ -125,6 +127,7 @@ BITCOIN_QT_H = \ qt/clientmodel.h \ qt/coincontroldialog.h \ qt/coincontroltreewidget.h \ + qt/createwalletdialog.h \ qt/csvmodelwriter.h \ qt/dash.h \ qt/editaddressdialog.h \ @@ -240,6 +243,7 @@ BITCOIN_QT_WALLET_CPP = \ qt/askpassphrasedialog.cpp \ qt/coincontroldialog.cpp \ qt/coincontroltreewidget.cpp \ + qt/createwalletdialog.cpp \ qt/editaddressdialog.cpp \ qt/governancelist.cpp \ qt/masternodelist.cpp \ diff --git a/src/banman.cpp b/src/banman.cpp index 2445cb0963..a9ff1e39aa 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -9,12 +9,13 @@ #include #include #include +#include BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time) : m_client_interface(client_interface), m_ban_db(std::move(ban_file)), m_default_ban_time(default_ban_time) { - if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist...")); + if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist...").translated); int64_t n_start = GetTimeMillis(); m_is_dirty = false; diff --git a/src/bench/bench_dash.cpp b/src/bench/bench_dash.cpp index 3c266c6f3b..744a0650b8 100644 --- a/src/bench/bench_dash.cpp +++ b/src/bench/bench_dash.cpp @@ -45,7 +45,7 @@ int main(int argc, char** argv) SetupBenchArgs(); std::string error; if (!gArgs.ParseParameters(argc, argv, error)) { - tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str()); + tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error); return EXIT_FAILURE; } diff --git a/src/coinjoin/client.cpp b/src/coinjoin/client.cpp index 2686ea6e34..b450f1ea79 100644 --- a/src/coinjoin/client.cpp +++ b/src/coinjoin/client.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -228,7 +229,7 @@ void CCoinJoinClientSession::ProcessMessage(CNode* pfrom, const std::string& str return; } - LogPrint(BCLog::COINJOIN, "DSCOMPLETE -- nMsgSessionID %d nMsgMessageID %d (%s)\n", nMsgSessionID, nMsgMessageID, CCoinJoin::GetMessageByID(nMsgMessageID)); + LogPrint(BCLog::COINJOIN, "DSCOMPLETE -- nMsgSessionID %d nMsgMessageID %d (%s)\n", nMsgSessionID, nMsgMessageID, CCoinJoin::GetMessageByID(nMsgMessageID).translated); CompletedTransaction(nMsgMessageID); } @@ -297,7 +298,7 @@ void CCoinJoinClientSession::UnlockCoins() vecOutPointLocked.clear(); } -std::string CCoinJoinClientSession::GetStatus(bool fWaitForBlock) const +bilingual_str CCoinJoinClientSession::GetStatus(bool fWaitForBlock) const { static int nStatusMessageProgress = 0; nStatusMessageProgress += 10; @@ -331,20 +332,20 @@ std::string CCoinJoinClientSession::GetStatus(bool fWaitForBlock) const strSuffix = "..."; return strprintf(_("Found enough users, signing ( waiting %s )"), strSuffix); case POOL_STATE_ERROR: - return strprintf(_("%s request incomplete: %s"), gCoinJoinName, strLastMessage) + " " + _("Will retry..."); + return strprintf(_("%s request incomplete:"), gCoinJoinName) + strLastMessage + Untranslated(" ") + _("Will retry..."); default: return strprintf(_("Unknown state: id = %u"), nState); } } -std::string CCoinJoinClientManager::GetStatuses() +bilingual_str CCoinJoinClientManager::GetStatuses() { - std::string strStatus; + bilingual_str strStatus; bool fWaitForBlock = WaitForAnotherBlock(); LOCK(cs_deqsessions); for (const auto& session : deqSessions) { - strStatus += session.GetStatus(fWaitForBlock) + "; "; + strStatus = strStatus + session.GetStatus(fWaitForBlock) + Untranslated("; "); } return strStatus; } @@ -466,7 +467,7 @@ bool CCoinJoinClientSession::SendDenominate(const std::vector warnings; - if (!mixingWallet.AutoBackupWallet("", warningString, errorString)) { - if (!warningString.empty()) { + if (!mixingWallet.AutoBackupWallet("", errorString, warnings)) { + if (!warnings.empty()) { // There were some issues saving backup but yet more or less safe to continue - LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", warningString); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", Join(warnings, "\n", OpTranslated)); } - if (!errorString.empty()) { + if (!errorString.original.empty()) { // Things are really broken - LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- ERROR! Failed to create automatic backup: %s\n", errorString); - strAutoDenomResult = strprintf(_("ERROR! Failed to create automatic backup") + ": %s", errorString); + strAutoDenomResult = _("ERROR! Failed to create automatic backup") + Untranslated(": ") + errorString; + LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- %s\n", strAutoDenomResult.original); return false; } } @@ -797,8 +798,8 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, bool fDr if (deterministicMNManager->GetListAtChainTip().GetValidMNsCount() == 0 && Params().NetworkIDString() != CBaseChainParams::REGTEST) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- No Masternodes detected\n"); strAutoDenomResult = _("No Masternodes detected."); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- %s\n", strAutoDenomResult.original); return false; } @@ -827,8 +828,8 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, bool fDr // mixable balance is way too small if (nBalanceAnonymizable < nValueMin) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- Not enough funds to mix\n"); strAutoDenomResult = _("Not enough funds to mix."); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- %s\n", strAutoDenomResult.original); return false; } @@ -902,8 +903,8 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CConnman& connman, bool fDr // should be no unconfirmed denoms in non-multi-session mode if (!CCoinJoinClientOptions::IsMultiSessionEnabled() && nBalanceDenominatedUnconf > 0) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- Found unconfirmed denominated outputs, will wait till they confirm to continue.\n"); strAutoDenomResult = _("Found unconfirmed denominated outputs, will wait till they confirm to continue."); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::DoAutomaticDenominating -- %s\n", strAutoDenomResult.original); return false; } @@ -978,8 +979,8 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CConnman& connman, bool fDr if (!CheckAutomaticBackup()) return false; if (WaitForAnotherBlock()) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::DoAutomaticDenominating -- Last successful action was too recent\n"); strAutoDenomResult = _("Last successful action was too recent."); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::DoAutomaticDenominating -- %s\n", strAutoDenomResult.original); return false; } @@ -1110,8 +1111,8 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon std::set setAmounts; if (!mixingWallet.SelectDenominatedAmounts(nBalanceNeedsAnonymized, setAmounts)) { // this should never happen - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::StartNewQueue -- Can't mix: no compatible inputs found!\n"); strAutoDenomResult = _("Can't mix: no compatible inputs found!"); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::StartNewQueue -- %s\n", strAutoDenomResult.original); return false; } @@ -1120,8 +1121,8 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon auto dmn = coinJoinClientManagers.at(mixingWallet.GetName())->GetRandomNotUsedMasternode(); if (!dmn) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::StartNewQueue -- Can't find random masternode!\n"); strAutoDenomResult = _("Can't find random Masternode."); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::StartNewQueue -- %s\n", strAutoDenomResult.original); return false; } @@ -1285,7 +1286,7 @@ bool CCoinJoinClientSession::SubmitDenominate(CConnman& connman) // Should never actually get here but just in case LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::SubmitDenominate -- Running CoinJoin denominate for all rounds, error: %s\n", strError); - strAutoDenomResult = strError; + strAutoDenomResult = Untranslated(strError); return false; } @@ -1497,15 +1498,15 @@ bool CCoinJoinClientSession::MakeCollateralAmounts(const CompactTallyItem& tally assert(txBuilder.IsDust(txBuilder.GetAmountLeft())); - std::string strResult; + bilingual_str strResult; if (!txBuilder.Commit(strResult)) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- Commit failed: %s\n", __func__, strResult); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- Commit failed: %s\n", __func__, strResult.original); return false; } coinJoinClientManagers.at(mixingWallet.GetName())->UpdatedSuccessBlock(); - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- txid: %s\n", __func__, strResult); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- txid: %s\n", __func__, strResult.original); return true; } @@ -1774,16 +1775,16 @@ bool CCoinJoinClientSession::CreateDenominated(CAmount nBalanceToDenominate, con return false; } - std::string strResult; + bilingual_str strResult; if (!txBuilder.Commit(strResult)) { - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- Commit failed: %s\n", __func__, strResult); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- Commit failed: %s\n", __func__, strResult.original); return false; } // use the same nCachedLastSuccessBlock as for DS mixing to prevent race coinJoinClientManagers.at(mixingWallet.GetName())->UpdatedSuccessBlock(); - LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- txid: %s\n", __func__, strResult); + LogPrint(BCLog::COINJOIN, "CCoinJoinClientSession::%s -- txid: %s\n", __func__, strResult.original); return true; } diff --git a/src/coinjoin/client.h b/src/coinjoin/client.h index 8148455c76..6faba4106d 100644 --- a/src/coinjoin/client.h +++ b/src/coinjoin/client.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -71,8 +72,8 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession private: std::vector vecOutPointLocked; - std::string strLastMessage; - std::string strAutoDenomResult; + bilingual_str strLastMessage; + bilingual_str strAutoDenomResult; CDeterministicMNCPtr mixingMasternode; CMutableTransaction txMyCollateral; // client side collateral @@ -128,7 +129,7 @@ public: void ResetPool(); - std::string GetStatus(bool fWaitForBlock) const; + bilingual_str GetStatus(bool fWaitForBlock) const; bool GetMixingMasternodeInfo(CDeterministicMNCPtr& ret) const; @@ -171,7 +172,7 @@ private: int nCachedLastSuccessBlock{0}; int nMinBlocksToWait{1}; // how many blocks to wait for after one successful mixing tx in non-multisession mode - std::string strAutoDenomResult; + bilingual_str strAutoDenomResult; CWallet& mixingWallet; @@ -201,7 +202,7 @@ public: bool IsMixing() const; void ResetPool(); - std::string GetStatuses(); + bilingual_str GetStatuses(); std::string GetSessionDenoms(); bool GetMixingMasternodesInfo(std::vector& vecDmnsRet) const; diff --git a/src/coinjoin/coinjoin.cpp b/src/coinjoin/coinjoin.cpp index c28b2666a8..4a87744bcd 100644 --- a/src/coinjoin/coinjoin.cpp +++ b/src/coinjoin/coinjoin.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -374,7 +375,7 @@ std::string CCoinJoin::DenominationToString(int nDenom) return "to-string-error"; } -std::string CCoinJoin::GetMessageByID(PoolMessage nMessageID) +bilingual_str CCoinJoin::GetMessageByID(PoolMessage nMessageID) { switch (nMessageID) { case ERR_ALREADY_HAVE: diff --git a/src/coinjoin/coinjoin.h b/src/coinjoin/coinjoin.h index 554e8a63ba..ad245aeb5e 100644 --- a/src/coinjoin/coinjoin.h +++ b/src/coinjoin/coinjoin.h @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -440,7 +441,7 @@ public: */ static std::string DenominationToString(int nDenom); - static std::string GetMessageByID(PoolMessage nMessageID); + static bilingual_str GetMessageByID(PoolMessage nMessageID); /// Get the minimum/maximum number of participants for the pool static int GetMinPoolParticipants(); diff --git a/src/coinjoin/server.cpp b/src/coinjoin/server.cpp index 58a3009382..64574ec665 100644 --- a/src/coinjoin/server.cpp +++ b/src/coinjoin/server.cpp @@ -625,7 +625,7 @@ bool CCoinJoinServer::AddEntry(CConnman& connman, const CCoinJoinEntry& entry, P bool fConsumeCollateral{false}; if (!IsValidInOuts(vin, entry.vecTxOut, nMessageIDRet, &fConsumeCollateral)) { - LogPrint(BCLog::COINJOIN, "CCoinJoinServer::%s -- ERROR! IsValidInOuts() failed: %s\n", __func__, CCoinJoin::GetMessageByID(nMessageIDRet)); + LogPrint(BCLog::COINJOIN, "CCoinJoinServer::%s -- ERROR! IsValidInOuts() failed: %s\n", __func__, CCoinJoin::GetMessageByID(nMessageIDRet).translated); if (fConsumeCollateral) { ConsumeCollateral(connman, entry.txCollateral); } diff --git a/src/coinjoin/util.cpp b/src/coinjoin/util.cpp index b9bde738b7..65f18e4162 100644 --- a/src/coinjoin/util.cpp +++ b/src/coinjoin/util.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -254,7 +255,7 @@ bool CTransactionBuilder::IsDust(CAmount nAmount) const return ::IsDust(CTxOut(nAmount, ::GetScriptForDestination(tallyItem.txdest)), coinControl.m_discard_feerate.get()); } -bool CTransactionBuilder::Commit(std::string& strResult) +bool CTransactionBuilder::Commit(bilingual_str& strResult) { CAmount nFeeRet = 0; int nChangePosRet = -1; @@ -278,13 +279,13 @@ bool CTransactionBuilder::Commit(std::string& strResult) bool fDust = IsDust(nAmountLeft); // If there is a either remainder which is considered to be dust (will be added to fee in this case) or no amount left there should be no change output, return if there is a change output. if (nChangePosRet != -1 && fDust) { - strResult = strprintf("Unexpected change output %s at position %d", tx->vout[nChangePosRet].ToString(), nChangePosRet); + strResult = Untranslated(strprintf("Unexpected change output %s at position %d", tx->vout[nChangePosRet].ToString(), nChangePosRet)); return false; } // If there is a remainder which is not considered to be dust it should end up in a change output, return if not. if (nChangePosRet == -1 && !fDust) { - strResult = strprintf("Change output missing: %d", nAmountLeft); + strResult = Untranslated(strprintf("Change output missing: %d", nAmountLeft)); return false; } @@ -301,7 +302,7 @@ bool CTransactionBuilder::Commit(std::string& strResult) // If the calculated fee does not match the fee returned by CreateTransaction aka if this check fails something is wrong! CAmount nFeeCalc = GetFee(GetBytesTotal() + nBytesAdditional) + nFeeAdditional; if (nFeeRet != nFeeCalc) { - strResult = strprintf("Fee validation failed -> nFeeRet: %d, nFeeCalc: %d, nFeeAdditional: %d, nBytesAdditional: %d, %s", nFeeRet, nFeeCalc, nFeeAdditional, nBytesAdditional, ToString()); + strResult = Untranslated(strprintf("Fee validation failed -> nFeeRet: %d, nFeeCalc: %d, nFeeAdditional: %d, nBytesAdditional: %d, %s", nFeeRet, nFeeCalc, nFeeAdditional, nBytesAdditional, ToString())); return false; } @@ -309,7 +310,7 @@ bool CTransactionBuilder::Commit(std::string& strResult) fKeepKeys = true; - strResult = tx->GetHash().ToString(); + strResult = Untranslated(tx->GetHash().ToString()); return true; } diff --git a/src/coinjoin/util.h b/src/coinjoin/util.h index debdc3dfd0..6ea99976c4 100644 --- a/src/coinjoin/util.h +++ b/src/coinjoin/util.h @@ -8,6 +8,7 @@ #include class CTransactionBuilder; +struct bilingual_str; class CKeyHolder { @@ -116,7 +117,7 @@ public: /// Get the total number of added outputs int CountOutputs() const { LOCK(cs_outputs); return vecOutputs.size(); } /// Create and Commit the transaction to the wallet - bool Commit(std::string& strResult); + bool Commit(bilingual_str& strResult); /// Convert to a string std::string ToString() const; diff --git a/src/crypto/hkdf_sha256_32.cpp b/src/crypto/hkdf_sha256_32.cpp index 9cea5995ec..e684eced37 100644 --- a/src/crypto/hkdf_sha256_32.cpp +++ b/src/crypto/hkdf_sha256_32.cpp @@ -9,7 +9,7 @@ CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const unsigned char* ikm, size_t ikmlen, const std::string& salt) { - CHMAC_SHA256((const unsigned char*)salt.c_str(), salt.size()).Write(ikm, ikmlen).Finalize(m_prk); + CHMAC_SHA256((const unsigned char*)salt.data(), salt.size()).Write(ikm, ikmlen).Finalize(m_prk); } void CHKDF_HMAC_SHA256_L32::Expand32(const std::string& info, unsigned char hash[OUTPUT_SIZE]) diff --git a/src/dash-cli.cpp b/src/dash-cli.cpp index cddc1eca49..0e8ddca666 100644 --- a/src/dash-cli.cpp +++ b/src/dash-cli.cpp @@ -14,9 +14,11 @@ #include #include #include -#include #include +#include +#include +#include #include #include #include @@ -109,7 +111,7 @@ static int AppInitRPC(int argc, char* argv[]) SetupCliArgs(); std::string error; if (!gArgs.ParseParameters(argc, argv, error)) { - tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str()); + tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error); return EXIT_FAILURE; } @@ -129,7 +131,7 @@ static int AppInitRPC(int argc, char* argv[]) strUsage += "\n" + gArgs.GetHelpMessage(); } - tfm::format(std::cout, "%s", strUsage.c_str()); + tfm::format(std::cout, "%s", strUsage); if (argc < 2) { tfm::format(std::cerr, "Error: too few parameters\n"); return EXIT_FAILURE; @@ -138,15 +140,15 @@ static int AppInitRPC(int argc, char* argv[]) } bool datadirFromCmdLine = gArgs.IsArgSet("-datadir"); if (datadirFromCmdLine && !fs::is_directory(GetDataDir(false))) { - tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str()); + tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")); return EXIT_FAILURE; } if (!gArgs.ReadConfigFiles(error, true)) { - tfm::format(std::cerr, "Error reading configuration file: %s\n", error.c_str()); + tfm::format(std::cerr, "Error reading configuration file: %s\n", error); return EXIT_FAILURE; } if (!datadirFromCmdLine && !fs::is_directory(GetDataDir(false))) { - tfm::format(std::cerr, "Error: Specified data directory \"%s\" from config file does not exist.\n", gArgs.GetArg("-datadir", "").c_str()); + tfm::format(std::cerr, "Error: Specified data directory \"%s\" from config file does not exist.\n", gArgs.GetArg("-datadir", "")); return EXIT_FAILURE; } // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) @@ -411,7 +413,7 @@ static UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, co if (failedToGetAuthCookie) { throw std::runtime_error(strprintf( "Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (%s)", - GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)).string().c_str())); + GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)).string())); } else { throw std::runtime_error("Authorization failed: Incorrect rpcuser or rpcpassword"); } @@ -559,7 +561,7 @@ static int CommandLineRPC(int argc, char *argv[]) } if (strPrint != "") { - tfm::format(nRet == 0 ? std::cout : std::cerr, "%s\n", strPrint.c_str()); + tfm::format(nRet == 0 ? std::cout : std::cerr, "%s\n", strPrint); } return nRet; } diff --git a/src/dash-tx.cpp b/src/dash-tx.cpp index e791cc81fe..20c3f3ceeb 100644 --- a/src/dash-tx.cpp +++ b/src/dash-tx.cpp @@ -17,10 +17,12 @@ #include