diff options
45 files changed, 1371 insertions, 970 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index a73a2c379b..8aceb0390f 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = bitcoin-qt -VERSION = 0.7.0 +VERSION = 0.7.1 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE CONFIG += no_include_pwd @@ -125,7 +125,6 @@ HEADERS += src/qt/bitcoingui.h \ src/util.h \ src/uint256.h \ src/serialize.h \ - src/strlcpy.h \ src/main.h \ src/net.h \ src/key.h \ diff --git a/doc/README b/doc/README index bc6468e673..b20da7fb05 100644 --- a/doc/README +++ b/doc/README @@ -1,4 +1,4 @@ -Bitcoin 0.7.0 BETA +Bitcoin 0.7.1 BETA Copyright (c) 2009-2012 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying diff --git a/doc/README_windows.txt b/doc/README_windows.txt index 4d9b4b20a4..7ec86d7131 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -1,4 +1,4 @@ -Bitcoin 0.7.0 BETA
+Bitcoin 0.7.1 BETA
Copyright (c) 2009-2012 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
diff --git a/doc/assets-attribution.txt b/doc/assets-attribution.txt index c66665d012..0693d535c3 100644 --- a/doc/assets-attribution.txt +++ b/doc/assets-attribution.txt @@ -1,7 +1,3 @@ -Code: src/strlcpy.h -Author: Todd C. Miller <Todd.Miller@courtesan.com> -License: ISC - Icon: src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png, src/qt/res/src/*.svg Designer: Wladimir van der Laan diff --git a/doc/release-notes.txt b/doc/release-notes.txt index 3c975af92f..b7f7dfb402 100644 --- a/doc/release-notes.txt +++ b/doc/release-notes.txt @@ -19,8 +19,55 @@ Ubuntu PPA version), then run the old version again with the -detachdb argument and shut it down; if you do not, then the new version will not be able to read the database files and will exit with an error. +Explanation of -detachdb (and the new "stop true" RPC command): +The Berkeley DB database library stores data in both ".dat" and +"log" files, so the database is always in a consistent state, +even in case of power failure or other sudden shutdown. The +format of the ".dat" files is portable between different +versions of Berkeley DB, but the "log" files are not-- even minor +version differences may have incompatible "log" files. The +-detachdb option moves any pending changes from the "log" files +to the "blkindex.dat" file for maximum compatibility, but makes +shutdown much slower. Note that the "wallet.dat" file is always +detached, and versions prior to 0.6.0 detached all databases +at shutdown. + +New features +------------ + +* Added a boolean argument to the RPC 'stop' command, if true sets + -detachdb to create standalone database .dat files before shutting down. + +* -salvagewallet command-line option, which moves any existing wallet.dat + to wallet.{timestamp}.dat and then attempts to salvage public/private + keys and master encryption keys (if the wallet is encrypted) into + a new wallet.dat. This should only be used if your wallet becomes + corrupted, and is not intended to replace regular wallet backups. + +* Import $DataDir/bootstrap.dat automatically, if it exists. + +Dependency changes +------------------ + +* Qt 4.8.2 for Windows builds + +* openssl 1.0.1c + Bug fixes --------- + +* When running -testnet, use RPC port 18332 by default. + +* Better detection and handling of corrupt wallet.dat and blkindex.dat files. + Previous versions would crash with a DB_RUNRECOVERY exception, this + version detects most problems and tells you how to recover if it + cannot recover itself. + * Fixed an uninitialized variable bug that could cause transactions to be reported out of order. +* Fixed a bug that could cause occasional crashes on exit. + +* Warn the user that they need to create fresh wallet backups after they + encrypt their wallet. + diff --git a/doc/translation_process.md b/doc/translation_process.md index 7ef22d83b0..1724e95378 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -34,7 +34,9 @@ This directory contains all translations. Filenames must adhere to this format: source for all other translations. Whenever a string in the code is changed this file must be updated to reflect those changes. This can be accomplished by running `lupdate` (included in the Qt SDK). Also, a custom script is used -to extract strings from the non-Qt parts: +to extract strings from the non-Qt parts. This script makes use of `gettext`, +so make sure that utility is installed (ie, `apt-get install gettext` on +Ubuntu/Debian): python share/qt/extract_strings_qt.py lupdate bitcoin-qt.pro -no-obsolete -locations relative -ts src/qt/locale/bitcoin_en.ts diff --git a/share/setup.nsi b/share/setup.nsi index f799987ed9..fd7451ea76 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma # General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 0.7.0
+!define VERSION 0.7.1
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
@@ -45,13 +45,13 @@ Var StartMenuGroup !insertmacro MUI_LANGUAGE English
# Installer attributes
-OutFile bitcoin-0.7.0-win32-setup.exe
+OutFile bitcoin-0.7.1-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
-VIProductVersion 0.7.0.3
+VIProductVersion 0.7.1.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 912f0c4113..829c8ee2d7 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -69,7 +69,7 @@ void RPCTypeCheck(const Array& params, { string err = strprintf("Expected type %s, got %s", Value_type_name[t], Value_type_name[v.type()]); - throw JSONRPCError(-3, err); + throw JSONRPCError(RPC_TYPE_ERROR, err); } i++; } @@ -83,13 +83,13 @@ void RPCTypeCheck(const Object& o, { const Value& v = find_value(o, t.first); if (!fAllowNull && v.type() == null_type) - throw JSONRPCError(-3, strprintf("Missing %s", t.first.c_str())); + throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first.c_str())); if (!((v.type() == t.second) || (fAllowNull && (v.type() == null_type)))) { string err = strprintf("Expected type %s for %s, got %s", Value_type_name[t.second], t.first.c_str(), Value_type_name[v.type()]); - throw JSONRPCError(-3, err); + throw JSONRPCError(RPC_TYPE_ERROR, err); } } } @@ -98,10 +98,10 @@ int64 AmountFromValue(const Value& value) { double dAmount = value.get_real(); if (dAmount <= 0.0 || dAmount > 21000000.0) - throw JSONRPCError(-3, "Invalid amount"); + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount"); int64 nAmount = roundint64(dAmount * COIN); if (!MoneyRange(nAmount)) - throw JSONRPCError(-3, "Invalid amount"); + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount"); return nAmount; } @@ -317,7 +317,7 @@ string rfc1123Time() static string HTTPReply(int nStatus, const string& strMsg, bool keepalive) { - if (nStatus == 401) + if (nStatus == HTTP_UNAUTHORIZED) return strprintf("HTTP/1.0 401 Authorization Required\r\n" "Date: %s\r\n" "Server: bitcoin-json-rpc/%s\r\n" @@ -335,11 +335,11 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive) "<BODY><H1>401 Unauthorized.</H1></BODY>\r\n" "</HTML>\r\n", rfc1123Time().c_str(), FormatFullVersion().c_str()); const char *cStatus; - if (nStatus == 200) cStatus = "OK"; - else if (nStatus == 400) cStatus = "Bad Request"; - else if (nStatus == 403) cStatus = "Forbidden"; - else if (nStatus == 404) cStatus = "Not Found"; - else if (nStatus == 500) cStatus = "Internal Server Error"; + if (nStatus == HTTP_OK) cStatus = "OK"; + else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request"; + else if (nStatus == HTTP_FORBIDDEN) cStatus = "Forbidden"; + else if (nStatus == HTTP_NOT_FOUND) cStatus = "Not Found"; + else if (nStatus == HTTP_INTERNAL_SERVER_ERROR) cStatus = "Internal Server Error"; else cStatus = ""; return strprintf( "HTTP/1.1 %d %s\r\n" @@ -366,7 +366,7 @@ int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto) vector<string> vWords; boost::split(vWords, str, boost::is_any_of(" ")); if (vWords.size() < 2) - return 500; + return HTTP_INTERNAL_SERVER_ERROR; proto = 0; const char *ver = strstr(str.c_str(), "HTTP/1."); if (ver != NULL) @@ -411,7 +411,7 @@ int ReadHTTP(std::basic_istream<char>& stream, map<string, string>& mapHeadersRe // Read header int nLen = ReadHTTPHeader(stream, mapHeadersRet); if (nLen < 0 || nLen > (int)MAX_SIZE) - return 500; + return HTTP_INTERNAL_SERVER_ERROR; // Read message if (nLen > 0) @@ -484,10 +484,10 @@ string JSONRPCReply(const Value& result, const Value& error, const Value& id) void ErrorReply(std::ostream& stream, const Object& objError, const Value& id) { // Send error reply from json-rpc error object - int nStatus = 500; + int nStatus = HTTP_INTERNAL_SERVER_ERROR; int code = find_value(objError, "code").get_int(); - if (code == -32600) nStatus = 400; - else if (code == -32601) nStatus = 404; + if (code == RPC_INVALID_REQUEST) nStatus = HTTP_BAD_REQUEST; + else if (code == RPC_METHOD_NOT_FOUND) nStatus = HTTP_NOT_FOUND; string strReply = JSONRPCReply(Value::null, objError, id); stream << HTTPReply(nStatus, strReply, false) << std::flush; } @@ -699,7 +699,7 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, { // Only send a 403 if we're not using SSL to prevent a DoS during the SSL handshake. if (!fUseSSL) - conn->stream() << HTTPReply(403, "", false) << std::flush; + conn->stream() << HTTPReply(HTTP_FORBIDDEN, "", false) << std::flush; delete conn; } @@ -796,7 +796,7 @@ void ThreadRPCServer2(void* parg) } catch(boost::system::system_error &e) { - strerr = strprintf(_("An error occurred while setting up the RPC port %i for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what()); + strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what()); } try { @@ -854,7 +854,7 @@ void JSONRequest::parse(const Value& valRequest) { // Parse request if (valRequest.type() != obj_type) - throw JSONRPCError(-32600, "Invalid Request object"); + throw JSONRPCError(RPC_INVALID_REQUEST, "Invalid Request object"); const Object& request = valRequest.get_obj(); // Parse id now so errors from here on will have the id @@ -863,9 +863,9 @@ void JSONRequest::parse(const Value& valRequest) // Parse method Value valMethod = find_value(request, "method"); if (valMethod.type() == null_type) - throw JSONRPCError(-32600, "Missing method"); + throw JSONRPCError(RPC_INVALID_REQUEST, "Missing method"); if (valMethod.type() != str_type) - throw JSONRPCError(-32600, "Method must be a string"); + throw JSONRPCError(RPC_INVALID_REQUEST, "Method must be a string"); strMethod = valMethod.get_str(); if (strMethod != "getwork" && strMethod != "getblocktemplate") printf("ThreadRPCServer method=%s\n", strMethod.c_str()); @@ -877,7 +877,7 @@ void JSONRequest::parse(const Value& valRequest) else if (valParams.type() == null_type) params = Array(); else - throw JSONRPCError(-32600, "Params must be an array"); + throw JSONRPCError(RPC_INVALID_REQUEST, "Params must be an array"); } static Object JSONRPCExecOne(const Value& req) @@ -898,7 +898,7 @@ static Object JSONRPCExecOne(const Value& req) catch (std::exception& e) { rpc_result = JSONRPCReplyObj(Value::null, - JSONRPCError(-32700, e.what()), jreq.id); + JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); } return rpc_result; @@ -946,7 +946,7 @@ void ThreadRPCServer3(void* parg) // Check authorization if (mapHeaders.count("authorization") == 0) { - conn->stream() << HTTPReply(401, "", false) << std::flush; + conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; break; } if (!HTTPAuthorized(mapHeaders)) @@ -958,7 +958,7 @@ void ThreadRPCServer3(void* parg) if (mapArgs["-rpcpassword"].size() < 20) Sleep(250); - conn->stream() << HTTPReply(401, "", false) << std::flush; + conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; break; } if (mapHeaders["connection"] == "close") @@ -970,7 +970,7 @@ void ThreadRPCServer3(void* parg) // Parse request Value valRequest; if (!read_string(strRequest, valRequest)) - throw JSONRPCError(-32700, "Parse error"); + throw JSONRPCError(RPC_PARSE_ERROR, "Parse error"); string strReply; @@ -987,9 +987,9 @@ void ThreadRPCServer3(void* parg) } else if (valRequest.type() == array_type) strReply = JSONRPCExecBatch(valRequest.get_array()); else - throw JSONRPCError(-32700, "Top-level object parse error"); + throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error"); - conn->stream() << HTTPReply(200, strReply, fRun) << std::flush; + conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush; } catch (Object& objError) { @@ -998,7 +998,7 @@ void ThreadRPCServer3(void* parg) } catch (std::exception& e) { - ErrorReply(conn->stream(), JSONRPCError(-32700, e.what()), jreq.id); + ErrorReply(conn->stream(), JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); break; } } @@ -1015,13 +1015,13 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s // Find method const CRPCCommand *pcmd = tableRPC[strMethod]; if (!pcmd) - throw JSONRPCError(-32601, "Method not found"); + throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found"); // Observe safe mode string strWarning = GetWarnings("rpc"); if (strWarning != "" && !GetBoolArg("-disablesafemode") && !pcmd->okSafeMode) - throw JSONRPCError(-2, string("Safe mode: ") + strWarning); + throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, string("Safe mode: ") + strWarning); try { @@ -1039,7 +1039,7 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s } catch (std::exception& e) { - throw JSONRPCError(-1, e.what()); + throw JSONRPCError(RPC_MISC_ERROR, e.what()); } } @@ -1077,9 +1077,9 @@ Object CallRPC(const string& strMethod, const Array& params) map<string, string> mapHeaders; string strReply; int nStatus = ReadHTTP(stream, mapHeaders, strReply); - if (nStatus == 401) + if (nStatus == HTTP_UNAUTHORIZED) throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)"); - else if (nStatus >= 400 && nStatus != 400 && nStatus != 404 && nStatus != 500) + else if (nStatus >= 400 && nStatus != HTTP_BAD_REQUEST && nStatus != HTTP_NOT_FOUND && nStatus != HTTP_INTERNAL_SERVER_ERROR) throw runtime_error(strprintf("server returned HTTP error %d", nStatus)); else if (strReply.empty()) throw runtime_error("no response from server"); diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 94446c36bb..89ab976f56 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -18,6 +18,53 @@ class CBlockIndex; #include "util.h" +// HTTP status codes +enum HTTPStatusCode +{ + HTTP_OK = 200, + HTTP_BAD_REQUEST = 400, + HTTP_UNAUTHORIZED = 401, + HTTP_FORBIDDEN = 403, + HTTP_NOT_FOUND = 404, + HTTP_INTERNAL_SERVER_ERROR = 500, +}; + +// Bitcoin RPC error codes +enum RPCErrorCode +{ + // Standard JSON-RPC 2.0 errors + RPC_INVALID_REQUEST = -32600, + RPC_METHOD_NOT_FOUND = -32601, + RPC_INVALID_PARAMS = -32602, + RPC_INTERNAL_ERROR = -32603, + RPC_PARSE_ERROR = -32700, + + // General application defined errors + RPC_MISC_ERROR = -1, // std::exception thrown in command handling + RPC_FORBIDDEN_BY_SAFE_MODE = -2, // Server is in safe mode, and command is not allowed in safe mode + RPC_TYPE_ERROR = -3, // Unexpected type was passed as parameter + RPC_INVALID_ADDRESS_OR_KEY = -5, // Invalid address or key + RPC_OUT_OF_MEMORY = -7, // Ran out of memory during operation + RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter + RPC_DATABASE_ERROR = -20, // Database error + RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format + + // P2P client errors + RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected + RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, // Still downloading initial blocks + + // Wallet errors + RPC_WALLET_ERROR = -4, // Unspecified problem with wallet (key not found etc.) + RPC_WALLET_INSUFFICIENT_FUNDS = -6, // Not enough funds in wallet or account + RPC_WALLET_INVALID_ACCOUNT_NAME = -11, // Invalid account name + RPC_WALLET_KEYPOOL_RAN_OUT = -12, // Keypool ran out, call keypoolrefill first + RPC_WALLET_UNLOCK_NEEDED = -13, // Enter the wallet passphrase with walletpassphrase first + RPC_WALLET_PASSPHRASE_INCORRECT = -14, // The wallet passphrase entered was incorrect + RPC_WALLET_WRONG_ENC_STATE = -15, // Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.) + RPC_WALLET_ENCRYPTION_FAILED = -16, // Failed to encrypt the wallet + RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked +}; + json_spirit::Object JSONRPCError(int code, const std::string& message); void ThreadRPCServer(void* parg); diff --git a/src/clientversion.h b/src/clientversion.h index 548105383c..2f695e5cc6 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -8,8 +8,8 @@ // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 7 -#define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 99 +#define CLIENT_VERSION_REVISION 1 +#define CLIENT_VERSION_BUILD 0 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! diff --git a/src/db.cpp b/src/db.cpp index 867703fbd2..9ad67892f1 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -34,19 +34,14 @@ void CDBEnv::EnvShutdown() return; fDbEnvInit = false; - try - { - dbenv.close(0); - } - catch (const DbException& e) - { - printf("EnvShutdown exception: %s (%d)\n", e.what(), e.get_errno()); - } + int ret = dbenv.close(0); + if (ret != 0) + printf("EnvShutdown exception: %s (%d)\n", DbEnv::strerror(ret), ret); if (!fMockDb) DbEnv(0).remove(GetDataDir().string().c_str(), 0); } -CDBEnv::CDBEnv() : dbenv(0) +CDBEnv::CDBEnv() : dbenv(DB_CXX_NO_EXCEPTIONS) { } @@ -100,8 +95,8 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_) DB_RECOVER | nEnvFlags, S_IRUSR | S_IWUSR); - if (ret > 0) - return error("CDB() : error %d opening database environment", ret); + if (ret != 0) + return error("CDB() : error %s (%d) opening database environment", DbEnv::strerror(ret), ret); fDbEnvInit = true; fMockDb = false; @@ -141,6 +136,69 @@ void CDBEnv::MakeMock() fMockDb = true; } +CDBEnv::VerifyResult CDBEnv::Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)) +{ + LOCK(cs_db); + assert(mapFileUseCount.count(strFile) == 0); + + Db db(&dbenv, 0); + int result = db.verify(strFile.c_str(), NULL, NULL, 0); + if (result == 0) + return VERIFY_OK; + else if (recoverFunc == NULL) + return RECOVER_FAIL; + + // Try to recover: + bool fRecovered = (*recoverFunc)(*this, strFile); + return (fRecovered ? RECOVER_OK : RECOVER_FAIL); +} + +bool CDBEnv::Salvage(std::string strFile, bool fAggressive, + std::vector<CDBEnv::KeyValPair >& vResult) +{ + LOCK(cs_db); + assert(mapFileUseCount.count(strFile) == 0); + + u_int32_t flags = DB_SALVAGE; + if (fAggressive) flags |= DB_AGGRESSIVE; + + stringstream strDump; + + Db db(&dbenv, 0); + int result = db.verify(strFile.c_str(), NULL, &strDump, flags); + if (result != 0) + { + printf("ERROR: db salvage failed\n"); + return false; + } + + // Format of bdb dump is ascii lines: + // header lines... + // HEADER=END + // hexadecimal key + // hexadecimal value + // ... repeated + // DATA=END + + string strLine; + while (!strDump.eof() && strLine != "HEADER=END") + getline(strDump, strLine); // Skip past header + + std::string keyHex, valueHex; + while (!strDump.eof() && keyHex != "DATA=END") + { + getline(strDump, keyHex); + if (keyHex != "DATA_END") + { + getline(strDump, valueHex); + vResult.push_back(make_pair(ParseHex(keyHex),ParseHex(valueHex))); + } + } + + return (result == 0); +} + + void CDBEnv::CheckpointLSN(std::string strFile) { dbenv.txn_checkpoint(0, 0, 0); @@ -191,7 +249,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : nFlags, // Flags 0); - if (ret > 0) + if (ret != 0) { delete pdb; pdb = NULL; @@ -262,6 +320,15 @@ void CDBEnv::CloseDb(const string& strFile) } } +bool CDBEnv::RemoveDb(const string& strFile) +{ + this->CloseDb(strFile); + + LOCK(cs_db); + int rc = dbenv.dbremove(NULL, strFile.c_str(), NULL, DB_AUTO_COMMIT); + return (rc == 0); +} + bool CDB::Rewrite(const string& strFile, const char* pszSkip) { while (!fShutdown) @@ -50,6 +50,25 @@ public: ~CDBEnv(); void MakeMock(); bool IsMock() { return fMockDb; }; + + /* + * Verify that database file strFile is OK. If it is not, + * call the callback to try to recover. + * This must be called BEFORE strFile is opened. + * Returns true if strFile is OK. + */ + enum VerifyResult { VERIFY_OK, RECOVER_OK, RECOVER_FAIL }; + VerifyResult Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)); + /* + * Salvage data from a file that Verify says is bad. + * fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation). + * Appends binary key/value pairs to vResult, returns true if successful. + * NOTE: reads the entire database into memory, so cannot be used + * for huge databases. + */ + typedef std::pair<std::vector<unsigned char>, std::vector<unsigned char> > KeyValPair; + bool Salvage(std::string strFile, bool fAggressive, std::vector<KeyValPair>& vResult); + bool Open(boost::filesystem::path pathEnv_); void Close(); void Flush(bool fShutdown); @@ -58,6 +77,7 @@ public: bool GetDetach() { return fDetachDB; } void CloseDb(const std::string& strFile); + bool RemoveDb(const std::string& strFile); DbTxn *TxnBegin(int flags=DB_TXN_WRITE_NOSYNC) { diff --git a/src/init.cpp b/src/init.cpp index 7e2cda6297..bdddc631da 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -144,7 +144,7 @@ bool AppInit(int argc, char* argv[]) strUsage += "\n" + HelpMessage(); - fprintf(stderr, "%s", strUsage.c_str()); + fprintf(stdout, "%s", strUsage.c_str()); return false; } @@ -279,6 +279,7 @@ std::string HelpMessage() " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" + " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n" + + " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n" + " -checkblocks=<n> " + _("How many blocks to check at startup (default: 2500, 0 = all)") + "\n" + " -checklevel=<n> " + _("How thorough the block verification is (0-6, default: 1)") + "\n" + " -loadblock=<file> " + _("Imports blocks from external blk000?.dat file") + "\n" + @@ -379,6 +380,11 @@ bool AppInit2() SoftSetBoolArg("-discover", false); } + if (GetBoolArg("-salvagewallet")) { + // Rewrite just private keys: rescan to find transactions + SoftSetBoolArg("-rescan", true); + } + // ********************************************************* Step 3: parameter-to-internal-flags fDebug = GetBoolArg("-debug"); @@ -434,13 +440,15 @@ bool AppInit2() // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log + const char* pszDataDir = GetDataDir().string().c_str(); + // Make sure only a single Bitcoin process is using the data directory. boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist. if (file) fclose(file); 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 is probably already running."), GetDataDir().string().c_str())); + return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin is probably already running."), pszDataDir)); #if !defined(WIN32) && !defined(QT_GUI) if (fDaemon) @@ -472,7 +480,7 @@ bool AppInit2() if (!fLogTimestamps) printf("Startup time: %s\n", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str()); printf("Default data directory %s\n", GetDefaultDataDir().string().c_str()); - printf("Used data directory %s\n", GetDataDir().string().c_str()); + printf("Used data directory %s\n", pszDataDir); std::ostringstream strErrors; if (fDaemon) @@ -480,7 +488,41 @@ bool AppInit2() int64 nStart; - // ********************************************************* Step 5: network initialization + // ********************************************************* Step 5: verify database integrity + + uiInterface.InitMessage(_("Verifying database integrity...")); + + if (!bitdb.Open(GetDataDir())) + { + string msg = strprintf(_("Error initializing database environment %s!" + " To recover, BACKUP THAT DIRECTORY, then remove" + " everything from it except for wallet.dat."), pszDataDir); + return InitError(msg); + } + + if (GetBoolArg("-salvagewallet")) + { + // Recover readable keypairs: + if (!CWalletDB::Recover(bitdb, "wallet.dat", true)) + return false; + } + + if (filesystem::exists(GetDataDir() / "wallet.dat")) + { + CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover); + if (r == CDBEnv::RECOVER_OK) + { + string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!" + " Original wallet.dat saved as wallet.{timestamp}.bak in %s; if" + " your balance or transactions are incorrect you should" + " restore from a backup."), pszDataDir); + uiInterface.ThreadSafeMessageBox(msg, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); + } + if (r == CDBEnv::RECOVER_FAIL) + return InitError(_("wallet.dat corrupt, salvage failed")); + } + + // ********************************************************* Step 6: network initialization int nSocksVersion = GetArg("-socks", 5); @@ -586,7 +628,15 @@ bool AppInit2() BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"]) AddOneShot(strDest); - // ********************************************************* Step 6: load blockchain + // ********************************************************* Step 7: load blockchain + + if (!bitdb.Open(GetDataDir())) + { + string msg = strprintf(_("Error initializing database environment %s!" + " To recover, BACKUP THAT DIRECTORY, then remove" + " everything from it except for wallet.dat."), pszDataDir); + return InitError(msg); + } if (GetBoolArg("-loadblockindextest")) { @@ -600,7 +650,7 @@ bool AppInit2() printf("Loading block index...\n"); nStart = GetTimeMillis(); if (!LoadBlockIndex()) - strErrors << _("Error loading blkindex.dat") << "\n"; + return InitError(_("Error loading blkindex.dat")); // as LoadBlockIndex can take several minutes, it's possible the user // requested to kill bitcoin-qt during the last operation. If so, exit. @@ -641,18 +691,24 @@ bool AppInit2() return false; } - // ********************************************************* Step 7: load wallet + // ********************************************************* Step 8: load wallet uiInterface.InitMessage(_("Loading wallet...")); printf("Loading wallet...\n"); nStart = GetTimeMillis(); bool fFirstRun = true; pwalletMain = new CWallet("wallet.dat"); - int nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun); + DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun); if (nLoadWalletRet != DB_LOAD_OK) { if (nLoadWalletRet == DB_CORRUPT) strErrors << _("Error loading wallet.dat: Wallet corrupted") << "\n"; + else if (nLoadWalletRet == DB_NONCRITICAL_ERROR) + { + string msg(_("Warning: error reading wallet.dat! All keys read correctly, but transaction data" + " or address book entries might be missing or incorrect.")); + uiInterface.ThreadSafeMessageBox(msg, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); + } else if (nLoadWalletRet == DB_TOO_NEW) strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin") << "\n"; else if (nLoadWalletRet == DB_NEED_REWRITE) @@ -718,7 +774,7 @@ bool AppInit2() printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); } - // ********************************************************* Step 8: import blocks + // ********************************************************* Step 9: import blocks if (mapArgs.count("-loadblock")) { @@ -744,7 +800,7 @@ bool AppInit2() } } - // ********************************************************* Step 9: load peers + // ********************************************************* Step 10: load peers uiInterface.InitMessage(_("Loading addresses...")); printf("Loading addresses...\n"); @@ -759,7 +815,7 @@ bool AppInit2() printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", addrman.size(), GetTimeMillis() - nStart); - // ********************************************************* Step 10: start node + // ********************************************************* Step 11: start node if (!CheckDiskSpace()) return false; @@ -779,7 +835,7 @@ bool AppInit2() if (fServer) NewThread(ThreadRPCServer, NULL); - // ********************************************************* Step 11: finished + // ********************************************************* Step 12: finished uiInterface.InitMessage(_("Done loading")); printf("Done loading\n"); @@ -799,4 +855,3 @@ bool AppInit2() return true; } - diff --git a/src/irc.cpp b/src/irc.cpp index ec7eea3cf4..17d5ff1a5a 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -5,9 +5,10 @@ #include "irc.h" #include "net.h" -#include "strlcpy.h" #include "base58.h" +#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith() + using namespace std; using namespace boost; @@ -324,30 +325,27 @@ void ThreadIRCSeed2(void* parg) if (vWords.size() < 2) continue; - char pszName[10000]; - pszName[0] = '\0'; + std::string strName; if (vWords[1] == "352" && vWords.size() >= 8) { // index 7 is limited to 16 characters // could get full length name at index 10, but would be different from join messages - strlcpy(pszName, vWords[7].c_str(), sizeof(pszName)); + strName = vWords[7].c_str(); printf("IRC got who\n"); } if (vWords[1] == "JOIN" && vWords[0].size() > 1) { // :username!username@50000007.F000000B.90000002.IP JOIN :#channelname - strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName)); - if (strchr(pszName, '!')) - *strchr(pszName, '!') = '\0'; + strName = vWords[0].substr(1, vWords[0].find('!', 1) - 1); printf("IRC got join\n"); } - if (pszName[0] == 'u') + if (boost::algorithm::starts_with(strName, "u")) { CAddress addr; - if (DecodeAddress(pszName, addr)) + if (DecodeAddress(strName, addr)) { addr.nTime = GetAdjustedTime(); if (addrman.Add(addr, addrConnect, 51 * 60)) diff --git a/src/key.cpp b/src/key.cpp index 76c45d0635..23f315203e 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -186,10 +186,24 @@ void CKey::MakeNewKey(bool fCompressed) bool CKey::SetPrivKey(const CPrivKey& vchPrivKey) { const unsigned char* pbegin = &vchPrivKey[0]; - if (!d2i_ECPrivateKey(&pkey, &pbegin, vchPrivKey.size())) - return false; - fSet = true; - return true; + if (d2i_ECPrivateKey(&pkey, &pbegin, vchPrivKey.size())) + { + // In testing, d2i_ECPrivateKey can return true + // but fill in pkey with a key that fails + // EC_KEY_check_key, so: + if (EC_KEY_check_key(pkey)) + { + fSet = true; + return true; + } + } + // If vchPrivKey data is bad d2i_ECPrivateKey() can + // leave pkey in a state where calling EC_KEY_free() + // crashes. To avoid that, set pkey to NULL and + // leak the memory (a leak is better than a crash) + pkey = NULL; + Reset(); + return false; } bool CKey::SetSecret(const CSecret& vchSecret, bool fCompressed) @@ -245,12 +259,16 @@ CPrivKey CKey::GetPrivKey() const bool CKey::SetPubKey(const CPubKey& vchPubKey) { const unsigned char* pbegin = &vchPubKey.vchPubKey[0]; - if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.vchPubKey.size())) - return false; - fSet = true; - if (vchPubKey.vchPubKey.size() == 33) - SetCompressedPubKey(); - return true; + if (o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.vchPubKey.size())) + { + fSet = true; + if (vchPubKey.vchPubKey.size() == 33) + SetCompressedPubKey(); + return true; + } + pkey = NULL; + Reset(); + return false; } CPubKey CKey::GetPubKey() const @@ -377,6 +395,9 @@ bool CKey::IsValid() if (!fSet) return false; + if (!EC_KEY_check_key(pkey)) + return false; + bool fCompr; CSecret secret = GetSecret(fCompr); CKey key2; diff --git a/src/main.cpp b/src/main.cpp index da1072970c..28bf01a8cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2513,6 +2513,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // Ask the first connected node for block updates static int nAskedForBlocks = 0; if (!pfrom->fClient && !pfrom->fOneShot && + (pfrom->nStartingHeight > (nBestHeight - 144)) && (pfrom->nVersion < NOBLKS_VERSION_START || pfrom->nVersion >= NOBLKS_VERSION_END) && (nAskedForBlocks < 1 || vNodes.size() <= 1)) diff --git a/src/net.cpp b/src/net.cpp index 7c327f5d35..2598f0214e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -7,7 +7,6 @@ #include "db.h" #include "net.h" #include "init.h" -#include "strlcpy.h" #include "addrman.h" #include "ui_interface.h" @@ -1185,7 +1184,7 @@ void ThreadDNSAddressSeed2(void* parg) printf("Loading addresses from DNS seeds (could take a while)\n"); for (unsigned int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) { - if (GetNameProxy()) { + if (HaveNameProxy()) { AddOneShot(strDNSSeed[seed_idx][1]); } else { vector<CNetAddr> vaddr; @@ -1529,7 +1528,7 @@ void ThreadOpenAddedConnections2(void* parg) if (mapArgs.count("-addnode") == 0) return; - if (GetNameProxy()) { + if (HaveNameProxy()) { while(!fShutdown) { BOOST_FOREACH(string& strAddNode, mapMultiArgs["-addnode"]) { CAddress addr; diff --git a/src/netbase.cpp b/src/netbase.cpp index daa8a8d07e..dbf79ab3e0 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -5,20 +5,21 @@ #include "netbase.h" #include "util.h" +#include "sync.h" #ifndef WIN32 #include <sys/fcntl.h> #endif -#include "strlcpy.h" #include <boost/algorithm/string/case_conv.hpp> // for to_lower() +#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith() using namespace std; // Settings -typedef std::pair<CService, int> proxyType; static proxyType proxyInfo[NET_MAX]; static proxyType nameproxyInfo; +static CCriticalSection cs_proxyInfos; int nConnectTimeout = 5000; bool fNameLookup = false; @@ -118,18 +119,16 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsign bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup) { - if (pszName[0] == 0) + std::string str(pszName); + std::string strHost = str; + if (str.empty()) return false; - char psz[256]; - char *pszHost = psz; - strlcpy(psz, pszName, sizeof(psz)); - if (psz[0] == '[' && psz[strlen(psz)-1] == ']') + if (boost::algorithm::starts_with(str, "[") && boost::algorithm::ends_with(str, "]")) { - pszHost = psz+1; - psz[strlen(psz)-1] = 0; + strHost = str.substr(1, str.size() - 2); } - return LookupIntern(pszHost, vIP, nMaxSolutions, fAllowLookup); + return LookupIntern(strHost.c_str(), vIP, nMaxSolutions, fAllowLookup); } bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions) @@ -432,15 +431,17 @@ bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion) { return false; if (nSocksVersion != 0 && !addrProxy.IsValid()) return false; + LOCK(cs_proxyInfos); proxyInfo[net] = std::make_pair(addrProxy, nSocksVersion); return true; } -bool GetProxy(enum Network net, CService &addrProxy) { +bool GetProxy(enum Network net, proxyType &proxyInfoOut) { assert(net >= 0 && net < NET_MAX); + LOCK(cs_proxyInfos); if (!proxyInfo[net].second) return false; - addrProxy = proxyInfo[net].first; + proxyInfoOut = proxyInfo[net]; return true; } @@ -449,16 +450,27 @@ bool SetNameProxy(CService addrProxy, int nSocksVersion) { return false; if (nSocksVersion != 0 && !addrProxy.IsValid()) return false; + LOCK(cs_proxyInfos); nameproxyInfo = std::make_pair(addrProxy, nSocksVersion); return true; } -bool GetNameProxy() { +bool GetNameProxy(proxyType &nameproxyInfoOut) { + LOCK(cs_proxyInfos); + if (!nameproxyInfo.second) + return false; + nameproxyInfoOut = nameproxyInfo; + return true; +} + +bool HaveNameProxy() { + LOCK(cs_proxyInfos); return nameproxyInfo.second != 0; } bool IsProxy(const CNetAddr &addr) { - for (int i=0; i<NET_MAX; i++) { + LOCK(cs_proxyInfos); + for (int i = 0; i < NET_MAX; i++) { if (proxyInfo[i].second && (addr == (CNetAddr)proxyInfo[i].first)) return true; } @@ -467,10 +479,10 @@ bool IsProxy(const CNetAddr &addr) { bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout) { - const proxyType &proxy = proxyInfo[addrDest.GetNetwork()]; + proxyType proxy; // no proxy needed - if (!proxy.second) + if (!GetProxy(addrDest.GetNetwork(), proxy)) return ConnectSocketDirectly(addrDest, hSocketRet, nTimeout); SOCKET hSocket = INVALID_SOCKET; @@ -504,19 +516,22 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest SplitHostPort(string(pszDest), port, strDest); SOCKET hSocket = INVALID_SOCKET; - CService addrResolved(CNetAddr(strDest, fNameLookup && !nameproxyInfo.second), port); + + proxyType nameproxy; + GetNameProxy(nameproxy); + + CService addrResolved(CNetAddr(strDest, fNameLookup && !nameproxy.second), port); if (addrResolved.IsValid()) { addr = addrResolved; return ConnectSocket(addr, hSocketRet, nTimeout); } addr = CService("0.0.0.0:0"); - if (!nameproxyInfo.second) + if (!nameproxy.second) return false; - if (!ConnectSocketDirectly(nameproxyInfo.first, hSocket, nTimeout)) + if (!ConnectSocketDirectly(nameproxy.first, hSocket, nTimeout)) return false; - switch(nameproxyInfo.second) - { + switch(nameproxy.second) { default: case 4: return false; case 5: diff --git a/src/netbase.h b/src/netbase.h index 560e2182df..0a29d4ff0c 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -133,13 +133,15 @@ class CService : public CNetAddr ) }; +typedef std::pair<CService, int> proxyType; + enum Network ParseNetwork(std::string net); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5); -bool GetProxy(enum Network net, CService &addrProxy); +bool GetProxy(enum Network net, proxyType &proxyInfoOut); bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); -bool GetNameProxy(); +bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index ad145fdf9d..cd1764a53f 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -132,7 +132,10 @@ int main(int argc, char *argv[]) // ... then bitcoin.conf: if (!boost::filesystem::is_directory(GetDataDir(false))) { - fprintf(stderr, "Error: Specified directory does not exist\n"); + // This message can not be translated, as translation is not initialized yet + // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory) + QMessageBox::critical(0, "Bitcoin", + QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } ReadConfigFile(mapArgs, mapMultiArgs); diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 20d1830486..b92a26c4a4 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -19,6 +19,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:" "@STRENGTH)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"An error occurred while setting up the RPC port %u for listening on IPv6, " +"falling back to IPv4: %s"), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"An error occurred while setting up the RPC port %u for listening on IPv4: %s"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot obtain a lock on data directory %s. Bitcoin is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -34,6 +39,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when the best block changes (%s in cmd is replaced by block " "hash)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Number of seconds to keep misbehaving peers from reconnecting (default: " "86400)"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -60,7 +67,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 i QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"), -QT_TRANSLATE_NOOP("bitcoin-core", "An error occurred while setting up the RPC port %i for listening: %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Bind to given address. Use [host]:port notation for IPv6"), QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin version"), QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin"), @@ -92,7 +98,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins"), QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 2500, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-6, default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Importing blocks..."), +QT_TRANSLATE_NOOP("bitcoin-core", "Importing blockchain data file."), +QT_TRANSLATE_NOOP("bitcoin-core", "Importing bootstrap blockchain data file."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000?.dat file"), QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"), @@ -100,7 +107,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -tor address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), QT_TRANSLATE_NOOP("bitcoin-core", "List commands"), -QT_TRANSLATE_NOOP("bitcoin-core", "Listen for JSON-RPC connections on <port> (default: 8332)"), QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: 8333 or testnet: 18333)"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."), diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d2d7716dbd..ff70ca24af 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -439,7 +439,7 @@ void HelpMessageBox::printToConsole() { // On other operating systems, the expected action is to print the message to the console. QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions; - fprintf(stderr, "%s", strUsage.toStdString().c_str()); + fprintf(stdout, "%s", strUsage.toStdString().c_str()); } void HelpMessageBox::showOrPrint() diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index f887632517..715b046a83 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1,4 +1,6 @@ -<?xml version="1.0" ?><!DOCTYPE TS><TS language="en" version="2.0"> +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="en"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> @@ -82,11 +84,16 @@ This product includes software developed by the OpenSSL Project for use in the O </message> <message> <location line="+3"/> - <source>&Sign Message</source> - <translation>&Sign Message</translation> + <source>Sign &Message</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+11"/> + <location line="+25"/> + <source>Delete the currently selected address from the list</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-14"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> <translation>Verify a message to ensure it was signed with a specified Bitcoin address</translation> </message> @@ -96,12 +103,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Verify Message</translation> </message> <message> - <location line="+11"/> - <source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source> - <translation>Delete the currently selected address from the list. Only sending addresses can be deleted.</translation> - </message> - <message> - <location line="+3"/> + <location line="+14"/> <source>&Delete</source> <translation>&Delete</translation> </message> @@ -232,24 +234,29 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Are you sure you wish to encrypt your wallet?</translation> </message> <message> - <location line="+106"/> + <location line="+15"/> + <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Warning: The Caps Lock key is on!</translation> </message> <message> - <location line="-121"/> - <location line="+49"/> + <location line="-130"/> + <location line="+58"/> <source>Wallet encrypted</source> <translation>Wallet encrypted</translation> </message> <message> - <location line="-48"/> + <location line="-56"/> <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> <translation>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</translation> </message> <message> - <location line="+5"/> + <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> @@ -293,17 +300,17 @@ This product includes software developed by the OpenSSL Project for use in the O <context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+228"/> + <location filename="../bitcoingui.cpp" line="+257"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> <message> - <location line="+295"/> + <location line="+237"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-325"/> + <location line="-299"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -313,7 +320,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Show general overview of wallet</translation> </message> <message> - <location line="+5"/> + <location line="+17"/> <source>&Transactions</source> <translation>&Transactions</translation> </message> @@ -333,7 +340,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Edit the list of stored addresses and labels</translation> </message> <message> - <location line="+5"/> + <location line="-13"/> <source>&Receive coins</source> <translation>&Receive coins</translation> </message> @@ -343,12 +350,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Show the list of addresses for receiving payments</translation> </message> <message> - <location line="+5"/> + <location line="-7"/> <source>&Send coins</source> <translation>&Send coins</translation> </message> <message> - <location line="+41"/> + <location line="+35"/> <source>E&xit</source> <translation>E&xit</translation> </message> @@ -378,7 +385,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Options...</translation> </message> <message> - <location line="+6"/> + <location line="+4"/> <source>&Encrypt Wallet...</source> <translation>&Encrypt Wallet...</translation> </message> @@ -395,7 +402,10 @@ This product includes software developed by the OpenSSL Project for use in the O <message numerus="yes"> <location line="+241"/> <source>~%n block(s) remaining</source> - <translation><numerusform>~%n block remaining</numerusform><numerusform>~%n blocks remaining</numerusform></translation> + <translation> + <numerusform>~%n block remaining</numerusform> + <numerusform>~%n blocks remaining</numerusform> + </translation> </message> <message> <location line="+6"/> @@ -403,42 +413,27 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Downloaded %1 of %2 blocks of transaction history (%3% done).</translation> </message> <message> - <location line="-254"/> + <location line="-242"/> <source>&Export...</source> <translation>&Export...</translation> </message> <message> - <location line="-54"/> + <location line="-58"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> <message> - <location line="+6"/> - <source>Sign a message to prove you own a Bitcoin address</source> - <translation>Sign a message to prove you own a Bitcoin address</translation> - </message> - <message> - <location line="+4"/> - <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation>Verify a message to ensure it was signed with a specified Bitcoin address</translation> - </message> - <message> - <location line="+4"/> - <source>S&ignatures</source> - <translation>S&ignatures</translation> - </message> - <message> - <location line="+37"/> + <location line="+45"/> <source>Modify configuration options for Bitcoin</source> <translation>Modify configuration options for Bitcoin</translation> </message> <message> - <location line="+4"/> + <location line="+14"/> <source>Export the data in the current tab to a file</source> <translation>Export the data in the current tab to a file</translation> </message> <message> - <location line="+2"/> + <location line="-10"/> <source>Encrypt or decrypt wallet</source> <translation>Encrypt or decrypt wallet</translation> </message> @@ -453,7 +448,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Change the passphrase used for wallet encryption</translation> </message> <message> - <location line="+1"/> + <location line="+6"/> <source>&Debug window</source> <translation>&Debug window</translation> </message> @@ -463,12 +458,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Open debugging and diagnostic console</translation> </message> <message> - <location line="-55"/> + <location line="-5"/> <source>&Verify message...</source> <translation>&Verify message...</translation> </message> <message> - <location line="-160"/> + <location line="-186"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> @@ -478,7 +473,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Wallet</translation> </message> <message> - <location line="+195"/> + <location line="+168"/> <source>&About Bitcoin</source> <translation>&About Bitcoin</translation> </message> @@ -488,12 +483,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Show / Hide</translation> </message> <message> - <location line="+34"/> + <location line="+39"/> <source>&File</source> <translation>&File</translation> </message> <message> - <location line="+10"/> + <location line="+8"/> <source>&Settings</source> <translation>&Settings</translation> </message> @@ -508,7 +503,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Tabs toolbar</translation> </message> <message> - <location line="+11"/> + <location line="+8"/> <source>Actions toolbar</source> <translation>Actions toolbar</translation> </message> @@ -525,9 +520,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Bitcoin client</translation> </message> <message numerus="yes"> - <location line="+71"/> + <location line="+69"/> <source>%n active connection(s) to Bitcoin network</source> - <translation><numerusform>%n active connection to Bitcoin network</numerusform><numerusform>%n active connections to Bitcoin network</numerusform></translation> + <translation> + <numerusform>%n active connection to Bitcoin network</numerusform> + <numerusform>%n active connections to Bitcoin network</numerusform> + </translation> </message> <message> <location line="+40"/> @@ -537,22 +535,34 @@ This product includes software developed by the OpenSSL Project for use in the O <message numerus="yes"> <location line="+22"/> <source>%n second(s) ago</source> - <translation><numerusform>%n second ago</numerusform><numerusform>%n seconds ago</numerusform></translation> + <translation> + <numerusform>%n second ago</numerusform> + <numerusform>%n seconds ago</numerusform> + </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s) ago</source> - <translation><numerusform>%n minute ago</numerusform><numerusform>%n minutes ago</numerusform></translation> + <translation> + <numerusform>%n minute ago</numerusform> + <numerusform>%n minutes ago</numerusform> + </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> - <translation><numerusform>%n hour ago</numerusform><numerusform>%n hours ago</numerusform></translation> + <translation> + <numerusform>%n hour ago</numerusform> + <numerusform>%n hours ago</numerusform> + </translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> - <translation><numerusform>%n day ago</numerusform><numerusform>%n days ago</numerusform></translation> + <translation> + <numerusform>%n day ago</numerusform> + <numerusform>%n days ago</numerusform> + </translation> </message> <message> <location line="+6"/> @@ -603,7 +613,7 @@ Address: %4 </translation> </message> <message> - <location line="+120"/> + <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation>URI handling</translation> @@ -1110,7 +1120,7 @@ Address: %4 <location line="+53"/> <location line="+23"/> <location line="+23"/> - <location filename="../rpcconsole.cpp" line="+328"/> + <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/A</translation> </message> @@ -1261,8 +1271,8 @@ Address: %4 </message> <message> <location line="+3"/> - <source>&Add Recipient</source> - <translation>&Add Recipient</translation> + <source>Add &Recipient</source> + <translation type="unfinished"></translation> </message> <message> <location line="+20"/> @@ -1291,8 +1301,8 @@ Address: %4 </message> <message> <location line="+3"/> - <source>&Send</source> - <translation>&Send</translation> + <source>S&end</source> + <translation type="unfinished"></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> @@ -1604,7 +1614,10 @@ Address: %4 <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> - <translation><numerusform>Open for %n block</numerusform><numerusform>Open for %n blocks</numerusform></translation> + <translation> + <numerusform>Open for %n block</numerusform> + <numerusform>Open for %n blocks</numerusform> + </translation> </message> <message> <location line="+8"/> @@ -1629,7 +1642,10 @@ Address: %4 <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> - <translation><numerusform>, broadcast through %n node</numerusform><numerusform>, broadcast through %n nodes</numerusform></translation> + <translation> + <numerusform>, broadcast through %n node</numerusform> + <numerusform>, broadcast through %n nodes</numerusform> + </translation> </message> <message> <location line="+4"/> @@ -1647,7 +1663,7 @@ Address: %4 <translation>Generated</translation> </message> <message> - <location line="+6"/> + <location line="+5"/> <location line="+17"/> <source>From</source> <translation>From</translation> @@ -1682,7 +1698,10 @@ Address: %4 <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> - <translation><numerusform>matures in %n more block</numerusform><numerusform>matures in %n more blocks</numerusform></translation> + <translation> + <numerusform>matures in %n more block</numerusform> + <numerusform>matures in %n more blocks</numerusform> + </translation> </message> <message> <location line="+2"/> @@ -1758,12 +1777,12 @@ Address: %4 <translation>false</translation> </message> <message> - <location line="-212"/> + <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, has not been successfully broadcast yet</translation> </message> <message> - <location line="+36"/> + <location line="+35"/> <source>unknown</source> <translation>unknown</translation> </message> @@ -1806,7 +1825,10 @@ Address: %4 <message numerus="yes"> <location line="+57"/> <source>Open for %n block(s)</source> - <translation><numerusform>Open for %n block</numerusform><numerusform>Open for %n blocks</numerusform></translation> + <translation> + <numerusform>Open for %n block</numerusform> + <numerusform>Open for %n blocks</numerusform> + </translation> </message> <message> <location line="+3"/> @@ -1831,7 +1853,10 @@ Address: %4 <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> - <translation><numerusform>Mined balance will be available when it matures in %n more block</numerusform><numerusform>Mined balance will be available when it matures in %n more blocks</numerusform></translation> + <translation> + <numerusform>Mined balance will be available when it matures in %n more block</numerusform> + <numerusform>Mined balance will be available when it matures in %n more blocks</numerusform> + </translation> </message> <message> <location line="+5"/> @@ -2074,7 +2099,7 @@ Address: %4 <context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+65"/> + <location filename="../bitcoinstrings.cpp" line="+71"/> <source>Bitcoin version</source> <translation>Bitcoin version</translation> </message> @@ -2089,12 +2114,12 @@ Address: %4 <translation>Send command to -server or bitcoind</translation> </message> <message> - <location line="-20"/> + <location line="-19"/> <source>List commands</source> <translation>List commands</translation> </message> <message> - <location line="-10"/> + <location line="-11"/> <source>Get help for a command</source> <translation>Get help for a command</translation> </message> @@ -2169,22 +2194,47 @@ Address: %4 <translation>Threshold for disconnecting misbehaving peers (default: 100)</translation> </message> <message> - <location line="-105"/> + <location line="-104"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation> </message> <message> - <location line="-12"/> + <location line="-22"/> + <source>An error occurred while setting up the RPC port %i for listening on IPv6, falling back to IPv4: %s</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation>Detach block and address databases. Increases shutdown time (default: 0)</translation> </message> <message> - <location line="+34"/> + <location line="+12"/> + <source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+24"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accept command line and JSON-RPC commands</translation> </message> <message> - <location line="+61"/> + <location line="+36"/> + <source>Importing blockchain data file.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Importing bootstrap blockchain data file.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+23"/> <source>Run in the background as a daemon and accept commands</source> <translation>Run in the background as a daemon and accept commands</translation> </message> @@ -2194,7 +2244,7 @@ Address: %4 <translation>Use the test network</translation> </message> <message> - <location line="-93"/> + <location line="-92"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation> </message> @@ -2219,12 +2269,7 @@ Address: %4 <translation>Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.</translation> </message> <message> - <location line="+13"/> - <source>An error occurred while setting up the RPC port %i for listening: %s</source> - <translation>An error occurred while setting up the RPC port %i for listening: %s</translation> - </message> - <message> - <location line="+4"/> + <location line="+16"/> <source>Block creation options:</source> <translation>Block creation options:</translation> </message> @@ -2249,17 +2294,12 @@ Address: %4 <translation>Find peers using DNS lookup (default: 1 unless -connect)</translation> </message> <message> - <location line="+6"/> - <source>Importing blocks...</source> - <translation>Importing blocks...</translation> - </message> - <message> - <location line="+4"/> + <location line="+11"/> <source>Invalid -tor address: '%s'</source> <translation>Invalid -tor address: '%s'</translation> </message> <message> - <location line="+10"/> + <location line="+9"/> <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source> <translation>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</translation> </message> @@ -2364,27 +2404,22 @@ Address: %4 <translation>Password for JSON-RPC connections</translation> </message> <message> - <location line="-12"/> - <source>Listen for JSON-RPC connections on <port> (default: 8332)</source> - <translation>Listen for JSON-RPC connections on <port> (default: 8332)</translation> - </message> - <message> - <location line="-41"/> + <location line="-52"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Allow JSON-RPC connections from specified IP address</translation> </message> <message> - <location line="+61"/> + <location line="+60"/> <source>Send commands to node running on <ip> (default: 127.0.0.1)</source> <translation>Send commands to node running on <ip> (default: 127.0.0.1)</translation> </message> <message> - <location line="-90"/> + <location line="-91"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> </message> <message> - <location line="+113"/> + <location line="+114"/> <source>Upgrade wallet to latest format</source> <translation>Upgrade wallet to latest format</translation> </message> @@ -2409,12 +2444,12 @@ Address: %4 <translation>How thorough the block verification is (0-6, default: 1)</translation> </message> <message> - <location line="+2"/> + <location line="+3"/> <source>Imports blocks from external blk000?.dat file</source> <translation>Imports blocks from external blk000?.dat file</translation> </message> <message> - <location line="+52"/> + <location line="+51"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Use OpenSSL (https) for JSON-RPC connections</translation> </message> @@ -2429,22 +2464,22 @@ Address: %4 <translation>Server private key (default: server.pem)</translation> </message> <message> - <location line="-110"/> + <location line="-116"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> - <location line="+122"/> + <location line="+128"/> <source>This help message</source> <translation>This help message</translation> </message> <message> - <location line="-119"/> + <location line="-120"/> <source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source> <translation>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</translation> </message> <message> - <location line="+45"/> + <location line="+46"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> @@ -2459,12 +2494,12 @@ Address: %4 <translation>Connect through socks proxy</translation> </message> <message> - <location line="-13"/> + <location line="-12"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> </message> <message> - <location line="+44"/> + <location line="+43"/> <source>Loading addresses...</source> <translation>Loading addresses...</translation> </message> @@ -2494,12 +2529,12 @@ Address: %4 <translation>Error loading wallet.dat</translation> </message> <message> - <location line="+18"/> + <location line="+19"/> <source>Invalid -proxy address: '%s'</source> <translation>Invalid -proxy address: '%s'</translation> </message> <message> - <location line="+47"/> + <location line="+46"/> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Unknown network specified in -onlynet: '%s'</translation> </message> @@ -2519,12 +2554,12 @@ Address: %4 <translation>Cannot resolve -externalip address: '%s'</translation> </message> <message> - <location line="+29"/> + <location line="+30"/> <source>Invalid amount for -paytxfee=<amount>: '%s'</source> <translation>Invalid amount for -paytxfee=<amount>: '%s'</translation> </message> <message> - <location line="-14"/> + <location line="-15"/> <source>Error: could not start node</source> <translation>Error: could not start node</translation> </message> @@ -2534,12 +2569,12 @@ Address: %4 <translation>Error: Wallet locked, unable to create transaction </translation> </message> <message> - <location line="-55"/> + <location line="-56"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </translation> </message> <message> - <location line="+54"/> + <location line="+55"/> <source>Error: Transaction creation failed </source> <translation>Error: Transaction creation failed </translation> </message> @@ -2549,12 +2584,12 @@ Address: %4 <translation>Sending...</translation> </message> <message> - <location line="-100"/> + <location line="-101"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</translation> </message> <message> - <location line="+75"/> + <location line="+77"/> <source>Invalid amount</source> <translation>Invalid amount</translation> </message> @@ -2564,12 +2599,12 @@ Address: %4 <translation>Insufficient funds</translation> </message> <message> - <location line="+9"/> + <location line="+8"/> <source>Loading block index...</source> <translation>Loading block index...</translation> </message> <message> - <location line="-46"/> + <location line="-45"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Add a node to connect to and attempt to keep the connection open</translation> </message> @@ -2579,7 +2614,7 @@ Address: %4 <translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation> </message> <message> - <location line="+48"/> + <location line="+47"/> <source>Find peers using internet relay chat (default: 0)</source> <translation>Find peers using internet relay chat (default: 0)</translation> </message> @@ -2624,7 +2659,7 @@ Address: %4 <translation>To use the %s option</translation> </message> <message> - <location line="-133"/> + <location line="-139"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -2643,12 +2678,12 @@ If the file does not exist, create it with owner-readable-only file permissions. </translation> </message> <message> - <location line="+74"/> + <location line="+80"/> <source>Error</source> <translation>Error</translation> </message> <message> - <location line="-30"/> + <location line="-29"/> <source>You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> @@ -2657,4 +2692,4 @@ If the file does not exist, create it with owner-readable-only file permissions. If the file does not exist, create it with owner-readable-only file permissions.</translation> </message> </context> -</TS>
\ No newline at end of file +</TS> diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index 52a71c7b5f..25d8b801a6 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -15,7 +15,7 @@ <message> <location line="+41"/> <source>Copyright © 2009-2012 The Bitcoin developers</source> - <translation type="unfinished"/> + <translation>Copyright © 2009-2012 Los desarrolladores de Bitcoin</translation> </message> <message> <location line="+13"/> @@ -32,8 +32,8 @@ Distribuido bajo la licencia MIT/X11, vea el archivo adjunto COPYING o http://www.opensource.org/licenses/mit-license.php. Este producto incluye software desarrollado por OpenSSL Project para su uso en -el OpenSSL Toolkit (http://www.openssl.org) y software criptográfico escrito por -Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</translation> +el OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por +Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.</translation> </message> </context> <context> @@ -81,7 +81,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+11"/> <source>Sign a message to prove you own a Bitcoin address</source> - <translation type="unfinished"/> + <translation>Firme un mensaje para demostrar que posee una dirección Bitcoin</translation> </message> <message> <location line="+3"/> @@ -91,7 +91,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+11"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique un mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation> </message> <message> <location line="+3"/> @@ -162,7 +162,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> - <translation type="unfinished"/> + <translation>Diálogo de contraseña</translation> </message> <message> <location line="+21"/> @@ -227,18 +227,18 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source> - <translation>Atencion: ¡Si encriptas tu cartera y pierdes la contraseña perderas <b>TODOS TUS BITCOINS</b>!"</translation> + <translation>Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS BITCOINS</b>!"</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> - <translation>¿Seguro que quieres seguir encriptando la cartera?</translation> + <translation>¿Seguro que desea cifrar su monedero?</translation> </message> <message> <location line="+106"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> - <translation type="unfinished"/> + <translation>Aviso: ¡La tecla de bloqueo de mayúsculas está activada!</translation> </message> <message> <location line="-121"/> @@ -249,7 +249,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="-48"/> <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> - <translation>Bitcoin cerrará al finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus bitcoin de ser robados por el malware que infecte su sistema.</translation> + <translation>Bitcoin se cerrará para finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus bitcoins de robo por malware que infecte su sistema.</translation> </message> <message> <location line="+5"/> @@ -290,7 +290,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> - <translation>La contraseña de cartera ha sido cambiada con exit.</translation> + <translation>Se ha cambiado correctamente la contraseña del monedero.</translation> </message> </context> <context> @@ -403,7 +403,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> - <translation>Descargado %1 de %2 bloques del historial de transacciones (%3% hecho).</translation> + <translation>Descargados %1 de %2 bloques del historial de transacciones (%3% hecho).</translation> </message> <message> <location line="-254"/> @@ -418,17 +418,17 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+6"/> <source>Sign a message to prove you own a Bitcoin address</source> - <translation type="unfinished"/> + <translation>Firme un mensaje para demostrar que posee una dirección Bitcoin</translation> </message> <message> <location line="+4"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique un mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation> </message> <message> <location line="+4"/> <source>S&ignatures</source> - <translation type="unfinished"/> + <translation>F&irmas</translation> </message> <message> <location line="+37"/> @@ -525,7 +525,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <location line="+0"/> <location line="+60"/> <source>Bitcoin client</source> - <translation>cliente Bitcoin</translation> + <translation>Cliente Bitcoin</translation> </message> <message numerus="yes"> <location line="+71"/> @@ -575,7 +575,7 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.</tran <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> - <translation>Esta transacción supera el límite. Puede seguir enviándola incluyendo una comisión de %1 que se va a repartir entre los nodos que procesan su transacción y ayudan a mantener la red. ¿Desea pagar esa tarifa?</translation> + <translation>Esta transacción supera el límite de tamaño. Puede no obstante enviarla incluyendo una comisión de %1 para los nodos que procesan su transacción y ayudan a mantener la red. ¿Desea pagar esa tarifa?</translation> </message> <message> <location line="+5"/> @@ -602,19 +602,20 @@ Address: %4 <translation>Fecha: %1 Cantidad: %2 Tipo: %3 -Dirección: %4</translation> +Dirección: %4 +</translation> </message> <message> <location line="+120"/> <location line="+15"/> <source>URI handling</source> - <translation type="unfinished"/> + <translation>Gestión de URI</translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> - <translation type="unfinished"/> + <translation>¡No se puede interpretar la URI! Esto puede deberse a una dirección Bitcoin inválida o a parámetros de URI mal formados.</translation> </message> <message> <location line="+16"/> @@ -644,12 +645,12 @@ Dirección: %4</translation> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> - <translation>Ha habido un error al intentar guardar los datos del monedero a la nueva ubicación.</translation> + <translation>Ha habido un error al intentar guardar los datos del monedero en la nueva ubicación.</translation> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> - <translation type="unfinished"/> + <translation>Ha ocurrido un error crítico. Bitcoin ya no puede continuar con seguridad y se cerrará.</translation> </message> </context> <context> @@ -685,7 +686,7 @@ Dirección: %4</translation> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> - <translation>La dirección asociada con esta entrada en la guia. Solo puede ser modificada para direcciones de envío.</translation> + <translation>La dirección asociada con esta entrada en la guía. Solo puede ser modificada para direcciones de envío.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> @@ -705,7 +706,7 @@ Dirección: %4</translation> <message> <location line="+4"/> <source>Edit sending address</source> - <translation>Editar dirección de envio</translation> + <translation>Editar dirección de envío</translation> </message> <message> <location line="+60"/> @@ -759,7 +760,7 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>Set language, for example "de_DE" (default: system locale)</source> - <translation>Establecer el idioma, por ejemplo, "es_ES" (por defecto: configuración regional del sistema)</translation> + <translation>Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema)</translation> </message> <message> <location line="+1"/> @@ -769,7 +770,7 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> - <translation>Mostrar pantalla de bienvenida en el inicio (por defecto: 1)</translation> + <translation>Mostrar pantalla de bienvenida en el inicio (predeterminado: 1)</translation> </message> </context> <context> @@ -787,7 +788,7 @@ Dirección: %4</translation> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> - <translation>Tarifa de transacción por KB opcional que ayuda a asegurarse de que sus transacciones se procesan rápidamente. La mayoría de las transacciones son de 1 KB. Tarifa de 0,01 recomendado.</translation> + <translation>Tarifa de transacción por KB opcional que ayuda a asegurarse de que sus transacciones se procesan rápidamente. La mayoría de las transacciones son de 1 KB. Tarifa de 0,01 recomendada.</translation> </message> <message> <location line="+15"/> @@ -797,17 +798,17 @@ Dirección: %4</translation> <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> - <translation>Arranca Bitcoin automáticamente al encender el sistema</translation> + <translation>Iniciar Bitcoin automáticamente al encender el sistema.</translation> </message> <message> <location line="+3"/> <source>&Start Bitcoin on system login</source> - <translation>&Arrancar Bitcoin al iniciar el sistema</translation> + <translation>&Iniciar Bitcoin al iniciar el sistema</translation> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> - <translation>Desconectar las bases de datos de bloques y direcciones al cerrar la aplicación. Implica que pueden moverse a otros directorios de datos pero ralentiza el cierre. El monedero siempre queda desconectado.</translation> + <translation>Desconectar las bases de datos de bloques y direcciones al cerrar la aplicación. Implica que pueden moverse a otro directorio de datos pero ralentiza el cierre. El monedero siempre queda desconectado.</translation> </message> <message> <location line="+3"/> @@ -822,17 +823,17 @@ Dirección: %4</translation> <message> <location line="+6"/> <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> - <translation>Intenta abrir el puerto adecuado en el router automáticamente. Esta opción solo funciona si el router soporta UPnP y está activado.</translation> + <translation>Abrir automáticamente el puerto del cliente Bitcoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation> </message> <message> <location line="+3"/> <source>Map port using &UPnP</source> - <translation>Mapea el puerto usando &UPnP</translation> + <translation>Mapear el puerto usando &UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> - <translation>Conecta a la red Bitcoin atraves de un proxy SOCKS (ej. para conectar con la red Tor)</translation> + <translation>Conectar a la red Bitcoin a través de un proxy SOCKS (ej. para conectar con la red Tor)</translation> </message> <message> <location line="+3"/> @@ -862,7 +863,7 @@ Dirección: %4</translation> <message> <location line="+7"/> <source>SOCKS &Version:</source> - <translation>SOCKS &Versión:</translation> + <translation>&Versión SOCKS:</translation> </message> <message> <location line="+13"/> @@ -877,17 +878,17 @@ Dirección: %4</translation> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> - <translation>Minimizar la ventana al icono del sistema.</translation> + <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation> </message> <message> <location line="+3"/> <source>&Minimize to the tray instead of the taskbar</source> - <translation>&Minimiza a la bandeja en vez de la barra de tareas</translation> + <translation>&Minimizar a la bandeja en vez de a la barra de tareas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> - <translation>Minimiza la ventana en lugar de salir de la aplicación.Cuando esta opcion está activa la aplicación solo se puede cerrar seleccionando Salir desde el menú.</translation> + <translation>Minimizar en lugar de salir de la aplicación al cerrar la ventana.Cuando esta opción está activa, la aplicación solo se puede cerrar seleccionando Salir desde el menú.</translation> </message> <message> <location line="+3"/> @@ -902,12 +903,12 @@ Dirección: %4</translation> <message> <location line="+8"/> <source>User Interface &language:</source> - <translation>&Idioma del interfaz de usuario</translation> + <translation>I&dioma de la interfaz de usuario</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Bitcoin.</source> - <translation type="unfinished"/> + <translation>El idioma de la interfaz de usuario puede establecerse aquí. Este ajuste se aplicará cuando se reinicie Bitcoin.</translation> </message> <message> <location line="+11"/> @@ -917,7 +918,7 @@ Dirección: %4</translation> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> - <translation>Elige la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envíen monedas</translation> + <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas.</translation> </message> <message> <location line="+9"/> @@ -953,7 +954,7 @@ Dirección: %4</translation> <location line="+147"/> <location line="+9"/> <source>Warning</source> - <translation>Alerta</translation> + <translation>Aviso</translation> </message> <message> <location line="-9"/> @@ -978,7 +979,7 @@ Dirección: %4</translation> <location line="+33"/> <location line="+183"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> - <translation type="unfinished"/> + <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión , pero este proceso aún no se ha completado.</translation> </message> <message> <location line="-141"/> @@ -1003,12 +1004,12 @@ Dirección: %4</translation> <message> <location line="+124"/> <source>Immature:</source> - <translation>Inmaduro:</translation> + <translation>No disponible:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> - <translation type="unfinished"/> + <translation>Saldo recién minado que aún no está disponible.</translation> </message> <message> <location line="+46"/> @@ -1057,7 +1058,7 @@ Dirección: %4</translation> <message> <location line="-44"/> <source>Label:</source> - <translation>Label:</translation> + <translation>Etiqueta:</translation> </message> <message> <location line="+19"/> @@ -1067,7 +1068,7 @@ Dirección: %4</translation> <message> <location line="+71"/> <source>&Save As...</source> - <translation>&Guardar Como ...</translation> + <translation>&Guardar como...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> @@ -1077,12 +1078,12 @@ Dirección: %4</translation> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> - <translation type="unfinished"/> + <translation>La cantidad introducida es inválida. Compruébela, por favor.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> - <translation>URI demasiado larga, trata de reducir el texto de la etiqueta / mensaje.</translation> + <translation>URI esultante demasiado larga. Intente reducir el texto de la etiqueta / mensaje.</translation> </message> <message> <location line="+25"/> @@ -1129,12 +1130,12 @@ Dirección: %4</translation> <message> <location line="+68"/> <source>Using OpenSSL version</source> - <translation type="unfinished"/> + <translation>Utilizando la versión OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> - <translation type="unfinished"/> + <translation>Hora de inicio</translation> </message> <message> <location line="+29"/> @@ -1184,7 +1185,7 @@ Dirección: %4</translation> <message> <location line="+7"/> <source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source> - <translation>Muestra las opciones de Bitcoin para la línea de órdenes.</translation> + <translation>Mostrar el mensaje de ayuda de Bitcoin-Qt que enumera las opciones disponibles de línea de órdenes para Bitcoin.</translation> </message> <message> <location line="+3"/> @@ -1209,17 +1210,17 @@ Dirección: %4</translation> <message> <location line="+25"/> <source>Bitcoin Core</source> - <translation type="unfinished"/> + <translation>Núcleo de Bitcoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> - <translation type="unfinished"/> + <translation>Archivo de registro de depuración</translation> </message> <message> <location line="+7"/> <source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> - <translation type="unfinished"/> + <translation>Abrir el archivo de registro de depuración en el directorio actual de datos. Esto puede llevar varios segundos para archivos de registro grandes.</translation> </message> <message> <location line="+102"/> @@ -1229,17 +1230,17 @@ Dirección: %4</translation> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Bitcoin RPC console.</source> - <translation>Bienvenido a la consola RPC de bitcoin</translation> + <translation>Bienvenido a la consola RPC de Bitcoin</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source> - <translation>Use las flechas arriba y abajo para navegar el historial y <b>Control+L</b> para limpiar la pantalla</translation> + <translation>Use las flechas arriba y abajo para navegar por el historial y <b>Control+L</b> para limpiar la pantalla.</translation> </message> <message> <location line="+1"/> <source>Type <b>help</b> for an overview of available commands.</source> - <translation>Escriba <b>help</b> para ver un resumen de los comandos disponibles</translation> + <translation>Escriba <b>help</b> para ver un resumen de los comandos disponibles.</translation> </message> </context> <context> @@ -1254,12 +1255,12 @@ Dirección: %4</translation> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> - <translation>Envía monedas</translation> + <translation>Enviar monedas</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> - <translation>Envía a multiples destinatarios de una vez</translation> + <translation>Enviar a multiples destinatarios de una vez</translation> </message> <message> <location line="+3"/> @@ -1289,17 +1290,17 @@ Dirección: %4</translation> <message> <location line="+31"/> <source>Confirm the send action</source> - <translation>Confirma el envío</translation> + <translation>Confirmar el envío</translation> </message> <message> <location line="+3"/> <source>&Send</source> - <translation>&Envía</translation> + <translation>&Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source><b>%1</b> to %2 (%3)</source> - <translation><b>%1</b> to %2 (%3)</translation> + <translation><b>%1</b> a %2 (%3)</translation> </message> <message> <location line="+5"/> @@ -1309,7 +1310,7 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> - <translation>Estas seguro que quieres enviar %1?</translation> + <translation>¿Está seguro de que desea enviar %1?</translation> </message> <message> <location line="+0"/> @@ -1319,12 +1320,12 @@ Dirección: %4</translation> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> - <translation>La dirección de destinatarion no es valida, comprueba otra vez.</translation> + <translation>La dirección de recepción no es válida, compruébela de nuevo.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> - <translation>La cantidad por pagar tiene que ser mayor 0.</translation> + <translation>La cantidad por pagar tiene que ser mayor de 0.</translation> </message> <message> <location line="+5"/> @@ -1339,12 +1340,12 @@ Dirección: %4</translation> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> - <translation>Tienes una dirección duplicada, solo puedes enviar a direcciónes individuales de una sola vez.</translation> + <translation>Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> - <translation>Error: ha fallado la creación de transacción.</translation> + <translation>Error: ha fallado la creación de la transacción.</translation> </message> <message> <location line="+5"/> @@ -1357,7 +1358,7 @@ Dirección: %4</translation> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> - <translation>Envio</translation> + <translation>Envío</translation> </message> <message> <location line="+15"/> @@ -1398,7 +1399,7 @@ Dirección: %4</translation> <message> <location line="+7"/> <source>Paste address from clipboard</source> - <translation>Pega dirección desde portapapeles</translation> + <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> @@ -1408,12 +1409,12 @@ Dirección: %4</translation> <message> <location line="+7"/> <source>Remove this recipient</source> - <translation>Elimina destinatario</translation> + <translation>Eliminar destinatario</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> - <translation>Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> + <translation>Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> </context> <context> @@ -1421,7 +1422,7 @@ Dirección: %4</translation> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> - <translation type="unfinished"/> + <translation>Firmas - Firmar / verificar un mensaje</translation> </message> <message> <location line="+13"/> @@ -1432,12 +1433,12 @@ Dirección: %4</translation> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> - <translation>Puede firmar los mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle firmando su identidad a través de ellos. Solo firme declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation> + <translation>Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> - <translation>Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> + <translation>La dirección con la que firmar el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+10"/> @@ -1454,7 +1455,7 @@ Dirección: %4</translation> <message> <location line="-193"/> <source>Paste address from clipboard</source> - <translation>Pega dirección desde portapapeles</translation> + <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> @@ -1474,12 +1475,12 @@ Dirección: %4</translation> <message> <location line="+21"/> <source>Sign the message to prove you own this Bitcoin address</source> - <translation type="unfinished"/> + <translation>Firme el mensaje para demostrar que posee esta dirección Bitcoin</translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> - <translation>Limpiar todos los campos de mensaje de la firma</translation> + <translation>Limpiar todos los campos de la firma de mensaje</translation> </message> <message> <location line="+3"/> @@ -1496,33 +1497,33 @@ Dirección: %4</translation> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> - <translation type="unfinished"/> + <translation>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> - <translation>Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> + <translation>La dirección con la que se firmó el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique el mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> - <translation>Limpiar todos los campos de mensaje de la firma</translation> + <translation>Limpiar todos los campos de la verificación de mensaje</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> - <translation>Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> + <translation>Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="-2"/> <source>Click "Sign Message" to generate signature</source> - <translation type="unfinished"/> + <translation>Haga clic en "Firmar mensaje" para generar la firma</translation> </message> <message> <location line="+3"/> @@ -1533,7 +1534,7 @@ Dirección: %4</translation> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> - <translation type="unfinished"/> + <translation>La dirección introducida es inválida.</translation> </message> <message> <location line="-81"/> @@ -1547,27 +1548,27 @@ Dirección: %4</translation> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> - <translation type="unfinished"/> + <translation>La dirección introducida no corresponde a una clave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> - <translation type="unfinished"/> + <translation>Se ha cancelado el desbloqueo del monedero. </translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> - <translation type="unfinished"/> + <translation>No se dispone de la clave privada para la dirección introducida.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> - <translation type="unfinished"/> + <translation>Ha fallado la firma del mensaje.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> - <translation type="unfinished"/> + <translation>Mensaje firmado.</translation> </message> <message> <location line="+59"/> @@ -1606,12 +1607,12 @@ Dirección: %4</translation> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>Abierto para %n bloque</numerusform><numerusform>Abierto para %n bloques</numerusform></translation> </message> <message> <location line="+8"/> <source>%1/offline</source> - <translation>%1/fuera de linea</translation> + <translation>%1/fuera de línea</translation> </message> <message> <location line="+2"/> @@ -1631,7 +1632,7 @@ Dirección: %4</translation> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>, transmitir a través de %n nodo</numerusform><numerusform>, transmitir a través de %n nodos</numerusform></translation> </message> <message> <location line="+4"/> @@ -1641,7 +1642,7 @@ Dirección: %4</translation> <message> <location line="+7"/> <source>Source</source> - <translation type="unfinished"/> + <translation>Fuente</translation> </message> <message> <location line="+0"/> @@ -1665,7 +1666,7 @@ Dirección: %4</translation> <location line="-77"/> <location line="+2"/> <source>own address</source> - <translation type="unfinished"/> + <translation>dirección propia</translation> </message> <message> <location line="-2"/> @@ -1679,12 +1680,12 @@ Dirección: %4</translation> <location line="+17"/> <location line="+30"/> <source>Credit</source> - <translation>Credito</translation> + <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>disponible en %n bloque más</numerusform><numerusform>disponible en %n bloques más</numerusform></translation> </message> <message> <location line="+2"/> @@ -1697,17 +1698,17 @@ Dirección: %4</translation> <location line="+15"/> <location line="+30"/> <source>Debit</source> - <translation>Debito</translation> + <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> - <translation>Comisión transacción</translation> + <translation>Comisión de transacción</translation> </message> <message> <location line="+16"/> <source>Net amount</source> - <translation>Cantidad total</translation> + <translation>Cantidad neta</translation> </message> <message> <location line="+6"/> @@ -1722,27 +1723,27 @@ Dirección: %4</translation> <message> <location line="+2"/> <source>Transaction ID</source> - <translation type="unfinished"/> + <translation>Identificador de transacción</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> - <translation>Las monedas generadas deben esperar 120 bloques antes de ser gastadas. Cuando has generado este bloque se emitió a la red para ser agregado en la cadena de bloques. Si falla al incluirse en la cadena, cambiará a "no aceptado" y las monedas no se podrán gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque casi al mismo tiempo que el tuyo.</translation> + <translation>Las monedas generadas deben esperar 120 bloques antes de que se puedan gastar. Cuando se generó este bloque, se emitió a la red para ser agregado a la cadena de bloques. Si no consigue incorporarse a la cadena, su estado cambiará a "no aceptado" y las monedas no se podrán gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque casi al mismo tiempo que el suyo.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> - <translation type="unfinished"/> + <translation>Información de depuración</translation> </message> <message> <location line="+8"/> <source>Transaction</source> - <translation type="unfinished"/> + <translation>Transacción</translation> </message> <message> <location line="+5"/> <source>Inputs</source> - <translation type="unfinished"/> + <translation>entradas</translation> </message> <message> <location line="+23"/> @@ -1752,12 +1753,12 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>true</source> - <translation type="unfinished"/> + <translation>verdadero</translation> </message> <message> <location line="+0"/> <source>false</source> - <translation type="unfinished"/> + <translation>falso</translation> </message> <message> <location line="-212"/> @@ -1818,7 +1819,7 @@ Dirección: %4</translation> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> - <translation>Fuera de linea (%1 confirmaciones)</translation> + <translation>Fuera de línea (%1 confirmaciones)</translation> </message> <message> <location line="+3"/> @@ -1833,12 +1834,12 @@ Dirección: %4</translation> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>El saldo recién minado estará disponible cuando venza el plazo en %n bloque más</numerusform><numerusform>El saldo recién minado estará disponible cuando venza el plazo en %n bloques más</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> - <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado !</translation> + <translation>Este bloque no ha sido recibido por otros nodos y ¡probablemente no sea aceptado!</translation> </message> <message> <location line="+3"/> @@ -1873,7 +1874,7 @@ Dirección: %4</translation> <message> <location line="+38"/> <source>(n/a)</source> - <translation>(n/a)</translation> + <translation>(nd)</translation> </message> <message> <location line="+199"/> @@ -1883,7 +1884,7 @@ Dirección: %4</translation> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> - <translation>Fecha y hora de cuando se recibió la transacción.</translation> + <translation>Fecha y hora en que se recibió la transacción.</translation> </message> <message> <location line="+2"/> @@ -1898,7 +1899,7 @@ Dirección: %4</translation> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> - <translation>Cantidad retirada o añadida al balance.</translation> + <translation>Cantidad retirada o añadida al saldo.</translation> </message> </context> <context> @@ -1952,7 +1953,7 @@ Dirección: %4</translation> <message> <location line="+2"/> <source>To yourself</source> - <translation>A ti mismo</translation> + <translation>A usted mismo</translation> </message> <message> <location line="+1"/> @@ -2111,13 +2112,13 @@ Dirección: %4</translation> <message> <location line="+23"/> <source>Specify configuration file (default: bitcoin.conf)</source> - <translation>Especifica archivo de configuración (predeterminado: bitcoin.conf) + <translation>Especificar archivo de configuración (predeterminado: bitcoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: bitcoind.pid)</source> - <translation>Especifica archivo pid (predeterminado: bitcoin.pid) + <translation>Especificar archivo pid (predeterminado: bitcoin.pid) </translation> </message> <message> @@ -2138,52 +2139,52 @@ Dirección: %4</translation> <message> <location line="-8"/> <source>Set database cache size in megabytes (default: 25)</source> - <translation>Establecer el tamaño del caché de la base de datos en megabytes (por defecto: 25)</translation> + <translation>Establecer el tamaño de caché de la base de datos en megabytes (predeterminado: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> - <translation>Base de datos de conjunto de discos de registro de tamaño en megabytes (por defecto: 100)</translation> + <translation>Establecer el tamaño de registro en disco de la base de datos en megabytes (predeterminado: 100)</translation> </message> <message> <location line="-26"/> <source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source> - <translation>Preste atención a las conexiones en <puerto> (por defecto: 8333 o testnet: 18333)</translation> + <translation>Escuchar conexiones en <puerto> (predeterminado: 8333 o testnet: 18333)</translation> </message> <message> <location line="+4"/> <source>Maintain at most <n> connections to peers (default: 125)</source> - <translation>Mantener en la mayoría de las conexiones <n> a sus compañeros (por defecto: 125)</translation> + <translation>Mantener como máximo <n> conexiones a pares (predeterminado: 125)</translation> </message> <message> <location line="-33"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> - <translation type="unfinished"/> + <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation> </message> <message> <location line="+64"/> <source>Specify your own public address</source> - <translation type="unfinished"/> + <translation>Especifique su propia dirección pública</translation> </message> <message> <location line="-75"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> - <translation type="unfinished"/> + <translation>Vincular a la dirección dada. Utilice la notación [host]:port para IPv6</translation> </message> <message> <location line="+77"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> - <translation>Umbral para la desconexión de los compañeros se portan mal (por defecto: 100)</translation> + <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100)</translation> </message> <message> <location line="-105"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> - <translation>Número de segundos que se mantienen los compañeros se portan mal en volver a conectarse (por defecto: 86400)</translation> + <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400)</translation> </message> <message> <location line="-12"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> - <translation>Desconectar las bases de datos de bloques y direcciones al cerrar la aplicación. El tiempo de parada de la aplicación aumentará. (Predeterminado: 0)</translation> + <translation>Desconectar las bases de datos de bloques y direcciones al cerrar la aplicación. El tiempo de parada de la aplicación aumentará (predeterminado: 0)</translation> </message> <message> <location line="+34"/> @@ -2194,13 +2195,13 @@ Dirección: %4</translation> <message> <location line="+61"/> <source>Run in the background as a daemon and accept commands</source> - <translation>Correr como demonio y acepta comandos + <translation>Correr como demonio y aceptar comandos </translation> </message> <message> <location line="+33"/> <source>Use the test network</source> - <translation>Usa la red de pruebas + <translation>Usar la red de pruebas </translation> </message> <message> @@ -2211,93 +2212,92 @@ Dirección: %4</translation> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> - <translation type="unfinished"/> + <translation>Establecer el tamaño máximo de las transacciones de alta prioridad/comisión baja en bytes (predeterminado:27000)</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> - <translation>Precaución: -paytxfee es muy alta! Esta es la comisión que pagarás si envias una transacción.</translation> + <translation>Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> - <translation type="unfinished"/> + <translation>Aviso: ¡Las transacciones mostradas pueden no ser correctas! Puede necesitar una actualización o bien otros nodos necesitan actualizarse.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.</source> - <translation>Precaución: Por favor revisa que la fecha y hora de tu ordenador son correctas! Si tu reloj está mal Bitcoin no funcionará correctamente.</translation> + <translation>Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, Bitcoin no funcionará correctamente.</translation> </message> <message> <location line="+13"/> <source>An error occurred while setting up the RPC port %i for listening: %s</source> - <translation type="unfinished"/> + <translation>Ha ocurrido un error al configurar el puerto RPC %i para escuchar: %s</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> - <translation type="unfinished"/> + <translation>Opciones de creación de bloques:</translation> </message> <message> <location line="+6"/> <source>Connect only to the specified node(s)</source> - <translation>Conectar sólo a los nodo especificados -</translation> + <translation>Conectar sólo a los nodos (o nodo) especificados</translation> </message> <message> <location line="+3"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> - <translation type="unfinished"/> + <translation>Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip)</translation> </message> <message> <location line="+11"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> - <translation type="unfinished"/> + <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> - <translation type="unfinished"/> + <translation>Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect)</translation> </message> <message> <location line="+6"/> <source>Importing blocks...</source> - <translation type="unfinished"/> + <translation>Importando bloques...</translation> </message> <message> <location line="+4"/> <source>Invalid -tor address: '%s'</source> - <translation>Dirección -tor invalida: '%s'</translation> + <translation>Dirección -tor inválida: '%s'</translation> </message> <message> <location line="+10"/> <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source> - <translation type="unfinished"/> + <translation>Búfer de recepción máximo por conexión, <n>*1000 bytes (predeterminado: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source> - <translation type="unfinished"/> + <translation>Búfer de recepción máximo por conexión, , <n>*1000 bytes (predeterminado: 1000)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source> - <translation type="unfinished"/> + <translation>Conectarse solo a nodos de la red <net> (IPv4, IPv6 o Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> - <translation type="unfinished"/> + <translation>Mostrar información de depuración adicional. Abarca todas las demás opciones -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> - <translation type="unfinished"/> + <translation>Mostrar información de depuración adicional</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> - <translation>Anteponer la salida de depuración, con indicación de la hora</translation> + <translation>Anteponer marca temporal a la información de depuración</translation> </message> <message> <location line="+4"/> @@ -2312,32 +2312,32 @@ Dirección: %4</translation> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> - <translation>Enviar rastrear/debug info a la consola en lugar de debug.log archivo</translation> + <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> - <translation>Enviar rastrear / debug info al depurador</translation> + <translation>Enviar información de trazas/depuración al depurador</translation> </message> <message> <location line="+7"/> <source>Set maximum block size in bytes (default: 250000)</source> - <translation type="unfinished"/> + <translation>Establecer tamaño máximo de bloque en bytes (predeterminado: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> - <translation type="unfinished"/> + <translation>Establecer tamaño mínimo de bloque en bytes (predeterminado: 0)</translation> </message> <message> <location line="+1"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> - <translation type="unfinished"/> + <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> - <translation>Especifica tiempo de espera para conexion en milisegundos (por defecto: 5000)</translation> + <translation>Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000)</translation> </message> <message> <location line="+13"/> @@ -2352,23 +2352,23 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> - <translation type="unfinished"/> + <translation>Utilizar proxy para conectar a servicios ocultos (predeterminado: igual que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> - <translation>Usuario para las conexiones JSON-RPC + <translation>Nombre de usuario para las conexiones JSON-RPC </translation> </message> <message> <location line="+2"/> <source>Warning: Disk space is low!</source> - <translation>Atención: Poco espacio en el disco duro!</translation> + <translation>Atención: ¡Poco espacio en el disco duro!</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> - <translation type="unfinished"/> + <translation>Aviso: Esta versión es obsoleta, ¡actualización necesaria!</translation> </message> <message> <location line="-41"/> @@ -2379,19 +2379,19 @@ Dirección: %4</translation> <message> <location line="-12"/> <source>Listen for JSON-RPC connections on <port> (default: 8332)</source> - <translation>Escucha conexiones JSON-RPC en el puerto <port> (predeterminado: 8332) + <translation>Escuchar conexiones JSON-RPC en el puerto <port> (predeterminado: 8332) </translation> </message> <message> <location line="-41"/> <source>Allow JSON-RPC connections from specified IP address</source> - <translation>Permite conexiones JSON-RPC desde la dirección IP especificada + <translation>Permitir conexiones JSON-RPC desde la dirección IP especificada </translation> </message> <message> <location line="+61"/> <source>Send commands to node running on <ip> (default: 127.0.0.1)</source> - <translation>Envía comando al nodo situado en <ip> (predeterminado: 127.0.0.1) + <translation>Enviar comando al nodo situado en <ip> (predeterminado: 127.0.0.1) </translation> </message> <message> @@ -2407,7 +2407,7 @@ Dirección: %4</translation> <message> <location line="-15"/> <source>Set key pool size to <n> (default: 100)</source> - <translation>Ajusta el número de claves en reserva <n> (predeterminado: 100) + <translation>Ajustar el número de claves en reserva <n> (predeterminado: 100) </translation> </message> <message> @@ -2418,40 +2418,40 @@ Dirección: %4</translation> <message> <location line="-24"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> - <translation>Cuántos bloques para comprobar en el arranque (por defecto: 2500, 0 = todos)</translation> + <translation>Cuántos bloques comprobar al iniciar (predeterminado: 2500, 0 = todos)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> - <translation>Cómo completa la verificación del bloque es (0-6, por defecto: 1)</translation> + <translation>Nivel de detalle en la verificación de bloques (0-6, predeterminado: 1)</translation> </message> <message> <location line="+2"/> <source>Imports blocks from external blk000?.dat file</source> - <translation type="unfinished"/> + <translation>Importa los bloques desde un archivo externo blk000?.dat</translation> </message> <message> <location line="+52"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> - <translation>Usa OpenSSL (https) para las conexiones JSON-RPC + <translation>Usar OpenSSL (https) para las conexiones JSON-RPC </translation> </message> <message> <location line="-21"/> <source>Server certificate file (default: server.cert)</source> - <translation>Certificado del servidor (Predeterminado: server.cert) + <translation>Certificado del servidor (predeterminado: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> - <translation>Clave privada del servidor (Predeterminado: server.pem) + <translation>Clave privada del servidor (predeterminado: server.pem) </translation> </message> <message> <location line="-110"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> - <translation>Cifrados aceptados (Predeterminado: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) + <translation>Cifrados aceptados (predeterminado: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> @@ -2474,7 +2474,7 @@ Dirección: %4</translation> <message> <location line="+77"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> - <translation>No es posible conectar con %s en este sistema (bind returned error %d, %s)</translation> + <translation>No es posible conectar con %s en este sistema (bind ha dado el error %d, %s)</translation> </message> <message> <location line="-69"/> @@ -2519,7 +2519,7 @@ Dirección: %4</translation> <message> <location line="+18"/> <source>Invalid -proxy address: '%s'</source> - <translation>Dirección -proxy invalida: '%s'</translation> + <translation>Dirección -proxy inválida: '%s'</translation> </message> <message> <location line="+47"/> @@ -2529,17 +2529,17 @@ Dirección: %4</translation> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> - <translation type="unfinished"/> + <translation>Solicitada versión de proxy -socks desconocida: %i</translation> </message> <message> <location line="-74"/> <source>Cannot resolve -bind address: '%s'</source> - <translation type="unfinished"/> + <translation>No se puede resolver la dirección de -bind: '%s'</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: '%s'</source> - <translation type="unfinished"/> + <translation>No se puede resolver la dirección de -externalip: '%s'</translation> </message> <message> <location line="+29"/> @@ -2549,12 +2549,12 @@ Dirección: %4</translation> <message> <location line="-14"/> <source>Error: could not start node</source> - <translation type="unfinished"/> + <translation>Error: no se ha podido iniciar el nodo</translation> </message> <message> <location line="-1"/> <source>Error: Wallet locked, unable to create transaction </source> - <translation>Error: monedero bloqueado. Bitcoin es incapaz de crear las transacciones </translation> + <translation>Error: monedero bloqueado. Bitcoin es incapaz de crear la transacción </translation> </message> <message> <location line="-55"/> @@ -2594,17 +2594,17 @@ Dirección: %4</translation> <message> <location line="-46"/> <source>Add a node to connect to and attempt to keep the connection open</source> - <translation>Añadir un nodo para conectarse y tratar de mantener la conexión abierta</translation> + <translation>Añadir un nodo al que conectarse y tratar de mantener la conexión abierta</translation> </message> <message> <location line="-18"/> <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source> - <translation>No es posible conectar con %s en este sistema. Probablemente Bitcoin ya está arrancado.</translation> + <translation>No es posible conectar con %s en este sistema. Probablemente Bitcoin ya está ejecutándose.</translation> </message> <message> <location line="+48"/> <source>Find peers using internet relay chat (default: 0)</source> - <translation>Encontrar los pares utilizando Internet Relay Chat (por defecto: 0)</translation> + <translation>Encontrar los pares utilizando Internet Relay Chat (predeterminado: 0)</translation> </message> <message> <location line="-2"/> @@ -2624,12 +2624,12 @@ Dirección: %4</translation> <message> <location line="+1"/> <source>Cannot initialize keypool</source> - <translation>No se puede inicializar grupo de teclas</translation> + <translation>No se puede inicializar la reserva de claves</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> - <translation>No se puede escribir la dirección por defecto</translation> + <translation>No se puede escribir la dirección predeterminada</translation> </message> <message> <location line="+46"/> @@ -2661,8 +2661,8 @@ If the file does not exist, create it with owner-readable-only file permissions. Se recomienda utilizar la siguiente contraseña aleatoria: ⏎ rpcuser = bitcoinrpc ⏎ rpcpassword =%s ⏎ -(no es necesario para recordar esta contraseña) ⏎ -Si el archivo no existe se crea con los permisos de lectura y escritura solamente del propietario. ⏎</translation> +(no es necesario recordar esta contraseña) ⏎ +Si el archivo no existe, créelo con permiso de lectura solamente del propietario. ⏎</translation> </message> <message> <location line="+74"/> @@ -2676,7 +2676,7 @@ Si el archivo no existe se crea con los permisos de lectura y escritura solament If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Tiene que establecer rpcpassword=<contraseña> en el fichero de configuración: ⏎ %s ⏎ -Si el archivo no existe, se crea con permisos de propietario de lectura de sólo archivos.</translation> +Si el archivo no existe, créelo con permiso de lectura solamente del propietario.</translation> </message> </context> </TS>
\ No newline at end of file diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index fd52d824a3..d67871609a 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -2251,7 +2251,7 @@ Address: %4 <message> <location line="+6"/> <source>Importing blocks...</source> - <translation type="unfinished"/> + <translation>وارد کردن بلوکها</translation> </message> <message> <location line="+4"/> diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index deb2d9498d..51f301775a 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -444,7 +444,7 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. <message> <location line="+3"/> <source>Backup wallet to another location</source> - <translation type="unfinished"/> + <translation>Daryti piniginės atsarginę kopiją</translation> </message> <message> <location line="+2"/> @@ -604,7 +604,7 @@ Adresas: %4</translation> <location line="+120"/> <location line="+15"/> <source>URI handling</source> - <translation type="unfinished"/> + <translation>URI apdorojimas</translation> </message> <message> <location line="-15"/> @@ -635,7 +635,7 @@ Adresas: %4</translation> <message> <location line="+3"/> <source>Backup Failed</source> - <translation type="unfinished"/> + <translation>Nepavyko padaryti atsarginės kopijos</translation> </message> <message> <location line="+0"/> @@ -793,7 +793,7 @@ Adresas: %4</translation> <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> - <translation>Automatiškai paleisti Bitkoin programą kai yra įjungiamas kompiuteris</translation> + <translation>Automatiškai paleisti Bitkoin programą įjungus sistemą.</translation> </message> <message> <location line="+3"/> @@ -943,7 +943,7 @@ Adresas: %4</translation> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> - <translation type="unfinished"/> + <translation>numatyta</translation> </message> <message> <location line="+147"/> @@ -960,7 +960,7 @@ Adresas: %4</translation> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> - <translation type="unfinished"/> + <translation>Nurodytas tarpinio serverio adresas negalioja.</translation> </message> </context> <context> @@ -1068,7 +1068,7 @@ Adresas: %4</translation> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> - <translation type="unfinished"/> + <translation>Klaida, koduojant URI į QR kodą.</translation> </message> <message> <location line="+40"/> @@ -1210,7 +1210,7 @@ Adresas: %4</translation> <message> <location line="+279"/> <source>Debug log file</source> - <translation type="unfinished"/> + <translation>Derinimo žurnalo failas</translation> </message> <message> <location line="+7"/> @@ -1748,12 +1748,12 @@ Adresas: %4</translation> <message> <location line="+1"/> <source>true</source> - <translation type="unfinished"/> + <translation>tiesa</translation> </message> <message> <location line="+0"/> <source>false</source> - <translation type="unfinished"/> + <translation>netiesa</translation> </message> <message> <location line="-212"/> @@ -1809,7 +1809,7 @@ Adresas: %4</translation> <message> <location line="+3"/> <source>Open until %1</source> - <translation>Atidaryta kol %n</translation> + <translation>Atidaryta iki %1</translation> </message> <message> <location line="+3"/> @@ -2274,12 +2274,12 @@ Adresas: %4</translation> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> - <translation>Išėjimo papildomas derinimo informacija. Implies all other -debug* options</translation> + <translation>Išvesti papildomą derinimo informaciją. Numanomi visi kiti -debug* parametrai</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> - <translation type="unfinished"/> + <translation>Išvesti papildomą tinklo derinimo informaciją</translation> </message> <message> <location line="+2"/> diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index 9cb1bca833..865ea62067 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -88,7 +88,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+11"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Zweryfikuj wiadomość, aby upewnić się, że została podpisana odpowiednim adresem Bitcoin.</translation> </message> <message> <location line="+3"/> @@ -420,7 +420,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+4"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Zweryfikuj wiadomość, aby upewnić się, że została podpisana odpowiednim adresem Bitcoin.</translation> </message> <message> <location line="+4"/> @@ -606,7 +606,7 @@ Adres: %4 <location line="+120"/> <location line="+15"/> <source>URI handling</source> - <translation type="unfinished"/> + <translation>Obsługa URI</translation> </message> <message> <location line="-15"/> @@ -805,12 +805,12 @@ Adres: %4 <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> - <translation type="unfinished"/> + <translation>Odłącz bazę bloków i adresów podczas zamknięcia aplikcji. Oznacza to, że baza może zostać przeniesiona do innego folderu, ale jednocześnie zwiększa czas potrzebny na zamknięcie programu. Portfel jest zawsze odłączany.</translation> </message> <message> <location line="+3"/> <source>&Detach databases at shutdown</source> - <translation type="unfinished"/> + <translation>&Odłącz bazy danych przy zamknięciu</translation> </message> <message> <location line="+21"/> @@ -920,7 +920,7 @@ Adres: %4 <message> <location line="+9"/> <source>Whether to show Bitcoin addresses in the transaction list or not.</source> - <translation type="unfinished"/> + <translation>Pokazuj adresy Bitcoin na liście transakcji.</translation> </message> <message> <location line="+3"/> @@ -976,7 +976,7 @@ Adres: %4 <location line="+33"/> <location line="+183"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> - <translation type="unfinished"/> + <translation>Wyświetlana informacja może być nieaktualna. Twój portfel synchronizuje się automatycznie z siecią bitcoin, zaraz po tym jak uzyskano połączenie, ale proces ten nie został jeszcze ukończony.</translation> </message> <message> <location line="-141"/> @@ -1001,12 +1001,12 @@ Adres: %4 <message> <location line="+124"/> <source>Immature:</source> - <translation type="unfinished"/> + <translation>Niedojrzały: </translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> - <translation type="unfinished"/> + <translation>Balans wydobycia, który jeszcze nie dojrzał</translation> </message> <message> <location line="+46"/> @@ -1147,12 +1147,12 @@ Adres: %4 <message> <location line="+23"/> <source>On testnet</source> - <translation type="unfinished"/> + <translation>W sieci testowej</translation> </message> <message> <location line="+23"/> <source>Block chain</source> - <translation type="unfinished"/> + <translation>Ciąg bloków</translation> </message> <message> <location line="+7"/> @@ -1182,7 +1182,7 @@ Adres: %4 <message> <location line="+7"/> <source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source> - <translation type="unfinished"/> + <translation>Pokaż pomoc Bitcoin-Qt, aby zobaczyć listę wszystkich opcji linii poleceń</translation> </message> <message> <location line="+3"/> @@ -1197,7 +1197,7 @@ Adres: %4 <message> <location line="-260"/> <source>Build date</source> - <translation type="unfinished"/> + <translation>Data kompilacji</translation> </message> <message> <location line="-104"/> @@ -1477,7 +1477,7 @@ Adres: %4 <message> <location line="+17"/> <source>Reset all sign message fields</source> - <translation type="unfinished"/> + <translation>Zresetuj wszystkie pola podpisanej wiadomości</translation> </message> <message> <location line="+3"/> @@ -1831,7 +1831,7 @@ Adres: %4 <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>Balans wydobycia będzie dostępny zaraz po tym, jak dojrzeje. Pozostał %n blok</numerusform><numerusform>Balans wydobycia będzie dostępny zaraz po tym, jak dojrzeje. Pozostało %n bloków</numerusform><numerusform>Balans wydobycia będzie dostępny zaraz po tym, jak dojrzeje. Pozostało %n bloków</numerusform></translation> </message> <message> <location line="+5"/> @@ -2156,7 +2156,7 @@ Adres: %4 <message> <location line="+64"/> <source>Specify your own public address</source> - <translation type="unfinished"/> + <translation>Podaj swój publiczny adres</translation> </message> <message> <location line="-75"/> @@ -2166,17 +2166,17 @@ Adres: %4 <message> <location line="+77"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> - <translation type="unfinished"/> + <translation>Próg po którym nastąpi rozłączenie nietrzymających się zasad peerów (domyślnie: 100)</translation> </message> <message> <location line="-105"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> - <translation type="unfinished"/> + <translation>Czas w sekundach, przez jaki nietrzymający się zasad peerzy nie będą mogli ponownie się podłączyć (domyślnie: 86400)</translation> </message> <message> <location line="-12"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> - <translation type="unfinished"/> + <translation>Odłącz bazę bloków i adresów. Zwiększa czas wyłączenia (domyślnie: 0)</translation> </message> <message> <location line="+34"/> @@ -2236,12 +2236,12 @@ Adres: %4 <message> <location line="+3"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> - <translation type="unfinished"/> + <translation>Odkryj własny adres IP (domyślnie: 1 kiedy w trybie nasłuchu i brak -externalip )</translation> </message> <message> <location line="+11"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> - <translation type="unfinished"/> + <translation>Próba otwarcia jakiegokolwiek portu nie powiodła się. Użyj -listen=0 jeśli tego chcesz.</translation> </message> <message> <location line="+2"/> @@ -2251,7 +2251,7 @@ Adres: %4 <message> <location line="+6"/> <source>Importing blocks...</source> - <translation type="unfinished"/> + <translation>Wczytywanie bloków</translation> </message> <message> <location line="+4"/> @@ -2286,7 +2286,7 @@ Adres: %4 <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> - <translation type="unfinished"/> + <translation>Poprzedź informacje debugowania znacznikiem czasowym</translation> </message> <message> <location line="+4"/> @@ -2381,7 +2381,7 @@ Adres: %4 <message> <location line="-90"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> - <translation type="unfinished"/> + <translation>Wykonaj polecenie kiedy najlepszy blok ulegnie zmianie (%s w komendzie zastanie zastąpione przez hash bloku)</translation> </message> <message> <location line="+113"/> @@ -2406,12 +2406,12 @@ Adres: %4 <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> - <translation type="unfinished"/> + <translation>Głębokość weryfikacji bloku (0-6, domyślnie: 1)</translation> </message> <message> <location line="+2"/> <source>Imports blocks from external blk000?.dat file</source> - <translation type="unfinished"/> + <translation>Importuj bloki z zewnętrznego pliku blk000?.dat</translation> </message> <message> <location line="+52"/> @@ -2461,7 +2461,7 @@ Adres: %4 <message> <location line="-13"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> - <translation type="unfinished"/> + <translation>Zezwól -addnode, -seednode i -connect na łączenie się z serwerem DNS</translation> </message> <message> <location line="+44"/> @@ -2501,22 +2501,22 @@ Adres: %4 <message> <location line="+47"/> <source>Unknown network specified in -onlynet: '%s'</source> - <translation type="unfinished"/> + <translation>Nieznana sieć w -onlynet: '%s'</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> - <translation type="unfinished"/> + <translation>Nieznana wersja proxy w -socks: %i</translation> </message> <message> <location line="-74"/> <source>Cannot resolve -bind address: '%s'</source> - <translation type="unfinished"/> + <translation>Nie można uzyskać adresu -bind: '%s'</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: '%s'</source> - <translation type="unfinished"/> + <translation>Nie można uzyskać adresu -externalip: '%s'</translation> </message> <message> <location line="+29"/> @@ -2602,12 +2602,12 @@ Adres: %4 <message> <location line="+1"/> <source>Cannot initialize keypool</source> - <translation type="unfinished"/> + <translation>Inicjalizacja puli kluczy nieudana</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> - <translation type="unfinished"/> + <translation>Nie można zapisać domyślnego adresu</translation> </message> <message> <location line="+46"/> diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index e6432abaa4..1d4a3f8711 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -15,7 +15,7 @@ <message> <location line="+41"/> <source>Copyright © 2009-2012 The Bitcoin developers</source> - <translation type="unfinished"/> + <translation>Copyright © 2009-2012 Os programadores Bitcoin</translation> </message> <message> <location line="+13"/> @@ -25,7 +25,12 @@ This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> - <translation type="unfinished"/> + <translation> +Este é um programa experimental. + +Distribuído sobre uma licença de software MIT/X11, por favor verifique o ficheiro anexo license.txt ou http://www.opensource.org/licenses/mit-license.php. + +Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software criptográfico escrito por Eric Young (eay@cryptsoft.com) e software UPnP escrito por Thomas Bernard.</translation> </message> </context> <context> @@ -58,7 +63,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="-46"/> <source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> - <translation type="unfinished"/> + <translation>Estes são os seus endereços Bitcoin para receber pagamentos. Poderá enviar um endereço diferente para cada remetente para poder identificar os pagamentos.</translation> </message> <message> <location line="+60"/> @@ -73,7 +78,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+11"/> <source>Sign a message to prove you own a Bitcoin address</source> - <translation type="unfinished"/> + <translation>Assine uma mensagem para provar que é dono de um endereço Bitcoin</translation> </message> <message> <location line="+3"/> @@ -83,7 +88,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+11"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Bitcoin especificado</translation> </message> <message> <location line="+3"/> @@ -219,18 +224,18 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source> - <translation type="unfinished"/> + <translation>Atenção: Se encriptar a carteira e perder a sua senha irá <b>PERDER TODOS OS SEUS BITCOINS</b>!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> - <translation type="unfinished"/> + <translation>Tem a certeza que deseja encriptar a carteira?</translation> </message> <message> <location line="+106"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> - <translation type="unfinished"/> + <translation>Atenção: A tecla Caps Lock está activa!</translation> </message> <message> <location line="-121"/> @@ -282,7 +287,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> - <translation type="unfinished"/> + <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> @@ -410,17 +415,17 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+6"/> <source>Sign a message to prove you own a Bitcoin address</source> - <translation type="unfinished"/> + <translation>Assine uma mensagem para provar que é dono de um endereço Bitcoin</translation> </message> <message> <location line="+4"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Bitcoin especificado</translation> </message> <message> <location line="+4"/> <source>S&ignatures</source> - <translation type="unfinished"/> + <translation>A&ssinaturas</translation> </message> <message> <location line="+37"/> @@ -480,7 +485,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message> <location line="+9"/> <source>&Show / Hide</source> - <translation type="unfinished"/> + <translation>&Mostrar / Ocultar</translation> </message> <message> <location line="+34"/> @@ -600,13 +605,13 @@ Endereço: %4</translation> <location line="+120"/> <location line="+15"/> <source>URI handling</source> - <translation type="unfinished"/> + <translation>Manuseamento URI</translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> - <translation type="unfinished"/> + <translation>URI não foi lido correctamente! Isto pode ser causado por um endereço Bitcoin inválido ou por parâmetros URI malformados.</translation> </message> <message> <location line="+16"/> @@ -641,7 +646,7 @@ Endereço: %4</translation> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> - <translation type="unfinished"/> + <translation>Ocorreu um erro fatal. O Bitcoin não pode continuar com segurança e irá fechar.</translation> </message> </context> <context> @@ -789,7 +794,7 @@ Endereço: %4</translation> <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> - <translation type="unfinished"/> + <translation>Começar o Bitcoin automaticamente ao iniciar sessão no sistema.</translation> </message> <message> <location line="+3"/> @@ -824,7 +829,7 @@ Endereço: %4</translation> <message> <location line="+7"/> <source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> - <translation type="unfinished"/> + <translation>Ligar à rede Bitcoin através de um proxy SOCKS (p.ex. quando ligar através de Tor).</translation> </message> <message> <location line="+3"/> @@ -1026,7 +1031,7 @@ Endereço: %4</translation> <location filename="../overviewpage.cpp" line="+112"/> <location line="+1"/> <source>out of sync</source> - <translation type="unfinished"/> + <translation>fora de sincronia</translation> </message> </context> <context> @@ -1069,7 +1074,7 @@ Endereço: %4</translation> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> - <translation type="unfinished"/> + <translation>A quantia introduzida é inválida, por favor verifique.</translation> </message> <message> <location line="+23"/> @@ -1121,7 +1126,7 @@ Endereço: %4</translation> <message> <location line="+68"/> <source>Using OpenSSL version</source> - <translation type="unfinished"/> + <translation>Usar versão OpenSSL</translation> </message> <message> <location line="+49"/> @@ -1201,17 +1206,17 @@ Endereço: %4</translation> <message> <location line="+25"/> <source>Bitcoin Core</source> - <translation type="unfinished"/> + <translation>Núcleo Bitcoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> - <translation type="unfinished"/> + <translation>Ficheiro de registo de depuração</translation> </message> <message> <location line="+7"/> <source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> - <translation type="unfinished"/> + <translation>Abrir o ficheiro de registo de depuração da pasta de dados actual. Isto pode demorar alguns segundos para ficheiros de registo maiores.</translation> </message> <message> <location line="+102"/> @@ -1221,17 +1226,17 @@ Endereço: %4</translation> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Bitcoin RPC console.</source> - <translation type="unfinished"/> + <translation>Bem-vindo à consola RPC Bitcoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source> - <translation type="unfinished"/> + <translation>Use as setas para cima e para baixo para navegar no histórico e <b>Ctrl-L</b> para limpar o ecrã.</translation> </message> <message> <location line="+1"/> <source>Type <b>help</b> for an overview of available commands.</source> - <translation type="unfinished"/> + <translation>Digite <b>help</b> para visualizar os comandos disponíveis.</translation> </message> </context> <context> @@ -1311,7 +1316,7 @@ Endereço: %4</translation> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> - <translation type="unfinished"/> + <translation>O endereço de destino não é válido, por favor verifique.</translation> </message> <message> <location line="+5"/> @@ -1413,7 +1418,7 @@ Endereço: %4</translation> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> - <translation type="unfinished"/> + <translation>Assinaturas - Assinar / Verificar uma Mensagem</translation> </message> <message> <location line="+13"/> @@ -1466,7 +1471,7 @@ Endereço: %4</translation> <message> <location line="+21"/> <source>Sign the message to prove you own this Bitcoin address</source> - <translation type="unfinished"/> + <translation>Assine uma mensagem para provar que é dono deste endereço Bitcoin</translation> </message> <message> <location line="+17"/> @@ -1498,7 +1503,7 @@ Endereço: %4</translation> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> - <translation type="unfinished"/> + <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Bitcoin especificado</translation> </message> <message> <location line="+17"/> @@ -1514,7 +1519,7 @@ Endereço: %4</translation> <message> <location line="-2"/> <source>Click "Sign Message" to generate signature</source> - <translation type="unfinished"/> + <translation>Clique "Assinar mensagem" para gerar a assinatura</translation> </message> <message> <location line="+3"/> @@ -1525,7 +1530,7 @@ Endereço: %4</translation> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> - <translation type="unfinished"/> + <translation>O endereço introduzido é inválido. </translation> </message> <message> <location line="-81"/> @@ -1539,27 +1544,27 @@ Endereço: %4</translation> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> - <translation type="unfinished"/> + <translation>O endereço introduzido não refere a chave alguma.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> - <translation type="unfinished"/> + <translation>O desbloqueio da carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> - <translation type="unfinished"/> + <translation>A chave privada para o endereço introduzido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> - <translation type="unfinished"/> + <translation>Assinatura de mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> - <translation type="unfinished"/> + <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> @@ -1598,12 +1603,12 @@ Endereço: %4</translation> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>Aberto para %n bloco</numerusform><numerusform>Aberto para %n blocos</numerusform></translation> </message> <message> <location line="+8"/> <source>%1/offline</source> - <translation type="unfinished"/> + <translation>%1/desligado</translation> </message> <message> <location line="+2"/> @@ -1618,12 +1623,12 @@ Endereço: %4</translation> <message> <location line="+18"/> <source>Status</source> - <translation type="unfinished"/> + <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>, transmitida através de %n nó</numerusform><numerusform>, transmitida através de %n nós</numerusform></translation> </message> <message> <location line="+4"/> @@ -1633,7 +1638,7 @@ Endereço: %4</translation> <message> <location line="+7"/> <source>Source</source> - <translation type="unfinished"/> + <translation>Origem</translation> </message> <message> <location line="+0"/> @@ -1644,20 +1649,20 @@ Endereço: %4</translation> <location line="+6"/> <location line="+17"/> <source>From</source> - <translation type="unfinished"/> + <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> - <translation type="unfinished"/> + <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> - <translation type="unfinished"/> + <translation>endereço próprio</translation> </message> <message> <location line="-2"/> @@ -1671,17 +1676,17 @@ Endereço: %4</translation> <location line="+17"/> <location line="+30"/> <source>Credit</source> - <translation type="unfinished"/> + <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>matura daqui por %n bloco</numerusform><numerusform>matura daqui por %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> - <translation type="unfinished"/> + <translation>não aceite</translation> </message> <message> <location line="+44"/> @@ -1689,7 +1694,7 @@ Endereço: %4</translation> <location line="+15"/> <location line="+30"/> <source>Debit</source> - <translation type="unfinished"/> + <translation>Débito</translation> </message> <message> <location line="-39"/> @@ -1699,7 +1704,7 @@ Endereço: %4</translation> <message> <location line="+16"/> <source>Net amount</source> - <translation type="unfinished"/> + <translation>Valor líquido</translation> </message> <message> <location line="+6"/> @@ -1709,32 +1714,32 @@ Endereço: %4</translation> <message> <location line="+2"/> <source>Comment</source> - <translation type="unfinished"/> + <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> - <translation type="unfinished"/> + <translation>ID da Transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> - <translation type="unfinished"/> + <translation>Moedas geradas deverão maturar por 120 blocos antes de poderem ser gastas. Quando gerou este bloco, ele foi transmitido para a rede para ser incluído na cadeia de blocos. Se a inclusão na cadeia de blocos falhar, irá mudar o estado para "não aceite" e as moedas não poderão ser gastas. Isto poderá acontecer ocasionalmente se outro nó da rede gerar um bloco a poucos segundos de diferença do seu.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> - <translation type="unfinished"/> + <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> - <translation type="unfinished"/> + <translation>Transação</translation> </message> <message> <location line="+5"/> <source>Inputs</source> - <translation type="unfinished"/> + <translation>Entradas</translation> </message> <message> <location line="+23"/> @@ -1744,12 +1749,12 @@ Endereço: %4</translation> <message> <location line="+1"/> <source>true</source> - <translation type="unfinished"/> + <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> - <translation type="unfinished"/> + <translation>falso</translation> </message> <message> <location line="-212"/> @@ -2200,7 +2205,7 @@ Endereço: %4</translation> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> - <translation type="unfinished"/> + <translation>Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação.</translation> </message> <message> <location line="+3"/> @@ -2210,17 +2215,17 @@ Endereço: %4</translation> <message> <location line="+3"/> <source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.</source> - <translation type="unfinished"/> + <translation>Atenção: Por favor verifique que a data e hora do seu computador estão correctas! Se o seu relógio não estiver certo o Bitcoin não irá funcionar correctamente.</translation> </message> <message> <location line="+13"/> <source>An error occurred while setting up the RPC port %i for listening: %s</source> - <translation type="unfinished"/> + <translation>Ocorreu um erro ao definir a porta de escuta %i do serviço RPC: %s</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> - <translation type="unfinished"/> + <translation>Opções de criação de Bloco:</translation> </message> <message> <location line="+6"/> @@ -2240,32 +2245,32 @@ Endereço: %4</translation> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> - <translation type="unfinished"/> + <translation>Encontrar pares usando procura DNS (por defeito: 1 excepto -connect)</translation> </message> <message> <location line="+6"/> <source>Importing blocks...</source> - <translation type="unfinished"/> + <translation>A importar blocos...</translation> </message> <message> <location line="+4"/> <source>Invalid -tor address: '%s'</source> - <translation type="unfinished"/> + <translation>Endereço -tor inválido: '%s'</translation> </message> <message> <location line="+10"/> <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source> - <translation type="unfinished"/> + <translation>Armazenamento intermédio de recepção por ligação, <n>*1000 bytes (por defeito: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source> - <translation type="unfinished"/> + <translation>Armazenamento intermédio de envio por ligação, <n>*1000 bytes (por defeito: 1000)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source> - <translation type="unfinished"/> + <translation>Apenas ligar a nós na rede <net> (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+2"/> @@ -2275,7 +2280,7 @@ Endereço: %4</translation> <message> <location line="+1"/> <source>Output extra network debugging information</source> - <translation type="unfinished"/> + <translation>Produzir informação de depuração extraordinária</translation> </message> <message> <location line="+2"/> @@ -2285,7 +2290,7 @@ Endereço: %4</translation> <message> <location line="+4"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> - <translation type="unfinished"/> + <translation>Opções SSL: (ver a Wiki Bitcoin para instruções de configuração SSL)</translation> </message> <message> <location line="+1"/> @@ -2320,7 +2325,7 @@ Endereço: %4</translation> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> - <translation type="unfinished"/> + <translation>Especificar tempo de espera da ligação em millisegundos (por defeito: 5000)</translation> </message> <message> <location line="+13"/> @@ -2345,12 +2350,12 @@ Endereço: %4</translation> <message> <location line="+2"/> <source>Warning: Disk space is low!</source> - <translation type="unfinished"/> + <translation>Atenção: Pouco espaço em disco!</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> - <translation type="unfinished"/> + <translation>Atenção: Esta versão está obsoleta, é necessário actualizar!</translation> </message> <message> <location line="-41"/> @@ -2445,7 +2450,7 @@ Endereço: %4</translation> <message> <location line="+77"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> - <translation type="unfinished"/> + <translation>Incapaz de vincular a %s neste computador (vínculo retornou erro %d, %s)</translation> </message> <message> <location line="-69"/> @@ -2455,7 +2460,7 @@ Endereço: %4</translation> <message> <location line="-13"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> - <translation type="unfinished"/> + <translation>Permitir procuras DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+44"/> @@ -2490,27 +2495,27 @@ Endereço: %4</translation> <message> <location line="+18"/> <source>Invalid -proxy address: '%s'</source> - <translation type="unfinished"/> + <translation>Endereço -proxy inválido: '%s'</translation> </message> <message> <location line="+47"/> <source>Unknown network specified in -onlynet: '%s'</source> - <translation type="unfinished"/> + <translation>Rede desconhecida especificada em -onlynet: '%s'</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> - <translation type="unfinished"/> + <translation>Versão desconhecida de proxy -socks requisitada: %i</translation> </message> <message> <location line="-74"/> <source>Cannot resolve -bind address: '%s'</source> - <translation type="unfinished"/> + <translation>Não conseguiu resolver endereço -bind: '%s'</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: '%s'</source> - <translation type="unfinished"/> + <translation>Não conseguiu resolver endereço -externalip: '%s'</translation> </message> <message> <location line="+29"/> @@ -2520,7 +2525,7 @@ Endereço: %4</translation> <message> <location line="-14"/> <source>Error: could not start node</source> - <translation type="unfinished"/> + <translation>Erro: não iniciou o nó</translation> </message> <message> <location line="-1"/> @@ -2570,7 +2575,7 @@ Endereço: %4</translation> <message> <location line="-18"/> <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source> - <translation type="unfinished"/> + <translation>Incapaz de vincular à porta %s neste computador. Provavelmente o Bitcoin já está a funcionar.</translation> </message> <message> <location line="+48"/> diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index 6b6a98726a..0225851bd4 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -2313,7 +2313,7 @@ Address: %4 <message> <location line="+7"/> <source>Set maximum block size in bytes (default: 250000)</source> - <translation>Минимальный размер блока в байтах (по умолчанию: 250000)</translation> + <translation>Максимальный размер блока в байтах (по умолчанию: 250000)</translation> </message> <message> <location line="+1"/> @@ -2641,7 +2641,7 @@ If the file does not exist, create it with owner-readable-only file permissions. rpcuser=bitcoinrpc rpcpassword=%s (вам не нужно запоминать этот пароль) -Если файл не существует, создайте его и установите право доступа только для чтения только для владельца. +Если файл не существует, создайте его и установите права доступа только для владельца. </translation> </message> <message> @@ -2656,7 +2656,7 @@ rpcpassword=%s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Вы должны установить rpcpassword=<password> в конфигурационном файле: %s -Если файл не существует, создайте его и установите право доступа только для чтения только для владельца.</translation> +Если файл не существует, создайте его и установите права доступа только для владельца.</translation> </message> </context> </TS>
\ No newline at end of file diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index 891777c2d4..f7139a814e 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -796,7 +796,7 @@ Adress: %4 <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> - <translation>Starta Bitcoin automatiskt efter inloggning</translation> + <translation>Starta Bitcoin automatiskt efter inloggning.</translation> </message> <message> <location line="+3"/> diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index cd26e9ffeb..bfe13fcf1c 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -527,7 +527,7 @@ This product includes software developed by the OpenSSL Project for use in the O <message numerus="yes"> <location line="+71"/> <source>%n active connection(s) to Bitcoin network</source> - <translation><numerusform>您连接到比特币网络的连接数量共有%n条</numerusform></translation> + <translation><numerusform>到比特币网络的连接共有%n条</numerusform></translation> </message> <message> <location line="+40"/> diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index bf911a84b2..6c9f67c7ec 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -2337,7 +2337,7 @@ Address: %4 <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> - <translation type="unfinished"/> + <translation>指定連線在幾毫秒後逾時 (預設: 5000)</translation> </message> <message> <location line="+13"/> diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 8025126c25..3fb30a9518 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -139,7 +139,7 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion); /* Window */ -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray); mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose); #endif diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index f549cb4c74..1b2f18eab3 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -145,18 +145,18 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const case ProxyUse: return settings.value("fUseProxy", false); case ProxyIP: { - CService addrProxy; - if (GetProxy(NET_IPV4, addrProxy)) - return QVariant(QString::fromStdString(addrProxy.ToStringIP())); + proxyType proxy; + if (GetProxy(NET_IPV4, proxy)) + return QVariant(QString::fromStdString(proxy.first.ToStringIP())); else return QVariant(QString::fromStdString("127.0.0.1")); } case ProxyPort: { - CService addrProxy; - if (GetProxy(NET_IPV4, addrProxy)) - return QVariant(addrProxy.GetPort()); + proxyType proxy; + if (GetProxy(NET_IPV4, proxy)) + return QVariant(proxy.first.GetPort()); else - return 9050; + return QVariant(9050); } case ProxySocksVersion: return settings.value("nSocksVersion", 5); @@ -176,6 +176,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const } return QVariant(); } + bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role) { bool successful = true; /* set to false on parse error */ @@ -204,29 +205,37 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("fUseProxy", value.toBool()); ApplyProxySettings(); break; - case ProxyIP: - { - CService addrProxy("127.0.0.1", 9050); - GetProxy(NET_IPV4, addrProxy); - CNetAddr addr(value.toString().toStdString()); - addrProxy.SetIP(addr); - settings.setValue("addrProxy", addrProxy.ToStringIPPort().c_str()); - successful = ApplyProxySettings(); - } - break; - case ProxyPort: - { - CService addrProxy("127.0.0.1", 9050); - GetProxy(NET_IPV4, addrProxy); - addrProxy.SetPort(value.toInt()); - settings.setValue("addrProxy", addrProxy.ToStringIPPort().c_str()); - successful = ApplyProxySettings(); - } - break; - case ProxySocksVersion: - settings.setValue("nSocksVersion", value.toInt()); - ApplyProxySettings(); - break; + case ProxyIP: { + proxyType proxy; + proxy.first = CService("127.0.0.1", 9050); + GetProxy(NET_IPV4, proxy); + + CNetAddr addr(value.toString().toStdString()); + proxy.first.SetIP(addr); + settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str()); + successful = ApplyProxySettings(); + } + break; + case ProxyPort: { + proxyType proxy; + proxy.first = CService("127.0.0.1", 9050); + GetProxy(NET_IPV4, proxy); + + proxy.first.SetPort(value.toInt()); + settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str()); + successful = ApplyProxySettings(); + } + break; + case ProxySocksVersion: { + proxyType proxy; + proxy.second = 5; + GetProxy(NET_IPV4, proxy); + + proxy.second = value.toInt(); + settings.setValue("nSocksVersion", proxy.second); + successful = ApplyProxySettings(); + } + break; case Fee: nTransactionFee = value.toLongLong(); settings.setValue("nTransactionFee", nTransactionFee); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5469dd2952..2dfdf58422 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -150,7 +150,7 @@ Value getblock(const Array& params, bool fHelp) uint256 hash(strHash); if (mapBlockIndex.count(hash) == 0) - throw JSONRPCError(-5, "Block not found"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); CBlock block; CBlockIndex* pblockindex = mapBlockIndex[hash]; diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 30e504a095..55d5d79e23 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -46,7 +46,7 @@ Value importprivkey(const Array& params, bool fHelp) CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strSecret); - if (!fGood) throw JSONRPCError(-5,"Invalid private key"); + if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key; bool fCompressed; @@ -60,7 +60,7 @@ Value importprivkey(const Array& params, bool fHelp) pwalletMain->SetAddressBookName(vchAddress, strLabel); if (!pwalletMain->AddKey(key)) - throw JSONRPCError(-4,"Error adding key to wallet"); + throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); @@ -79,13 +79,13 @@ Value dumpprivkey(const Array& params, bool fHelp) string strAddress = params[0].get_str(); CBitcoinAddress address; if (!address.SetString(strAddress)) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); CKeyID keyID; if (!address.GetKeyID(keyID)) - throw JSONRPCError(-3, "Address does not refer to a key"); + throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); CSecret vchSecret; bool fCompressed; if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) - throw JSONRPCError(-4,"Private key for address " + strAddress + " is not known"); + throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); return CBitcoinSecret(vchSecret, fCompressed).ToString(); } diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 2954b9ee57..96712482d5 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -96,10 +96,10 @@ Value getwork(const Array& params, bool fHelp) "If [data] is specified, tries to solve the block and returns true if it was successful."); if (vNodes.empty()) - throw JSONRPCError(-9, "Bitcoin is not connected!"); + throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!"); if (IsInitialBlockDownload()) - throw JSONRPCError(-10, "Bitcoin is downloading blocks..."); + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks..."); typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t; static mapNewBlock_t mapNewBlock; // FIXME: thread safety @@ -136,7 +136,7 @@ Value getwork(const Array& params, bool fHelp) // Create new block pblock = CreateNewBlock(reservekey); if (!pblock) - throw JSONRPCError(-7, "Out of memory"); + throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); vNewBlock.push_back(pblock); // Need to update only after we know CreateNewBlock succeeded @@ -174,7 +174,7 @@ Value getwork(const Array& params, bool fHelp) // Parse parameters vector<unsigned char> vchData = ParseHex(params[0].get_str()); if (vchData.size() != 128) - throw JSONRPCError(-8, "Invalid parameter"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); CBlock* pdata = (CBlock*)&vchData[0]; // Byte reverse @@ -230,17 +230,17 @@ Value getblocktemplate(const Array& params, bool fHelp) /* Do nothing */ } else - throw JSONRPCError(-8, "Invalid mode"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); } if (strMode != "template") - throw JSONRPCError(-8, "Invalid mode"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); if (vNodes.empty()) - throw JSONRPCError(-9, "Bitcoin is not connected!"); + throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!"); if (IsInitialBlockDownload()) - throw JSONRPCError(-10, "Bitcoin is downloading blocks..."); + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks..."); static CReserveKey reservekey(pwalletMain); @@ -268,7 +268,7 @@ Value getblocktemplate(const Array& params, bool fHelp) } pblock = CreateNewBlock(reservekey); if (!pblock) - throw JSONRPCError(-7, "Out of memory"); + throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); // Need to update only after we know CreateNewBlock succeeded pindexPrev = pindexPrevNew; @@ -369,7 +369,7 @@ Value submitblock(const Array& params, bool fHelp) ssBlock >> block; } catch (std::exception &e) { - throw JSONRPCError(-22, "Block decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); } bool fAccepted = ProcessBlock(NULL, &block); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 08b0049b08..e634ed7ddc 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -119,7 +119,7 @@ Value getrawtransaction(const Array& params, bool fHelp) CTransaction tx; uint256 hashBlock = 0; if (!GetTransaction(hash, tx, hashBlock)) - throw JSONRPCError(-5, "No information available about transaction"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction"); CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << tx; @@ -163,9 +163,9 @@ Value listunspent(const Array& params, bool fHelp) { CBitcoinAddress address(input.get_str()); if (!address.IsValid()) - throw JSONRPCError(-5, string("Invalid Bitcoin address: ")+input.get_str()); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+input.get_str()); if (setAddress.count(address)) - throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+input.get_str()); + throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str()); setAddress.insert(address); } } @@ -227,17 +227,17 @@ Value createrawtransaction(const Array& params, bool fHelp) const Value& txid_v = find_value(o, "txid"); if (txid_v.type() != str_type) - throw JSONRPCError(-8, "Invalid parameter, missing txid key"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing txid key"); string txid = txid_v.get_str(); if (!IsHex(txid)) - throw JSONRPCError(-8, "Invalid parameter, expected hex txid"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected hex txid"); const Value& vout_v = find_value(o, "vout"); if (vout_v.type() != int_type) - throw JSONRPCError(-8, "Invalid parameter, missing vout key"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key"); int nOutput = vout_v.get_int(); if (nOutput < 0) - throw JSONRPCError(-8, "Invalid parameter, vout must be positive"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive"); CTxIn in(COutPoint(uint256(txid), nOutput)); rawTx.vin.push_back(in); @@ -248,10 +248,10 @@ Value createrawtransaction(const Array& params, bool fHelp) { CBitcoinAddress address(s.name_); if (!address.IsValid()) - throw JSONRPCError(-5, string("Invalid Bitcoin address: ")+s.name_); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+s.name_); if (setAddress.count(address)) - throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_); + throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_); setAddress.insert(address); CScript scriptPubKey; @@ -283,7 +283,7 @@ Value decoderawtransaction(const Array& params, bool fHelp) ssData >> tx; } catch (std::exception &e) { - throw JSONRPCError(-22, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } Object result; @@ -322,12 +322,12 @@ Value signrawtransaction(const Array& params, bool fHelp) txVariants.push_back(tx); } catch (std::exception &e) { - throw JSONRPCError(-22, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } } if (txVariants.empty()) - throw JSONRPCError(-22, "Missing transaction"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transaction"); // mergedTx will end up with all the signatures; it // starts as a clone of the rawtx: @@ -364,7 +364,7 @@ Value signrawtransaction(const Array& params, bool fHelp) BOOST_FOREACH(Value& p, prevTxs) { if (p.type() != obj_type) - throw JSONRPCError(-22, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}"); Object prevOut = p.get_obj(); @@ -372,17 +372,17 @@ Value signrawtransaction(const Array& params, bool fHelp) string txidHex = find_value(prevOut, "txid").get_str(); if (!IsHex(txidHex)) - throw JSONRPCError(-22, "txid must be hexadecimal"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "txid must be hexadecimal"); uint256 txid; txid.SetHex(txidHex); int nOut = find_value(prevOut, "vout").get_int(); if (nOut < 0) - throw JSONRPCError(-22, "vout must be positive"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "vout must be positive"); string pkHex = find_value(prevOut, "scriptPubKey").get_str(); if (!IsHex(pkHex)) - throw JSONRPCError(-22, "scriptPubKey must be hexadecimal"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "scriptPubKey must be hexadecimal"); vector<unsigned char> pkData(ParseHex(pkHex)); CScript scriptPubKey(pkData.begin(), pkData.end()); @@ -395,7 +395,7 @@ Value signrawtransaction(const Array& params, bool fHelp) string err("Previous output scriptPubKey mismatch:\n"); err = err + mapPrevOut[outpoint].ToString() + "\nvs:\n"+ scriptPubKey.ToString(); - throw JSONRPCError(-22, err); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err); } } else @@ -414,7 +414,7 @@ Value signrawtransaction(const Array& params, bool fHelp) CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(k.get_str()); if (!fGood) - throw JSONRPCError(-5,"Invalid private key"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY,"Invalid private key"); CKey key; bool fCompressed; CSecret secret = vchSecret.GetSecret(fCompressed); @@ -443,7 +443,7 @@ Value signrawtransaction(const Array& params, bool fHelp) if (mapSigHashValues.count(strHashType)) nHashType = mapSigHashValues[strHashType]; else - throw JSONRPCError(-8, "Invalid sighash param"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid sighash param"); } bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); @@ -501,7 +501,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) ssData >> tx; } catch (std::exception &e) { - throw JSONRPCError(-22, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } uint256 hashTx = tx.GetHash(); @@ -512,7 +512,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) if (GetTransaction(hashTx, existingTx, hashBlock)) { if (hashBlock != 0) - throw JSONRPCError(-5, string("transaction already in block ")+hashBlock.GetHex()); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("transaction already in block ")+hashBlock.GetHex()); // Not in block, but already in the memory pool; will drop // through to re-relay it. } @@ -521,7 +521,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) // push to local node CTxDB txdb("r"); if (!tx.AcceptToMemoryPool(txdb)) - throw JSONRPCError(-22, "TX rejected"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX rejected"); SyncWithWallets(tx, NULL, true); } diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 66670d0937..cc2e8ab46b 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -25,7 +25,7 @@ std::string HelpRequiringPassphrase() void EnsureWalletIsUnlocked() { if (pwalletMain->IsLocked()) - throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first."); + throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first."); } void WalletTxToJSON(const CWalletTx& wtx, Object& entry) @@ -51,7 +51,7 @@ string AccountFromValue(const Value& value) { string strAccount = value.get_str(); if (strAccount == "*") - throw JSONRPCError(-11, "Invalid account name"); + throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name"); return strAccount; } @@ -62,8 +62,8 @@ Value getinfo(const Array& params, bool fHelp) "getinfo\n" "Returns an object containing various state info."); - CService addrProxy; - GetProxy(NET_IPV4, addrProxy); + proxyType proxy; + GetProxy(NET_IPV4, proxy); Object obj; obj.push_back(Pair("version", (int)CLIENT_VERSION)); @@ -72,7 +72,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("blocks", (int)nBestHeight)); obj.push_back(Pair("connections", (int)vNodes.size())); - obj.push_back(Pair("proxy", (addrProxy.IsValid() ? addrProxy.ToStringIPPort() : string()))); + obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", fTestNet)); obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); @@ -106,7 +106,7 @@ Value getnewaddress(const Array& params, bool fHelp) // Generate a new key that is added to wallet CPubKey newKey; if (!pwalletMain->GetKeyFromPool(newKey, false)) - throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first"); + throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first"); CKeyID keyID = newKey.GetID(); pwalletMain->SetAddressBookName(keyID, strAccount); @@ -144,7 +144,7 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false) if (!account.vchPubKey.IsValid() || bForceNew || bKeyUsed) { if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false)) - throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first"); + throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first"); pwalletMain->SetAddressBookName(account.vchPubKey.GetID(), strAccount); walletdb.WriteAccount(strAccount, account); @@ -181,7 +181,7 @@ Value setaccount(const Array& params, bool fHelp) CBitcoinAddress address(params[0].get_str()); if (!address.IsValid()) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); string strAccount; @@ -211,7 +211,7 @@ Value getaccount(const Array& params, bool fHelp) CBitcoinAddress address(params[0].get_str()); if (!address.IsValid()) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); string strAccount; map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get()); @@ -252,7 +252,7 @@ Value sendtoaddress(const Array& params, bool fHelp) CBitcoinAddress address(params[0].get_str()); if (!address.IsValid()) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); // Amount int64 nAmount = AmountFromValue(params[1]); @@ -265,11 +265,11 @@ Value sendtoaddress(const Array& params, bool fHelp) wtx.mapValue["to"] = params[3].get_str(); if (pwalletMain->IsLocked()) - throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first."); + throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first."); string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); if (strError != "") - throw JSONRPCError(-4, strError); + throw JSONRPCError(RPC_WALLET_ERROR, strError); return wtx.GetHash().GetHex(); } @@ -319,15 +319,15 @@ Value signmessage(const Array& params, bool fHelp) CBitcoinAddress addr(strAddress); if (!addr.IsValid()) - throw JSONRPCError(-3, "Invalid address"); + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address"); CKeyID keyID; if (!addr.GetKeyID(keyID)) - throw JSONRPCError(-3, "Address does not refer to key"); + throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key"); CKey key; if (!pwalletMain->GetKey(keyID, key)) - throw JSONRPCError(-4, "Private key not available"); + throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available"); CDataStream ss(SER_GETHASH, 0); ss << strMessageMagic; @@ -335,7 +335,7 @@ Value signmessage(const Array& params, bool fHelp) vector<unsigned char> vchSig; if (!key.SignCompact(Hash(ss.begin(), ss.end()), vchSig)) - throw JSONRPCError(-5, "Sign failed"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed"); return EncodeBase64(&vchSig[0], vchSig.size()); } @@ -353,17 +353,17 @@ Value verifymessage(const Array& params, bool fHelp) CBitcoinAddress addr(strAddress); if (!addr.IsValid()) - throw JSONRPCError(-3, "Invalid address"); + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address"); CKeyID keyID; if (!addr.GetKeyID(keyID)) - throw JSONRPCError(-3, "Address does not refer to key"); + throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key"); bool fInvalid = false; vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid); if (fInvalid) - throw JSONRPCError(-5, "Malformed base64 encoding"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding"); CDataStream ss(SER_GETHASH, 0); ss << strMessageMagic; @@ -388,7 +388,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp) CBitcoinAddress address = CBitcoinAddress(params[0].get_str()); CScript scriptPubKey; if (!address.IsValid()) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); scriptPubKey.SetDestination(address.Get()); if (!IsMine(*pwalletMain,scriptPubKey)) return (double)0.0; @@ -567,7 +567,7 @@ Value movecmd(const Array& params, bool fHelp) CWalletDB walletdb(pwalletMain->strWalletFile); if (!walletdb.TxnBegin()) - throw JSONRPCError(-20, "database error"); + throw JSONRPCError(RPC_DATABASE_ERROR, "database error"); int64 nNow = GetAdjustedTime(); @@ -592,7 +592,7 @@ Value movecmd(const Array& params, bool fHelp) walletdb.WriteAccountingEntry(credit); if (!walletdb.TxnCommit()) - throw JSONRPCError(-20, "database error"); + throw JSONRPCError(RPC_DATABASE_ERROR, "database error"); return true; } @@ -609,7 +609,7 @@ Value sendfrom(const Array& params, bool fHelp) string strAccount = AccountFromValue(params[0]); CBitcoinAddress address(params[1].get_str()); if (!address.IsValid()) - throw JSONRPCError(-5, "Invalid Bitcoin address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); int64 nAmount = AmountFromValue(params[2]); int nMinDepth = 1; if (params.size() > 3) @@ -627,12 +627,12 @@ Value sendfrom(const Array& params, bool fHelp) // Check funds int64 nBalance = GetAccountBalance(strAccount, nMinDepth); if (nAmount > nBalance) - throw JSONRPCError(-6, "Account has insufficient funds"); + throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); // Send string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); if (strError != "") - throw JSONRPCError(-4, strError); + throw JSONRPCError(RPC_WALLET_ERROR, strError); return wtx.GetHash().GetHex(); } @@ -665,10 +665,10 @@ Value sendmany(const Array& params, bool fHelp) { CBitcoinAddress address(s.name_); if (!address.IsValid()) - throw JSONRPCError(-5, string("Invalid Bitcoin address: ")+s.name_); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+s.name_); if (setAddress.count(address)) - throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_); + throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_); setAddress.insert(address); CScript scriptPubKey; @@ -684,7 +684,7 @@ Value sendmany(const Array& params, bool fHelp) // Check funds int64 nBalance = GetAccountBalance(strAccount, nMinDepth); if (totalAmount > nBalance) - throw JSONRPCError(-6, "Account has insufficient funds"); + throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); // Send CReserveKey keyChange(pwalletMain); @@ -693,11 +693,11 @@ Value sendmany(const Array& params, bool fHelp) if (!fCreated) { if (totalAmount + nFeeRequired > pwalletMain->GetBalance()) - throw JSONRPCError(-6, "Insufficient funds"); - throw JSONRPCError(-4, "Transaction creation failed"); + throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); + throw JSONRPCError(RPC_WALLET_ERROR, "Transaction creation failed"); } if (!pwalletMain->CommitTransaction(wtx, keyChange)) - throw JSONRPCError(-4, "Transaction commit failed"); + throw JSONRPCError(RPC_WALLET_ERROR, "Transaction commit failed"); return wtx.GetHash().GetHex(); } @@ -1000,9 +1000,9 @@ Value listtransactions(const Array& params, bool fHelp) nFrom = params[2].get_int(); if (nCount < 0) - throw JSONRPCError(-8, "Negative count"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count"); if (nFrom < 0) - throw JSONRPCError(-8, "Negative from"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative from"); Array ret; @@ -1113,7 +1113,7 @@ Value listsinceblock(const Array& params, bool fHelp) target_confirms = params[1].get_int(); if (target_confirms < 1) - throw JSONRPCError(-8, "Invalid parameter"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); } int depth = pindex ? (1 + nBestHeight - pindex->nHeight) : -1; @@ -1165,7 +1165,7 @@ Value gettransaction(const Array& params, bool fHelp) Object entry; if (!pwalletMain->mapWallet.count(hash)) - throw JSONRPCError(-5, "Invalid or non-wallet transaction id"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id"); const CWalletTx& wtx = pwalletMain->mapWallet[hash]; int64 nCredit = wtx.GetCredit(); @@ -1214,7 +1214,7 @@ Value keypoolrefill(const Array& params, bool fHelp) pwalletMain->TopUpKeyPool(); if (pwalletMain->GetKeyPoolSize() < GetArg("-keypool", 100)) - throw JSONRPCError(-4, "Error refreshing keypool."); + throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool."); return Value::null; } @@ -1281,10 +1281,10 @@ Value walletpassphrase(const Array& params, bool fHelp) if (fHelp) return true; if (!pwalletMain->IsCrypted()) - throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletpassphrase was called."); + throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called."); if (!pwalletMain->IsLocked()) - throw JSONRPCError(-17, "Error: Wallet is already unlocked."); + throw JSONRPCError(RPC_WALLET_ALREADY_UNLOCKED, "Error: Wallet is already unlocked."); // Note that the walletpassphrase is stored in params[0] which is not mlock()ed SecureString strWalletPass; @@ -1296,7 +1296,7 @@ Value walletpassphrase(const Array& params, bool fHelp) if (strWalletPass.length() > 0) { if (!pwalletMain->Unlock(strWalletPass)) - throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect."); + throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect."); } else throw runtime_error( @@ -1320,7 +1320,7 @@ Value walletpassphrasechange(const Array& params, bool fHelp) if (fHelp) return true; if (!pwalletMain->IsCrypted()) - throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletpassphrasechange was called."); + throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called."); // TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string) // Alternately, find a way to make params[0] mlock()'d to begin with. @@ -1338,7 +1338,7 @@ Value walletpassphrasechange(const Array& params, bool fHelp) "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>."); if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) - throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect."); + throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect."); return Value::null; } @@ -1355,7 +1355,7 @@ Value walletlock(const Array& params, bool fHelp) if (fHelp) return true; if (!pwalletMain->IsCrypted()) - throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletlock was called."); + throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called."); { LOCK(cs_nWalletUnlockTime); @@ -1376,7 +1376,7 @@ Value encryptwallet(const Array& params, bool fHelp) if (fHelp) return true; if (pwalletMain->IsCrypted()) - throw JSONRPCError(-15, "Error: running with an encrypted wallet, but encryptwallet was called."); + throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called."); // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string) // Alternately, find a way to make params[0] mlock()'d to begin with. @@ -1390,7 +1390,7 @@ Value encryptwallet(const Array& params, bool fHelp) "Encrypts the wallet with <passphrase>."); if (!pwalletMain->EncryptWallet(strWalletPass)) - throw JSONRPCError(-16, "Error: Failed to encrypt the wallet."); + throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: Failed to encrypt the wallet."); // BDB seems to have a bad habit of writing old data into // slack space in .dat files; that is bad if the old data is diff --git a/src/strlcpy.h b/src/strlcpy.h deleted file mode 100644 index 2cc786e953..0000000000 --- a/src/strlcpy.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#ifndef BITCOIN_STRLCPY_H -#define BITCOIN_STRLCPY_H - -#include <stdlib.h> -#include <string.h> - -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -inline size_t strlcpy(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0) - { - while (--n != 0) - { - if ((*d++ = *s++) == '\0') - break; - } - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) - { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz <= strlen(dst)). - * Returns strlen(src) + MIN(siz, strlen(initial dst)). - * If retval >= siz, truncation occurred. - */ -inline size_t strlcat(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') - { - if (n != 1) - { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} -#endif diff --git a/src/util.cpp b/src/util.cpp index 296842acc3..3eb2619e8f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5,10 +5,11 @@ #include "util.h" #include "sync.h" -#include "strlcpy.h" #include "version.h" #include "ui_interface.h" #include <boost/algorithm/string/join.hpp> +#include <boost/algorithm/string/case_conv.hpp> // for to_lower() +#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith() // Work around clang compilation problem in Boost 1.46: // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup @@ -220,8 +221,14 @@ inline int OutputDebugStringF(const char* pszFormat, ...) if (fileout) { static bool fStartedNewLine = true; - static boost::mutex mutexDebugLog; - boost::mutex::scoped_lock scoped_lock(mutexDebugLog); + + // This routine may be called by global destructors during shutdown. + // Since the order of destruction of static/global objects is undefined, + // allocate mutexDebugLog on the heap the first time this routine + // is called to avoid crashes during shutdown. + static boost::mutex* mutexDebugLog = NULL; + if (mutexDebugLog == NULL) mutexDebugLog = new boost::mutex(); + boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); // reopen the log file, if requested if (fReopenDebugLog) { @@ -499,24 +506,24 @@ void ParseParameters(int argc, const char* const argv[]) mapMultiArgs.clear(); for (int i = 1; i < argc; i++) { - char psz[10000]; - strlcpy(psz, argv[i], sizeof(psz)); - char* pszValue = (char*)""; - if (strchr(psz, '=')) + std::string str(argv[i]); + std::string strValue; + size_t is_index = str.find('='); + if (is_index != std::string::npos) { - pszValue = strchr(psz, '='); - *pszValue++ = '\0'; + strValue = str.substr(is_index+1); + str = str.substr(0, is_index); } - #ifdef WIN32 - _strlwr(psz); - if (psz[0] == '/') - psz[0] = '-'; - #endif - if (psz[0] != '-') +#ifdef WIN32 + boost::to_lower(str); + if (boost::algorithm::starts_with(str, "/")) + str = "-" + str.substr(1); +#endif + if (str[0] != '-') break; - mapArgs[psz] = pszValue; - mapMultiArgs[psz].push_back(pszValue); + mapArgs[str] = strValue; + mapMultiArgs[str].push_back(strValue); } // New 0.6 features: diff --git a/src/wallet.cpp b/src/wallet.cpp index f3e71f59aa..1a6a1082b1 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -335,7 +335,9 @@ void CWallet::WalletUpdateSpent(const CTransaction &tx) if (mi != mapWallet.end()) { CWalletTx& wtx = (*mi).second; - if (!wtx.IsSpent(txin.prevout.n) && IsMine(wtx.vout[txin.prevout.n])) + if (txin.prevout.n >= wtx.vout.size()) + printf("WalletUpdateSpent: bad wtx %s\n", wtx.GetHash().ToString().c_str()); + else if (!wtx.IsSpent(txin.prevout.n) && IsMine(wtx.vout[txin.prevout.n])) { printf("WalletUpdateSpent found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str()); wtx.MarkSpent(txin.prevout.n); @@ -1371,12 +1373,12 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64 nVal -int CWallet::LoadWallet(bool& fFirstRunRet) +DBErrors CWallet::LoadWallet(bool& fFirstRunRet) { if (!fFileBacked) return DB_LOAD_OK; fFirstRunRet = false; - int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this); + DBErrors nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this); if (nLoadWalletRet == DB_NEED_REWRITE) { if (CDB::Rewrite(strWalletFile, "\x04pool")) diff --git a/src/wallet.h b/src/wallet.h index 22795b75ba..c5f1243907 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -16,11 +16,11 @@ #include "script.h" #include "ui_interface.h" #include "util.h" +#include "walletdb.h" class CAccountingEntry; class CWalletTx; class CReserveKey; -class CWalletDB; class COutput; /** (client) version numbers for particular wallet features */ @@ -256,7 +256,7 @@ public: } void SetBestChain(const CBlockLocator& loc); - int LoadWallet(bool& fFirstRunRet); + DBErrors LoadWallet(bool& fFirstRunRet); bool SetAddressBookName(const CTxDestination& address, const std::string& strName); diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 0fac0109c8..e102df9720 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -108,7 +108,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin } -int +DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) { LOCK(pwallet->cs_wallet); @@ -181,16 +181,221 @@ CWalletDB::ReorderTransactions(CWallet* pwallet) } -int CWalletDB::LoadWallet(CWallet* pwallet) +bool +ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, + int& nFileVersion, vector<uint256>& vWalletUpgrade, + bool& fIsEncrypted, bool& fAnyUnordered, string& strType, string& strErr) +{ + try { + // Unserialize + // Taking advantage of the fact that pair serialization + // is just the two items serialized one after the other + ssKey >> strType; + if (strType == "name") + { + string strAddress; + ssKey >> strAddress; + ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()]; + } + else if (strType == "tx") + { + uint256 hash; + ssKey >> hash; + CWalletTx& wtx = pwallet->mapWallet[hash]; + ssValue >> wtx; + if (wtx.CheckTransaction() && (wtx.GetHash() == hash)) + wtx.BindWallet(pwallet); + else + { + pwallet->mapWallet.erase(hash); + return false; + } + + // Undo serialize changes in 31600 + if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703) + { + if (!ssValue.empty()) + { + char fTmp; + char fUnused; + ssValue >> fTmp >> fUnused >> wtx.strFromAccount; + strErr = strprintf("LoadWallet() upgrading tx ver=%d %d '%s' %s", + wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount.c_str(), hash.ToString().c_str()); + wtx.fTimeReceivedIsTxTime = fTmp; + } + else + { + strErr = strprintf("LoadWallet() repairing tx ver=%d %s", wtx.fTimeReceivedIsTxTime, hash.ToString().c_str()); + wtx.fTimeReceivedIsTxTime = 0; + } + vWalletUpgrade.push_back(hash); + } + + if (wtx.nOrderPos == -1) + fAnyUnordered = true; + + //// debug print + //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); + //printf(" %12"PRI64d" %s %s %s\n", + // wtx.vout[0].nValue, + // DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()).c_str(), + // wtx.hashBlock.ToString().substr(0,20).c_str(), + // wtx.mapValue["message"].c_str()); + } + else if (strType == "acentry") + { + string strAccount; + ssKey >> strAccount; + uint64 nNumber; + ssKey >> nNumber; + if (nNumber > nAccountingEntryNumber) + nAccountingEntryNumber = nNumber; + + if (!fAnyUnordered) + { + CAccountingEntry acentry; + ssValue >> acentry; + if (acentry.nOrderPos == -1) + fAnyUnordered = true; + } + } + else if (strType == "key" || strType == "wkey") + { + vector<unsigned char> vchPubKey; + ssKey >> vchPubKey; + CKey key; + if (strType == "key") + { + CPrivKey pkey; + ssValue >> pkey; + key.SetPubKey(vchPubKey); + if (!key.SetPrivKey(pkey)) + { + strErr = "Error reading wallet database: CPrivKey corrupt"; + return false; + } + if (key.GetPubKey() != vchPubKey) + { + strErr = "Error reading wallet database: CPrivKey pubkey inconsistency"; + return false; + } + if (!key.IsValid()) + { + strErr = "Error reading wallet database: invalid CPrivKey"; + return false; + } + } + else + { + CWalletKey wkey; + ssValue >> wkey; + key.SetPubKey(vchPubKey); + if (!key.SetPrivKey(wkey.vchPrivKey)) + { + strErr = "Error reading wallet database: CPrivKey corrupt"; + return false; + } + if (key.GetPubKey() != vchPubKey) + { + strErr = "Error reading wallet database: CWalletKey pubkey inconsistency"; + return false; + } + if (!key.IsValid()) + { + strErr = "Error reading wallet database: invalid CWalletKey"; + return false; + } + } + if (!pwallet->LoadKey(key)) + { + strErr = "Error reading wallet database: LoadKey failed"; + return false; + } + } + else if (strType == "mkey") + { + unsigned int nID; + ssKey >> nID; + CMasterKey kMasterKey; + ssValue >> kMasterKey; + if(pwallet->mapMasterKeys.count(nID) != 0) + { + strErr = strprintf("Error reading wallet database: duplicate CMasterKey id %u", nID); + return false; + } + pwallet->mapMasterKeys[nID] = kMasterKey; + if (pwallet->nMasterKeyMaxID < nID) + pwallet->nMasterKeyMaxID = nID; + } + else if (strType == "ckey") + { + vector<unsigned char> vchPubKey; + ssKey >> vchPubKey; + vector<unsigned char> vchPrivKey; + ssValue >> vchPrivKey; + if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) + { + strErr = "Error reading wallet database: LoadCryptedKey failed"; + return false; + } + fIsEncrypted = true; + } + else if (strType == "defaultkey") + { + ssValue >> pwallet->vchDefaultKey; + } + else if (strType == "pool") + { + int64 nIndex; + ssKey >> nIndex; + pwallet->setKeyPool.insert(nIndex); + } + else if (strType == "version") + { + ssValue >> nFileVersion; + if (nFileVersion == 10300) + nFileVersion = 300; + } + else if (strType == "cscript") + { + uint160 hash; + ssKey >> hash; + CScript script; + ssValue >> script; + if (!pwallet->LoadCScript(script)) + { + strErr = "Error reading wallet database: LoadCScript failed"; + return false; + } + } + else if (strType == "orderposnext") + { + ssValue >> pwallet->nOrderPosNext; + } + } catch (...) + { + return false; + } + return true; +} + +static bool IsKeyType(string strType) +{ + return (strType== "key" || strType == "wkey" || + strType == "mkey" || strType == "ckey"); +} + +DBErrors CWalletDB::LoadWallet(CWallet* pwallet) { pwallet->vchDefaultKey = CPubKey(); int nFileVersion = 0; vector<uint256> vWalletUpgrade; bool fIsEncrypted = false; bool fAnyUnordered = false; + bool fNoncriticalErrors = false; + DBErrors result = DB_LOAD_OK; - //// todo: shouldn't we catch exceptions and try to recover and continue? - { + try { LOCK(pwallet->cs_wallet); int nMinVersion = 0; if (Read((string)"minversion", nMinVersion)) @@ -222,189 +427,46 @@ int CWalletDB::LoadWallet(CWallet* pwallet) return DB_CORRUPT; } - // Unserialize - // Taking advantage of the fact that pair serialization - // is just the two items serialized one after the other - string strType; - ssKey >> strType; - if (strType == "name") - { - string strAddress; - ssKey >> strAddress; - ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()]; - } - else if (strType == "tx") - { - uint256 hash; - ssKey >> hash; - CWalletTx& wtx = pwallet->mapWallet[hash]; - ssValue >> wtx; - wtx.BindWallet(pwallet); - - if (wtx.GetHash() != hash) - printf("Error in wallet.dat, hash mismatch\n"); - - // Undo serialize changes in 31600 - if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703) - { - if (!ssValue.empty()) - { - char fTmp; - char fUnused; - ssValue >> fTmp >> fUnused >> wtx.strFromAccount; - printf("LoadWallet() upgrading tx ver=%d %d '%s' %s\n", wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount.c_str(), hash.ToString().c_str()); - wtx.fTimeReceivedIsTxTime = fTmp; - } - else - { - printf("LoadWallet() repairing tx ver=%d %s\n", wtx.fTimeReceivedIsTxTime, hash.ToString().c_str()); - wtx.fTimeReceivedIsTxTime = 0; - } - vWalletUpgrade.push_back(hash); - } - - if (wtx.nOrderPos == -1) - fAnyUnordered = true; - - //// debug print - //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); - //printf(" %12"PRI64d" %s %s %s\n", - // wtx.vout[0].nValue, - // DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()).c_str(), - // wtx.hashBlock.ToString().substr(0,20).c_str(), - // wtx.mapValue["message"].c_str()); - } - else if (strType == "acentry") + // Try to be tolerant of single corrupt records: + string strType, strErr; + if (!ReadKeyValue(pwallet, ssKey, ssValue, nFileVersion, + vWalletUpgrade, fIsEncrypted, fAnyUnordered, strType, strErr)) { - string strAccount; - ssKey >> strAccount; - uint64 nNumber; - ssKey >> nNumber; - if (nNumber > nAccountingEntryNumber) - nAccountingEntryNumber = nNumber; - - if (!fAnyUnordered) - { - CAccountingEntry acentry; - ssValue >> acentry; - if (acentry.nOrderPos == -1) - fAnyUnordered = true; - } - } - else if (strType == "key" || strType == "wkey") - { - vector<unsigned char> vchPubKey; - ssKey >> vchPubKey; - CKey key; - if (strType == "key") - { - CPrivKey pkey; - ssValue >> pkey; - key.SetPubKey(vchPubKey); - key.SetPrivKey(pkey); - if (key.GetPubKey() != vchPubKey) - { - printf("Error reading wallet database: CPrivKey pubkey inconsistency\n"); - return DB_CORRUPT; - } - if (!key.IsValid()) - { - printf("Error reading wallet database: invalid CPrivKey\n"); - return DB_CORRUPT; - } - } + // losing keys is considered a catastrophic error, anything else + // we assume the user can live with: + if (IsKeyType(strType)) + result = DB_CORRUPT; else { - CWalletKey wkey; - ssValue >> wkey; - key.SetPubKey(vchPubKey); - key.SetPrivKey(wkey.vchPrivKey); - if (key.GetPubKey() != vchPubKey) - { - printf("Error reading wallet database: CWalletKey pubkey inconsistency\n"); - return DB_CORRUPT; - } - if (!key.IsValid()) - { - printf("Error reading wallet database: invalid CWalletKey\n"); - return DB_CORRUPT; - } - } - if (!pwallet->LoadKey(key)) - { - printf("Error reading wallet database: LoadKey failed\n"); - return DB_CORRUPT; - } - } - else if (strType == "mkey") - { - unsigned int nID; - ssKey >> nID; - CMasterKey kMasterKey; - ssValue >> kMasterKey; - if(pwallet->mapMasterKeys.count(nID) != 0) - { - printf("Error reading wallet database: duplicate CMasterKey id %u\n", nID); - return DB_CORRUPT; - } - pwallet->mapMasterKeys[nID] = kMasterKey; - if (pwallet->nMasterKeyMaxID < nID) - pwallet->nMasterKeyMaxID = nID; - } - else if (strType == "ckey") - { - vector<unsigned char> vchPubKey; - ssKey >> vchPubKey; - vector<unsigned char> vchPrivKey; - ssValue >> vchPrivKey; - if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) - { - printf("Error reading wallet database: LoadCryptedKey failed\n"); - return DB_CORRUPT; + // Leave other errors alone, if we try to fix them we might make things worse. + fNoncriticalErrors = true; // ... but do warn the user there is something wrong. + if (strType == "tx") + // Rescan if there is a bad transaction record: + SoftSetBoolArg("-rescan", true); } - fIsEncrypted = true; - } - else if (strType == "defaultkey") - { - ssValue >> pwallet->vchDefaultKey; - } - else if (strType == "pool") - { - int64 nIndex; - ssKey >> nIndex; - pwallet->setKeyPool.insert(nIndex); - } - else if (strType == "version") - { - ssValue >> nFileVersion; - if (nFileVersion == 10300) - nFileVersion = 300; - } - else if (strType == "cscript") - { - uint160 hash; - ssKey >> hash; - CScript script; - ssValue >> script; - if (!pwallet->LoadCScript(script)) - { - printf("Error reading wallet database: LoadCScript failed\n"); - return DB_CORRUPT; - } - } - else if (strType == "orderposnext") - { - ssValue >> pwallet->nOrderPosNext; } + if (!strErr.empty()) + printf("%s\n", strErr.c_str()); } pcursor->close(); } + catch (...) + { + result = DB_CORRUPT; + } - BOOST_FOREACH(uint256 hash, vWalletUpgrade) - WriteTx(hash, pwallet->mapWallet[hash]); + if (fNoncriticalErrors && result == DB_LOAD_OK) + result = DB_NONCRITICAL_ERROR; + + // Any wallet corruption at all: skip any rewriting or + // upgrading, we don't want to make it worse. + if (result != DB_LOAD_OK) + return result; printf("nFileVersion = %d\n", nFileVersion); + BOOST_FOREACH(uint256 hash, vWalletUpgrade) + WriteTx(hash, pwallet->mapWallet[hash]); // Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc: if (fIsEncrypted && (nFileVersion == 40000 || nFileVersion == 50000)) @@ -414,10 +476,9 @@ int CWalletDB::LoadWallet(CWallet* pwallet) WriteVersion(CLIENT_VERSION); if (fAnyUnordered) - return ReorderTransactions(pwallet); + result = ReorderTransactions(pwallet); - // If you add anything else here... be sure to do it if ReorderTransactions returns DB_LOAD_OK too! - return DB_LOAD_OK; + return result; } void ThreadFlushWalletDB(void* parg) @@ -521,3 +582,94 @@ bool BackupWallet(const CWallet& wallet, const string& strDest) } return false; } + +// +// Try to (very carefully!) recover wallet.dat if there is a problem. +// +bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) +{ + // Recovery procedure: + // move wallet.dat to wallet.timestamp.bak + // Call Salvage with fAggressive=true to + // get as much data as possible. + // Rewrite salvaged data to wallet.dat + // Set -rescan so any missing transactions will be + // found. + int64 now = GetTime(); + std::string newFilename = strprintf("wallet.%"PRI64d".bak", now); + + int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL, + newFilename.c_str(), DB_AUTO_COMMIT); + if (result == 0) + printf("Renamed %s to %s\n", filename.c_str(), newFilename.c_str()); + else + { + printf("Failed to rename %s to %s\n", filename.c_str(), newFilename.c_str()); + return false; + } + + std::vector<CDBEnv::KeyValPair> salvagedData; + bool allOK = dbenv.Salvage(newFilename, true, salvagedData); + if (salvagedData.empty()) + { + printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str()); + return false; + } + printf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size()); + + bool fSuccess = allOK; + Db* pdbCopy = new Db(&dbenv.dbenv, 0); + int ret = pdbCopy->open(NULL, // Txn pointer + filename.c_str(), // Filename + "main", // Logical db name + DB_BTREE, // Database type + DB_CREATE, // Flags + 0); + if (ret > 0) + { + printf("Cannot create database file %s\n", filename.c_str()); + return false; + } + CWallet dummyWallet; + int nFileVersion = 0; + vector<uint256> vWalletUpgrade; + bool fIsEncrypted = false; + bool fAnyUnordered = false; + + DbTxn* ptxn = dbenv.TxnBegin(); + BOOST_FOREACH(CDBEnv::KeyValPair& row, salvagedData) + { + if (fOnlyKeys) + { + CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); + CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); + string strType, strErr; + bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, + nFileVersion, vWalletUpgrade, + fIsEncrypted, fAnyUnordered, + strType, strErr); + if (!IsKeyType(strType)) + continue; + if (!fReadOK) + { + printf("WARNING: CWalletDB::Recover skipping %s: %s\n", strType.c_str(), strErr.c_str()); + continue; + } + } + Dbt datKey(&row.first[0], row.first.size()); + Dbt datValue(&row.second[0], row.second.size()); + int ret2 = pdbCopy->put(ptxn, &datKey, &datValue, DB_NOOVERWRITE); + if (ret2 > 0) + fSuccess = false; + } + ptxn->commit(0); + pdbCopy->close(0); + delete pdbCopy; + + return fSuccess; +} + +bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename) +{ + return CWalletDB::Recover(dbenv, filename, false); +} diff --git a/src/walletdb.h b/src/walletdb.h index f078481811..a3e779ab9d 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -17,6 +17,7 @@ enum DBErrors { DB_LOAD_OK, DB_CORRUPT, + DB_NONCRITICAL_ERROR, DB_TOO_NEW, DB_LOAD_FAIL, DB_NEED_REWRITE @@ -153,8 +154,10 @@ public: int64 GetAccountCreditDebit(const std::string& strAccount); void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries); - int ReorderTransactions(CWallet*); - int LoadWallet(CWallet* pwallet); + DBErrors ReorderTransactions(CWallet*); + DBErrors LoadWallet(CWallet* pwallet); + static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys); + static bool Recover(CDBEnv& dbenv, std::string filename); }; #endif // BITCOIN_WALLETDB_H |