diff options
81 files changed, 2179 insertions, 1026 deletions
diff --git a/.gitignore b/.gitignore index 2b70e2cca5..95152ce4fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ src/*.exe src/bitcoin src/bitcoind src/test_bitcoin -src/build.h .*.swp *.*~* *.bak diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index cdd3bc2b81..a73a2c379b 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -4,6 +4,7 @@ VERSION = 0.7.0 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE CONFIG += no_include_pwd +CONFIG += thread # for boost 1.37, add -mt to the boost libraries # use: qmake BOOST_LIB_SUFFIX=-mt @@ -30,6 +31,13 @@ contains(RELEASE, 1) { } } +!win32 { +# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection +QMAKE_CXXFLAGS *= -fstack-protector-all --param ssp-buffer-size=1 +QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1 +# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable! +# This can be enabled for Windows, when we switch to MinGW >= 4.4.x. +} # for extra security on Windows: enable ASLR and DEP via GCC linker flags win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat @@ -65,12 +73,6 @@ contains(USE_DBUS, 1) { QT += dbus } -# use: qmake "FIRST_CLASS_MESSAGING=1" -contains(FIRST_CLASS_MESSAGING, 1) { - message(Building with first-class messaging) - DEFINES += FIRST_CLASS_MESSAGING -} - # use: qmake "USE_IPV6=1" ( enabled by default; default) # or: qmake "USE_IPV6=0" (disabled by default) # or: qmake "USE_IPV6=-" (not supported) @@ -88,12 +90,6 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets } -!windows { - # for extra security against potential buffer overflows - QMAKE_CXXFLAGS += -fstack-protector - QMAKE_LFLAGS += -fstack-protector - # do not enable this on windows cross compile with mingw 4.2.x, as it will result in a non-working executable! -} # regenerate src/build.h !windows|contains(USE_BUILD_INFO, 1) { @@ -105,7 +101,7 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { DEFINES += HAVE_BUILD_INFO } -QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter +QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector # Input DEPENDPATH += src src/json src/qt @@ -341,7 +337,7 @@ windows:!contains(MINGW_THREAD_BUGFIX, 0) { QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY } -!windows:!mac { +!windows:!macx { DEFINES += LINUX LIBS += -lrt } @@ -352,6 +348,9 @@ macx:LIBS += -framework Foundation -framework ApplicationServices -framework App macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 macx:ICON = src/qt/res/icons/bitcoin.icns macx:TARGET = "Bitcoin-Qt" +macx:QMAKE_CFLAGS_THREAD += -pthread +macx:QMAKE_LFLAGS_THREAD += -pthread +macx:QMAKE_CXXFLAGS_THREAD += -pthread # Set libraries and includes at end, to use platform-defined defaults if not overridden INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH diff --git a/contrib/gitian-descriptors/README b/contrib/gitian-descriptors/README index 66a0509ac6..1d3910b994 100644 --- a/contrib/gitian-descriptors/README +++ b/contrib/gitian-descriptors/README @@ -27,11 +27,11 @@ Once you've got the right hardware and software: wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2' # Inputs for Win32: (Linux has packages for these) wget 'https://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2' - wget 'http://www.openssl.org/source/openssl-1.0.1b.tar.gz' + wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' wget 'https://downloads.sourceforge.net/project/libpng/zlib/1.2.6/zlib-1.2.6.tar.gz' wget 'https://downloads.sourceforge.net/project/libpng/libpng15/older-releases/1.5.9/libpng-1.5.9.tar.gz' - wget 'ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz' + wget 'http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.tar.gz' cd ../.. cd gitian-builder diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml index df1e3de358..106bd06a9b 100644 --- a/contrib/gitian-descriptors/deps-win32.yml +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -4,7 +4,7 @@ suites: - "lucid" architectures: - "i386" -packages: +packages: - "mingw32" - "git-core" - "zip" @@ -13,7 +13,7 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "openssl-1.0.1b.tar.gz" +- "openssl-1.0.1c.tar.gz" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.6.tar.gz" - "zlib-1.2.6.tar.gz" @@ -25,8 +25,8 @@ script: | export FAKETIME=$REFERENCE_DATETIME export TZ=UTC # - tar xzf openssl-1.0.1b.tar.gz - cd openssl-1.0.1b + tar xzf openssl-1.0.1c.tar.gz + cd openssl-1.0.1c ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw make cd .. @@ -62,7 +62,7 @@ script: | make $MAKEOPTS cd .. # - zip -r $OUTDIR/bitcoin-deps-0.0.4.zip \ + zip -r $OUTDIR/bitcoin-deps-0.0.5.zip \ $(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ $(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \ $(find openssl-* -name '*.a' -o -name '*.h' | sort) \ diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index 7948bbe45d..c5979614d3 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -4,7 +4,7 @@ suites: - "lucid" architectures: - "i386" -packages: +packages: - "mingw32" - "git-core" - "unzip" @@ -15,14 +15,14 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "qt-win32-4.7.4-gitian-r1.zip" +- "qt-win32-4.8.2-gitian-r1.zip" - "boost-win32-1.50.0-gitian2.zip" -- "bitcoin-deps-0.0.4.zip" +- "bitcoin-deps-0.0.5.zip" script: | # mkdir $HOME/qt cd $HOME/qt - unzip ../build/qt-win32-4.7.4-gitian-r1.zip + unzip ../build/qt-win32-4.8.2-gitian-r1.zip cd $HOME/build/ export PATH=$PATH:$HOME/qt/bin/ # @@ -39,7 +39,7 @@ script: | mv include/boost . cd .. # - unzip bitcoin-deps-0.0.4.zip + unzip bitcoin-deps-0.0.5.zip # find -type f | xargs touch --date="$REFERENCE_DATETIME" # @@ -51,7 +51,7 @@ script: | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 + $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1c OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1c/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 make $MAKEOPTS cp release/bitcoin-qt.exe $OUTDIR/ # diff --git a/contrib/gitian-descriptors/qt-win32.yml b/contrib/gitian-descriptors/qt-win32.yml index fa3a84b321..87887dec87 100644 --- a/contrib/gitian-descriptors/qt-win32.yml +++ b/contrib/gitian-descriptors/qt-win32.yml @@ -11,15 +11,15 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "qt-everywhere-opensource-src-4.7.4.tar.gz" +- "qt-everywhere-opensource-src-4.8.2.tar.gz" script: | INSTDIR="$HOME/qt/" mkdir $INSTDIR SRCDIR="$INSTDIR/src/" mkdir $SRCDIR # - tar xzf qt-everywhere-opensource-src-4.7.4.tar.gz - cd qt-everywhere-opensource-src-4.7.4 + tar xzf qt-everywhere-opensource-src-4.8.2.tar.gz + cd qt-everywhere-opensource-src-4.8.2 sed 's/$TODAY/2011-01-30/' -i configure sed 's/i686-pc-mingw32-/i586-mingw32msvc-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i586-mingw32msvc/include/ -frandom-seed=qtbuild|' -i mkspecs/unsupported/win32-g++-cross/qmake.conf @@ -51,4 +51,4 @@ script: | # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - zip -r $OUTDIR/qt-win32-4.7.4-gitian-r1.zip * + zip -r $OUTDIR/qt-win32-4.8.2-gitian-r1.zip * diff --git a/contrib/testgen/README b/contrib/testgen/README new file mode 100644 index 0000000000..02d6c4cdc2 --- /dev/null +++ b/contrib/testgen/README @@ -0,0 +1 @@ +Utilities to generate test vectors for the data-driven Bitcoin tests diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py new file mode 100644 index 0000000000..b716495145 --- /dev/null +++ b/contrib/testgen/base58.py @@ -0,0 +1,104 @@ +''' +Bitcoin base58 encoding and decoding. + +Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) +''' +import hashlib + +# for compatibility with following code... +class SHA256: + new = hashlib.sha256 + +if str != bytes: + # Python 3.x + def ord(c): + return c + def chr(n): + return bytes( (n,) ) + +__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +__b58base = len(__b58chars) +b58chars = __b58chars + +def b58encode(v): + """ encode v, which is a string of bytes, to base58. + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += (256**i) * ord(c) + + result = '' + while long_value >= __b58base: + div, mod = divmod(long_value, __b58base) + result = __b58chars[mod] + result + long_value = div + result = __b58chars[long_value] + result + + # Bitcoin does a little leading-zero-compression: + # leading 0-bytes in the input become leading-1s + nPad = 0 + for c in v: + if c == '\0': nPad += 1 + else: break + + return (__b58chars[0]*nPad) + result + +def b58decode(v, length = None): + """ decode v into a string of len bytes + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += __b58chars.find(c) * (__b58base**i) + + result = bytes() + while long_value >= 256: + div, mod = divmod(long_value, 256) + result = chr(mod) + result + long_value = div + result = chr(long_value) + result + + nPad = 0 + for c in v: + if c == __b58chars[0]: nPad += 1 + else: break + + result = chr(0)*nPad + result + if length is not None and len(result) != length: + return None + + return result + +def checksum(v): + """Return 32-bit checksum based on SHA256""" + return SHA256.new(SHA256.new(v).digest()).digest()[0:4] + +def b58encode_chk(v): + """b58encode a string, with 32-bit checksum""" + return b58encode(v + checksum(v)) + +def b58decode_chk(v): + """decode a base58 string, check and remove checksum""" + result = b58decode(v) + if result is None: + return None + h3 = checksum(result[:-4]) + if result[-4:] == checksum(result[:-4]): + return result[:-4] + else: + return None + +def get_bcaddress_version(strAddress): + """ Returns None if strAddress is invalid. Otherwise returns integer version of address. """ + addr = b58decode_chk(strAddress) + if addr is None or len(addr)!=21: return None + version = addr[0] + return ord(version) + +if __name__ == '__main__': + # Test case (from http://gitorious.org/bitcoin/python-base58.git) + assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0 + _ohai = 'o hai'.encode('ascii') + _tmp = b58encode(_ohai) + assert _tmp == 'DYB3oMS' + assert b58decode(_tmp, 5) == _ohai + print("Tests passed") diff --git a/contrib/testgen/gen_base58_test_vectors.py b/contrib/testgen/gen_base58_test_vectors.py new file mode 100755 index 0000000000..1813436953 --- /dev/null +++ b/contrib/testgen/gen_base58_test_vectors.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +''' +Generate valid and invalid base58 address and private key test vectors. + +Usage: + gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json + gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json +''' +# 2012 Wladimir J. van der Laan +# Released under MIT License +import os +from itertools import islice +from base58 import b58encode, b58decode, b58encode_chk, b58decode_chk, b58chars +import random +from binascii import b2a_hex + +# key types +PUBKEY_ADDRESS = 0 +SCRIPT_ADDRESS = 5 +PUBKEY_ADDRESS_TEST = 111 +SCRIPT_ADDRESS_TEST = 196 +PRIVKEY = 128 +PRIVKEY_TEST = 239 + +metadata_keys = ['isPrivkey', 'isTestnet', 'addrType', 'isCompressed'] +# templates for valid sequences +templates = [ + # prefix, payload_size, suffix, metadata + # None = N/A + ((PUBKEY_ADDRESS,), 20, (), (False, False, 'pubkey', None)), + ((SCRIPT_ADDRESS,), 20, (), (False, False, 'script', None)), + ((PUBKEY_ADDRESS_TEST,), 20, (), (False, True, 'pubkey', None)), + ((SCRIPT_ADDRESS_TEST,), 20, (), (False, True, 'script', None)), + ((PRIVKEY,), 32, (), (True, False, None, False)), + ((PRIVKEY,), 32, (1,), (True, False, None, True)), + ((PRIVKEY_TEST,), 32, (), (True, True, None, False)), + ((PRIVKEY_TEST,), 32, (1,), (True, True, None, True)) +] + +def is_valid(v): + '''Check vector v for validity''' + result = b58decode_chk(v) + if result is None: + return False + valid = False + for template in templates: + prefix = str(bytearray(template[0])) + suffix = str(bytearray(template[2])) + if result.startswith(prefix) and result.endswith(suffix): + if (len(result) - len(prefix) - len(suffix)) == template[1]: + return True + return False + +def gen_valid_vectors(): + '''Generate valid test vectors''' + while True: + for template in templates: + prefix = str(bytearray(template[0])) + payload = os.urandom(template[1]) + suffix = str(bytearray(template[2])) + rv = b58encode_chk(prefix + payload + suffix) + assert is_valid(rv) + metadata = dict([(x,y) for (x,y) in zip(metadata_keys,template[3]) if y is not None]) + yield (rv, b2a_hex(payload), metadata) + +def gen_invalid_vector(template, corrupt_prefix, randomize_payload_size, corrupt_suffix): + '''Generate possibly invalid vector''' + if corrupt_prefix: + prefix = os.urandom(1) + else: + prefix = str(bytearray(template[0])) + + if randomize_payload_size: + payload = os.urandom(max(int(random.expovariate(0.5)), 50)) + else: + payload = os.urandom(template[1]) + + if corrupt_suffix: + suffix = os.urandom(len(template[2])) + else: + suffix = str(bytearray(template[2])) + + return b58encode_chk(prefix + payload + suffix) + +def randbool(p = 0.5): + '''Return True with P(p)''' + return random.random() < p + +def gen_invalid_vectors(): + '''Generate invalid test vectors''' + # start with some manual edge-cases + yield "", + yield "x", + while True: + # kinds of invalid vectors: + # invalid prefix + # invalid payload length + # invalid (randomized) suffix (add random data) + # corrupt checksum + for template in templates: + val = gen_invalid_vector(template, randbool(0.2), randbool(0.2), randbool(0.2)) + if random.randint(0,10)<1: # line corruption + if randbool(): # add random character to end + val += random.choice(b58chars) + else: # replace random character in the middle + n = random.randint(0, len(val)) + val = val[0:n] + random.choice(b58chars) + val[n+1:] + if not is_valid(val): + yield val, + +if __name__ == '__main__': + import sys, json + iters = {'valid':gen_valid_vectors, 'invalid':gen_invalid_vectors} + try: + uiter = iters[sys.argv[1]] + except IndexError: + uiter = gen_valid_vectors + try: + count = int(sys.argv[2]) + except IndexError: + count = 0 + + data = list(islice(uiter(), count)) + json.dump(data, sys.stdout, sort_keys=True, indent=4) + sys.stdout.write('\n') + diff --git a/doc/build-msw.txt b/doc/build-msw.txt index c887a7be8c..3e64813b38 100644 --- a/doc/build-msw.txt +++ b/doc/build-msw.txt @@ -24,9 +24,9 @@ Dependencies Libraries you need to download separately and build: default path download -OpenSSL \openssl-1.0.1b-mgw http://www.openssl.org/source/ +OpenSSL \openssl-1.0.1c-mgw http://www.openssl.org/source/ Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html -Boost \boost-1.47.0-mgw http://www.boost.org/users/download/ +Boost \boost-1.50.0-mgw http://www.boost.org/users/download/ miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/ Their licenses: @@ -36,9 +36,9 @@ Boost MIT-like license miniupnpc New (3-clause) BSD license Versions used in this release: -OpenSSL 1.0.1b +OpenSSL 1.0.1c Berkeley DB 4.8.30.NC -Boost 1.47.0 +Boost 1.50.0 miniupnpc 1.6 @@ -48,7 +48,7 @@ MSYS shell: un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377) change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe' -cd /c/openssl-1.0.1b-mgw +cd /c/openssl-1.0.1c-mgw ./config make @@ -63,7 +63,7 @@ Boost ----- DOS prompt: downloaded boost jam 3.1.18 -cd \boost-1.47.0-mgw +cd \boost-1.50.0-mgw bjam toolset=gcc --build-type=complete stage MiniUPnPc diff --git a/doc/build-unix.txt b/doc/build-unix.txt index b02a20a760..2e0b53cf77 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -47,7 +47,7 @@ Licenses of statically linked libraries: Versions used in this release: GCC 4.3.3 - OpenSSL 0.9.8g + OpenSSL 1.0.1c Berkeley DB 4.8.30.NC Boost 1.37 miniupnpc 1.6 @@ -55,7 +55,7 @@ Versions used in this release: Dependency Build Instructions: Ubuntu & Debian ---------------------------------------------- Build requirements: - sudo apt-get install build-essential + sudo apt-get install build-essential sudo apt-get install libssl-dev for Ubuntu 12.04: @@ -68,7 +68,7 @@ for Ubuntu 12.04: but using these will break binary wallet compatibility, and is not recommended. for other Ubuntu & Debian: - sudo apt-get install libdb4.8-dev + sudo apt-get install libdb4.8-dev sudo apt-get install libdb4.8++-dev sudo apt-get install libboost1.37-dev (If using Boost 1.37, append -mt to the boost libraries in the makefile) diff --git a/doc/readme-qt.rst b/doc/readme-qt.rst index 951e86f9cb..f6adbd8fdd 100644 --- a/doc/readme-qt.rst +++ b/doc/readme-qt.rst @@ -27,7 +27,7 @@ Alternatively, install `Qt Creator`_ and open the `bitcoin-qt.pro` file. An executable named `bitcoin-qt` will be built. -.. _`Qt Creator`: http://qt.nokia.com/downloads/ +.. _`Qt Creator`: http://qt-project.org/downloads/ Windows -------- @@ -42,7 +42,7 @@ Windows build instructions: - Open the bitcoin-qt.pro file in Qt Creator and build as normal (ctrl-B) -.. _`Qt Windows SDK`: http://qt.nokia.com/downloads/sdk-windows-cpp +.. _`Qt Windows SDK`: http://qt-project.org/downloads/ .. _`dependencies archive`: https://download.visucore.com/bitcoin/qtgui_deps_1.zip .. [#] PGP signature: https://download.visucore.com/bitcoin/qtgui_deps_1.zip.sig (signed with RSA key ID `610945D0`_) .. _`610945D0`: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x610945D0 @@ -64,7 +64,7 @@ Mac OS X - Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd-B) -.. _`Qt Mac OS X SDK`: http://qt.nokia.com/downloads/sdk-mac-os-cpp +.. _`Qt Mac OS X SDK`: http://qt-project.org/downloads/ .. _`MacPorts`: http://www.macports.org/install.php @@ -108,8 +108,8 @@ FreeDesktop notification interface through DBUS using the following qmake option Generation of QR codes ----------------------- -libqrencode may be used to generate QRCode images for payment requests. -It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE +libqrencode may be used to generate QRCode images for payment requests. +It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE flag to qmake to control this: +--------------+--------------------------------------------------------------------------+ diff --git a/doc/release-process.txt b/doc/release-process.txt index 8443961d27..075fb01db7 100644 --- a/doc/release-process.txt +++ b/doc/release-process.txt @@ -24,20 +24,20 @@ * Fetch and build inputs: (first time, or when dependency versions change) mkdir -p inputs; cd inputs/ wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.tar.gz' -O miniupnpc-1.6.tar.gz - wget 'http://www.openssl.org/source/openssl-1.0.1b.tar.gz' + wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' wget 'http://zlib.net/zlib-1.2.6.tar.gz' wget 'ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.9.tar.gz' wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2' wget 'http://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2' - wget 'http://download.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz' + wget 'http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.tar.gz' cd .. ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml mv build/out/boost-win32-1.50.0-gitian2.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/qt-win32.yml - mv build/out/qt-win32-4.7.4-gitian.zip inputs/ + mv build/out/qt-win32-4.8.2-gitian-r1.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml - mv build/out/bitcoin-deps-0.0.3.zip inputs/ + mv build/out/bitcoin-deps-0.0.5.zip inputs/ * Build bitcoind and bitcoin-qt on Linux32, Linux64, and Win32: ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian.yml 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 4e48718a49..f799987ed9 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -101,7 +101,7 @@ Section -post SEC0001 WriteRegStr HKCR "bitcoin" "URL Protocol" ""
WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
- WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "$$1"'
+ WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "%1"'
SectionEnd
# Macro for selecting uninstaller sections
diff --git a/src/bignum.h b/src/bignum.h index 9fea3f70fb..96b1b2e6ae 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -305,7 +305,7 @@ public: psz++; // hex string to bignum - static signed char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; + static const signed char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; *this = 0; while (isxdigit(*psz)) { diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 1a3f51ea4d..0704173e54 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -9,6 +9,7 @@ #include "ui_interface.h" #include "base58.h" #include "bitcoinrpc.h" +#include "db.h" #undef printf #include <boost/asio.hpp> @@ -40,6 +41,11 @@ const Object emptyobj; void ThreadRPCServer3(void* parg); +static inline unsigned short GetDefaultRPCPort() +{ + return GetBoolArg("-testnet", false) ? 18332 : 8332; +} + Object JSONRPCError(int code, const string& message) { Object error; @@ -63,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++; } @@ -77,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); } } } @@ -92,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; } @@ -173,11 +179,14 @@ Value help(const Array& params, bool fHelp) Value stop(const Array& params, bool fHelp) { - if (fHelp || params.size() != 0) + if (fHelp || params.size() > 1) throw runtime_error( - "stop\n" - "Stop Bitcoin server."); + "stop <detach>\n" + "<detach> is true or false to detach the database or not for this stop only\n" + "Stop Bitcoin server (and possibly override the detachdb config value)."); // Shutdown will take long enough that the response should get back + if (params.size() > 0) + bitdb.SetDetach(params[0].get_bool()); StartShutdown(); return "Bitcoin server stopping"; } @@ -308,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" @@ -326,17 +335,17 @@ 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" "Date: %s\r\n" "Connection: %s\r\n" - "Content-Length: %d\r\n" + "Content-Length: %"PRIszu"\r\n" "Content-Type: application/json\r\n" "Server: bitcoin-json-rpc/%s\r\n" "\r\n" @@ -357,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) @@ -402,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) @@ -475,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; } @@ -608,8 +617,6 @@ private: void ThreadRPCServer(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadRPCServer(parg)); - // Make this thread recognisable as the RPC listener RenameThread("bitcoin-rpclist"); @@ -692,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; } @@ -760,7 +767,7 @@ void ThreadRPCServer2(void* parg) // Try a dual IPv6/IPv4 socket, falling back to separate IPv4 and IPv6 sockets const bool loopback = !mapArgs.count("-rpcallowip"); asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any(); - ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 8332)); + ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", GetDefaultRPCPort())); boost::system::error_code v6_only_error; boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(io_service)); @@ -816,7 +823,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 IPv4: %s"), endpoint.port(), e.what()); + strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv4: %s"), endpoint.port(), e.what()); } if (!fListening) { @@ -847,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 @@ -856,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()); @@ -870,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) @@ -891,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; @@ -910,8 +917,6 @@ static CCriticalSection cs_THREAD_RPCHANDLER; void ThreadRPCServer3(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadRPCServer3(parg)); - // Make this thread recognisable as the RPC handler RenameThread("bitcoin-rpchand"); @@ -941,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)) @@ -953,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") @@ -965,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; @@ -982,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) { @@ -993,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; } } @@ -1010,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 { @@ -1034,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()); } } @@ -1055,7 +1060,7 @@ Object CallRPC(const string& strMethod, const Array& params) asio::ssl::stream<asio::ip::tcp::socket> sslStream(io_service, context); SSLIOStreamDevice<asio::ip::tcp> d(sslStream, fUseSSL); iostreams::stream< SSLIOStreamDevice<asio::ip::tcp> > stream(d); - if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", "8332"))) + if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(GetDefaultRPCPort())))) throw runtime_error("couldn't connect to server"); // HTTP basic authentication @@ -1072,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"); @@ -1126,6 +1131,7 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri // // Special case non-string parameter types // + if (strMethod == "stop" && n > 0) ConvertTo<bool>(params[0]); if (strMethod == "setgenerate" && n > 0) ConvertTo<bool>(params[0]); if (strMethod == "setgenerate" && n > 1) ConvertTo<boost::int64_t>(params[1]); if (strMethod == "sendtoaddress" && n > 1) ConvertTo<double>(params[1]); 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/db.cpp b/src/db.cpp index 867703fbd2..7ca9e34953 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; @@ -191,7 +186,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : nFlags, // Flags 0); - if (ret > 0) + if (ret != 0) { delete pdb; pdb = NULL; diff --git a/src/init.cpp b/src/init.cpp index df3a0f1fd5..b910c2dd76 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -145,7 +145,7 @@ bool AppInit(int argc, char* argv[]) strUsage += "\n" + HelpMessage(); - fprintf(stderr, "%s", strUsage.c_str()); + fprintf(stdout, "%s", strUsage.c_str()); return false; } @@ -273,7 +273,7 @@ std::string HelpMessage() #endif " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n" + " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" + - " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 8332)") + "\n" + + " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)") + "\n" + " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" + " -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" + " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + @@ -440,8 +440,9 @@ bool AppInit2() 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()); + const char* pszDataDir = GetDataDir().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) @@ -475,7 +476,7 @@ bool AppInit2() if (!fLogTimestamps) printf("Startup time: %s\n", DateTimeStrFormat("%x %H:%M:%S", nTimeNodeStart).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) @@ -591,6 +592,14 @@ bool AppInit2() // ********************************************************* Step 6: 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")) { CTxDB txdb("r"); @@ -603,7 +612,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. @@ -725,7 +734,8 @@ bool AppInit2() if (mapArgs.count("-loadblock")) { - uiInterface.InitMessage(_("Importing blocks...")); + uiInterface.InitMessage(_("Importing blockchain data file.")); + BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"]) { FILE *file = fopen(strFile.c_str(), "rb"); @@ -734,6 +744,18 @@ bool AppInit2() } } + filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; + if (filesystem::exists(pathBootstrap)) { + uiInterface.InitMessage(_("Importing bootstrap blockchain data file.")); + + FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); + if (file) { + filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; + LoadExternalBlockFile(file); + RenameOver(pathBootstrap, pathBootstrapOld); + } + } + // ********************************************************* Step 9: load peers uiInterface.InitMessage(_("Loading addresses...")); @@ -757,11 +779,11 @@ bool AppInit2() RandAddSeedPerfmon(); //// debug print - printf("mapBlockIndex.size() = %d\n", mapBlockIndex.size()); + printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size()); printf("nBestHeight = %d\n", nBestHeight); - printf("setKeyPool.size() = %d\n", pwalletMain->setKeyPool.size()); - printf("mapWallet.size() = %d\n", pwalletMain->mapWallet.size()); - printf("mapAddressBook.size() = %d\n", pwalletMain->mapAddressBook.size()); + printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain->setKeyPool.size()); + printf("mapWallet.size() = %"PRIszu"\n", pwalletMain->mapWallet.size()); + printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain->mapAddressBook.size()); if (!NewThread(StartNode, NULL)) InitError(_("Error: could not start node")); diff --git a/src/irc.cpp b/src/irc.cpp index 6991e6ee7e..ec7eea3cf4 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -188,8 +188,6 @@ bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet) void ThreadIRCSeed(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg)); - // Make this thread recognisable as the IRC seeding thread RenameThread("bitcoin-ircseed"); @@ -262,7 +260,7 @@ void ThreadIRCSeed2(void* parg) if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3) strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); if (strMyName == "") - strMyName = strprintf("x%u", GetRand(1000000000)); + strMyName = strprintf("x%"PRI64u"", GetRand(1000000000)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str()); diff --git a/src/main.cpp b/src/main.cpp index d1f84a12e0..0e22a4c36c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,7 +181,7 @@ bool AddOrphanTx(const CDataStream& vMsg) // at most 500 megabytes of orphans: if (pvMsg->size() > 5000) { - printf("ignoring large orphan tx (size: %u, hash: %s)\n", pvMsg->size(), hash.ToString().substr(0,10).c_str()); + printf("ignoring large orphan tx (size: %"PRIszu", hash: %s)\n", pvMsg->size(), hash.ToString().substr(0,10).c_str()); delete pvMsg; return false; } @@ -190,7 +190,7 @@ bool AddOrphanTx(const CDataStream& vMsg) BOOST_FOREACH(const CTxIn& txin, tx.vin) mapOrphanTransactionsByPrev[txin.prevout.hash].insert(make_pair(hash, pvMsg)); - printf("stored orphan tx %s (mapsz %u)\n", hash.ToString().substr(0,10).c_str(), + printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().substr(0,10).c_str(), mapOrphanTransactions.size()); return true; } @@ -667,7 +667,7 @@ bool CTxMemPool::accept(CTxDB& txdb, CTransaction &tx, bool fCheckInputs, if (ptxOld) EraseFromWallets(ptxOld->GetHash()); - printf("CTxMemPool::accept() : accepted %s (poolsz %u)\n", + printf("CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n", hash.ToString().substr(0,10).c_str(), mapTx.size()); return true; @@ -1187,7 +1187,7 @@ bool CTransaction::FetchInputs(CTxDB& txdb, const map<uint256, CTxIndex>& mapTes // Revisit this if/when transaction replacement is implemented and allows // adding inputs: fInvalid = true; - return DoS(100, error("FetchInputs() : %s prevout.n out of range %d %d %d prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str())); + return DoS(100, error("FetchInputs() : %s prevout.n out of range %d %"PRIszu" %"PRIszu" prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str())); } } @@ -1256,7 +1256,7 @@ bool CTransaction::ConnectInputs(MapPrevTx inputs, CTransaction& txPrev = inputs[prevout.hash].second; if (prevout.n >= txPrev.vout.size() || prevout.n >= txindex.vSpent.size()) - return DoS(100, error("ConnectInputs() : %s prevout.n out of range %d %d %d prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str())); + return DoS(100, error("ConnectInputs() : %s prevout.n out of range %d %"PRIszu" %"PRIszu" prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str())); // If prev is coinbase, check that it's matured if (txPrev.IsCoinBase()) @@ -1541,8 +1541,8 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) vConnect.push_back(pindex); reverse(vConnect.begin(), vConnect.end()); - printf("REORGANIZE: Disconnect %i blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str()); - printf("REORGANIZE: Connect %i blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str()); + printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str()); + printf("REORGANIZE: Connect %"PRIszu" blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str()); // Disconnect shorter branch vector<CTransaction> vResurrect; @@ -1670,7 +1670,7 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew) } if (!vpindexSecondary.empty()) - printf("Postponing %i reconnects\n", vpindexSecondary.size()); + printf("Postponing %"PRIszu" reconnects\n", vpindexSecondary.size()); // Switch to new best branch if (!Reorganize(txdb, pindexIntermediate)) @@ -2218,7 +2218,7 @@ void PrintBlockTree() // print item CBlock block; block.ReadFromDisk(pindex); - printf("%d (%u,%u) %s %s tx %d", + printf("%d (%u,%u) %s %s tx %"PRIszu"", pindex->nHeight, pindex->nFile, pindex->nBlockPos, @@ -2424,7 +2424,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) static map<CService, CPubKey> mapReuseKey; RandAddSeedPerfmon(); if (fDebug) - printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size()); + printf("received: %s (%"PRIszu" bytes)\n", strCommand.c_str(), vRecv.size()); if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) { printf("dropmessagestest DROPPING RECV MESSAGE\n"); @@ -2575,7 +2575,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vAddr.size() > 1000) { pfrom->Misbehaving(20); - return error("message addr size() = %d", vAddr.size()); + return error("message addr size() = %"PRIszu"", vAddr.size()); } // Store the new addresses @@ -2638,7 +2638,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vInv.size() > MAX_INV_SZ) { pfrom->Misbehaving(20); - return error("message inv size() = %d", vInv.size()); + return error("message inv size() = %"PRIszu"", vInv.size()); } // find last block in inv vector @@ -2688,11 +2688,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vInv.size() > MAX_INV_SZ) { pfrom->Misbehaving(20); - return error("message getdata size() = %d", vInv.size()); + return error("message getdata size() = %"PRIszu"", vInv.size()); } if (fDebugNet || (vInv.size() != 1)) - printf("received getdata (%d invsz)\n", vInv.size()); + printf("received getdata (%"PRIszu" invsz)\n", vInv.size()); BOOST_FOREACH(const CInv& inv, vInv) { @@ -3086,7 +3086,7 @@ bool ProcessMessages(CNode* pfrom) break; } if (pstart - vRecv.begin() > 0) - printf("\n\nPROCESSMESSAGE SKIPPED %d BYTES\n\n", pstart - vRecv.begin()); + printf("\n\nPROCESSMESSAGE SKIPPED %"PRIpdd" BYTES\n\n", pstart - vRecv.begin()); vRecv.erase(vRecv.begin(), pstart); // Read header @@ -3695,7 +3695,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) nLastBlockTx = nBlockTx; nLastBlockSize = nBlockSize; - printf("CreateNewBlock(): total size %lu\n", nBlockSize); + printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize); pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); @@ -3861,7 +3861,7 @@ void static BitcoinMiner(CWallet *pwallet) return; IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce); - printf("Running BitcoinMiner with %d transactions in block (%u bytes)\n", pblock->vtx.size(), + printf("Running BitcoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(), ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); diff --git a/src/main.h b/src/main.h index 2e208fed4f..68302b85ac 100644 --- a/src/main.h +++ b/src/main.h @@ -158,7 +158,7 @@ public: if (IsNull()) return "null"; else - return strprintf("(nFile=%d, nBlockPos=%d, nTxPos=%d)", nFile, nBlockPos, nTxPos); + return strprintf("(nFile=%u, nBlockPos=%u, nTxPos=%u)", nFile, nBlockPos, nTxPos); } void print() const @@ -214,7 +214,7 @@ public: std::string ToString() const { - return strprintf("COutPoint(%s, %d)", hash.ToString().substr(0,10).c_str(), n); + return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10).c_str(), n); } void print() const @@ -586,7 +586,7 @@ public: std::string ToString() const { std::string str; - str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%d, vout.size=%d, nLockTime=%d)\n", + str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n", GetHash().ToString().substr(0,10).c_str(), nVersion, vin.size(), @@ -952,7 +952,7 @@ public: void print() const { - printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%d)\n", + printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n", GetHash().ToString().substr(0,20).c_str(), nVersion, hashPrevBlock.ToString().substr(0,20).c_str(), @@ -1128,7 +1128,7 @@ public: std::string ToString() const { - return strprintf("CBlockIndex(pprev=%08x, pnext=%08x, nFile=%d, nBlockPos=%-6d nHeight=%d, merkle=%s, hashBlock=%s)", + return strprintf("CBlockIndex(pprev=%p, pnext=%p, nFile=%u, nBlockPos=%-6u nHeight=%d, merkle=%s, hashBlock=%s)", pprev, pnext, nFile, nBlockPos, nHeight, hashMerkleRoot.ToString().substr(0,10).c_str(), GetBlockHash().ToString().substr(0,20).c_str()); diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index 4ba0cf06f0..0970469a98 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -12,13 +12,13 @@ INCLUDEPATHS= \ -I"$(CURDIR)"/obj \ -I"$(DEPSDIR)/boost_1_50_0" \ -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -I"$(DEPSDIR)/openssl-1.0.1b/include" \ + -I"$(DEPSDIR)/openssl-1.0.1c/include" \ -I"$(DEPSDIR)" LIBPATHS= \ -L"$(DEPSDIR)/boost_1_50_0/stage/lib" \ -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -L"$(DEPSDIR)/openssl-1.0.1b" + -L"$(DEPSDIR)/openssl-1.0.1c" LIBS= \ -l boost_system-mt-s \ @@ -111,6 +111,6 @@ clean: -rm -f bitcoind.exe -rm -f obj-test/*.o -rm -f test_bitcoin.exe - -rm -f src/build.h + -rm -f obj/build.h FORCE: diff --git a/src/makefile.mingw b/src/makefile.mingw index 9bbd739365..54054c25f9 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -8,12 +8,12 @@ USE_IPV6:=1 INCLUDEPATHS= \ -I"C:\boost-1.50.0-mgw" \ -I"C:\db-4.8.30.NC-mgw\build_unix" \ - -I"C:\openssl-1.0.1b-mgw\include" + -I"C:\openssl-1.0.1c-mgw\include" LIBPATHS= \ -L"C:\boost-1.50.0-mgw\stage\lib" \ -L"C:\db-4.8.30.NC-mgw\build_unix" \ - -L"C:\openssl-1.0.1b-mgw" + -L"C:\openssl-1.0.1c-mgw" LIBS= \ -l boost_system-mgw45-mt-s-1_50 \ @@ -104,6 +104,5 @@ clean: -del /Q bitcoind test_bitcoin -del /Q obj\* -del /Q obj-test\* - -del /Q build.h FORCE: diff --git a/src/makefile.osx b/src/makefile.osx index 547f751aba..359739bd5e 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -156,6 +156,6 @@ clean: -rm -f obj-test/*.o -rm -f obj/*.P -rm -f obj-test/*.P - -rm -f src/build.h + -rm -f obj/build.h FORCE: diff --git a/src/makefile.unix b/src/makefile.unix index 6f8f96e3af..a41b57b4fc 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -172,6 +172,6 @@ clean: -rm -f obj-test/*.o -rm -f obj/*.P -rm -f obj-test/*.P - -rm -f src/build.h + -rm -f obj/build.h FORCE: diff --git a/src/net.cpp b/src/net.cpp index c0693306af..5b5510a5b2 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -639,8 +639,6 @@ void CNode::copyStats(CNodeStats &stats) void ThreadSocketHandler(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadSocketHandler(parg)); - // Make this thread recognisable as the networking thread RenameThread("bitcoin-net"); @@ -887,7 +885,7 @@ void ThreadSocketHandler2(void* parg) if (nPos > ReceiveBufferSize()) { if (!pnode->fDisconnect) - printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size()); + printf("socket recv flood control disconnect (%"PRIszu" bytes)\n", vRecv.size()); pnode->CloseSocketDisconnect(); } else { @@ -1000,8 +998,6 @@ void ThreadSocketHandler2(void* parg) #ifdef USE_UPNP void ThreadMapPort(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadMapPort(parg)); - // Make this thread recognisable as the UPnP thread RenameThread("bitcoin-UPnP"); @@ -1025,7 +1021,7 @@ void ThreadMapPort2(void* parg) { printf("ThreadMapPort started\n"); - std::string port = strprintf("%d", GetListenPort()); + std::string port = strprintf("%u", GetListenPort()); const char * multicastif = 0; const char * minissdpdpath = 0; struct UPNPDev * devlist = 0; @@ -1160,8 +1156,6 @@ static const char *strDNSSeed[][2] = { void ThreadDNSAddressSeed(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadDNSAddressSeed(parg)); - // Make this thread recognisable as the DNS seeding thread RenameThread("bitcoin-dnsseed"); @@ -1191,7 +1185,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; @@ -1333,8 +1327,6 @@ void ThreadDumpAddress2(void* parg) void ThreadDumpAddress(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadDumpAddress(parg)); - // Make this thread recognisable as the address dumping thread RenameThread("bitcoin-adrdump"); @@ -1350,8 +1342,6 @@ void ThreadDumpAddress(void* parg) void ThreadOpenConnections(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadOpenConnections(parg)); - // Make this thread recognisable as the connection opening thread RenameThread("bitcoin-opencon"); @@ -1513,8 +1503,6 @@ void ThreadOpenConnections2(void* parg) void ThreadOpenAddedConnections(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadOpenAddedConnections(parg)); - // Make this thread recognisable as the connection opening thread RenameThread("bitcoin-opencon"); @@ -1541,7 +1529,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; @@ -1646,8 +1634,6 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu void ThreadMessageHandler(void* parg) { - IMPLEMENT_RANDOMIZE_STACK(ThreadMessageHandler(parg)); - // Make this thread recognisable as the message handling thread RenameThread("bitcoin-msghand"); diff --git a/src/netbase.cpp b/src/netbase.cpp index 76a3d25d3a..95d64939ba 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -5,6 +5,7 @@ #include "netbase.h" #include "util.h" +#include "sync.h" #ifndef WIN32 #include <sys/fcntl.h> @@ -16,9 +17,9 @@ 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; @@ -432,15 +433,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 +452,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 +481,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 +518,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: @@ -599,7 +616,7 @@ CNetAddr::CNetAddr(const std::string &strIp, bool fAllowLookup) *this = vIP[0]; } -int CNetAddr::GetByte(int n) const +unsigned int CNetAddr::GetByte(int n) const { return ip[15-n]; } @@ -1135,7 +1152,7 @@ std::vector<unsigned char> CService::GetKey() const std::string CService::ToStringPort() const { - return strprintf("%i", port); + return strprintf("%u", port); } std::string CService::ToStringIPPort() const diff --git a/src/netbase.h b/src/netbase.h index 07ca12cb96..0a29d4ff0c 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -66,7 +66,7 @@ class CNetAddr enum Network GetNetwork() const; std::string ToString() const; std::string ToStringIP() const; - int GetByte(int n) const; + unsigned int GetByte(int n) const; uint64 GetHash() const; bool GetInAddr(struct in_addr* pipv4Addr) const; std::vector<unsigned char> GetGroup() const; @@ -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/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 8a74a47f58..e20358c70e 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -27,7 +27,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : { ui->setupUi(this); -#ifdef Q_WS_MAC // Icons on push buttons are very uncommon on Mac +#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac ui->newAddressButton->setIcon(QIcon()); ui->copyToClipboard->setIcon(QIcon()); ui->deleteButton->setIcon(QIcon()); diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 1eccaa9f8e..03aa7af0be 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -108,7 +108,16 @@ void AskPassphraseDialog::accept() if(model->setWalletEncrypted(true, newpass1)) { QMessageBox::warning(this, tr("Wallet encrypted"), - tr("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.")); + "<qt>" + + tr("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.") + + "<br><br><b>" + + tr("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.") + + "</b></qt>"); QApplication::quit(); } else 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/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index ca4a888e4e..66792e00a9 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -31,7 +31,7 @@ public: /** Make field empty and ready for new input. */ void clear(); - /** Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907), + /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually. */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 27b974b5c6..19a6a65a1b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -26,7 +26,7 @@ #include "guiutil.h" #include "rpcconsole.h" -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC #include "macdockiconhandler.h" #endif @@ -70,7 +70,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): { resize(850, 550); setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else @@ -115,9 +115,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); -#ifdef FIRST_CLASS_MESSAGING - centralWidget->addWidget(signVerifyMessageDialog); -#endif setCentralWidget(centralWidget); // Create status bar @@ -186,7 +183,7 @@ BitcoinGUI::~BitcoinGUI() { if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) trayIcon->hide(); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC delete appMenuBar; #endif } @@ -201,6 +198,18 @@ void BitcoinGUI::createActions() overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); + sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); + sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address")); + sendCoinsAction->setCheckable(true); + sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); + tabGroup->addAction(sendCoinsAction); + + receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); + receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); + receiveCoinsAction->setCheckable(true); + receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); + tabGroup->addAction(receiveCoinsAction); + historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); @@ -213,52 +222,16 @@ void BitcoinGUI::createActions() addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); - receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); - receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); - receiveCoinsAction->setCheckable(true); - receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); - tabGroup->addAction(receiveCoinsAction); - - sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); - sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address")); - sendCoinsAction->setCheckable(true); - sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); - tabGroup->addAction(sendCoinsAction); - - signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); - signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address")); - tabGroup->addAction(signMessageAction); - - verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); - verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); - tabGroup->addAction(verifyMessageAction); - -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this); - firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString(".")); - firstClassMessagingAction->setCheckable(true); - tabGroup->addAction(firstClassMessagingAction); -#endif - connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); -#ifdef FIRST_CLASS_MESSAGING - connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - // Always start with the sign message tab for FIRST_CLASS_MESSAGING - connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); -#endif quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); @@ -274,8 +247,6 @@ void BitcoinGUI::createActions() optionsAction->setToolTip(tr("Modify configuration options for Bitcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); - exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); - exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); @@ -283,22 +254,29 @@ void BitcoinGUI::createActions() backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); + signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); + verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); + + exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); + exportAction->setToolTip(tr("Export the data in the current tab to a file")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); - connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); + connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); + connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); } void BitcoinGUI::createMenuBar() { -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC // Create a decoupled menu bar on Mac which stays even if the window is closed appMenuBar = new QMenuBar(); #else @@ -310,10 +288,8 @@ void BitcoinGUI::createMenuBar() QMenu *file = appMenuBar->addMenu(tr("&File")); file->addAction(backupWalletAction); file->addAction(exportAction); -#ifndef FIRST_CLASS_MESSAGING file->addAction(signMessageAction); file->addAction(verifyMessageAction); -#endif file->addSeparator(); file->addAction(quitAction); @@ -339,9 +315,6 @@ void BitcoinGUI::createToolBars() toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); -#ifdef FIRST_CLASS_MESSAGING - toolbar->addAction(firstClassMessagingAction); -#endif QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -357,7 +330,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) if(clientModel->isTestNet()) { setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]")); -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); #else @@ -421,7 +394,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) void BitcoinGUI::createTrayIcon() { QMenu *trayIconMenu; -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC trayIcon = new QSystemTrayIcon(this); trayIconMenu = new QMenu(this); trayIcon->setContextMenu(trayIconMenu); @@ -441,15 +414,13 @@ void BitcoinGUI::createTrayIcon() trayIconMenu->addSeparator(); trayIconMenu->addAction(sendCoinsAction); trayIconMenu->addAction(receiveCoinsAction); -#ifndef FIRST_CLASS_MESSAGING trayIconMenu->addSeparator(); -#endif trayIconMenu->addAction(signMessageAction); trayIconMenu->addAction(verifyMessageAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(optionsAction); trayIconMenu->addAction(openRPCConsoleAction); -#ifndef Q_WS_MAC // This is built-in on Mac +#ifndef Q_OS_MAC // This is built-in on Mac trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); #endif @@ -457,7 +428,7 @@ void BitcoinGUI::createTrayIcon() notificator = new Notificator(qApp->applicationName(), trayIcon); } -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) { if(reason == QSystemTrayIcon::Trigger) @@ -501,7 +472,7 @@ void BitcoinGUI::setNumConnections(int count) void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) { - // don't show / hide progressBar and its label if we have no connection(s) to the network + // don't show / hide progress bar and its label if we have no connection to the network if (!clientModel || clientModel->getNumConnections() == 0) { progressBarLabel->setVisible(false); @@ -539,7 +510,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); } - // Override progressBarLabel text and hide progressBar, when we have warnings to display + // Override progressBarLabel text and hide progress bar, when we have warnings to display if (!strStatusBarWarnings.isEmpty()) { progressBarLabel->setText(strStatusBarWarnings); @@ -618,7 +589,7 @@ void BitcoinGUI::error(const QString &title, const QString &message, bool modal) void BitcoinGUI::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); -#ifndef Q_WS_MAC // Ignored on Mac +#ifndef Q_OS_MAC // Ignored on Mac if(e->type() == QEvent::WindowStateChange) { if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) @@ -638,7 +609,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) { if(clientModel) { -#ifndef Q_WS_MAC // Ignored on Mac +#ifndef Q_OS_MAC // Ignored on Mac if(!clientModel->getOptionsModel()->getMinimizeToTray() && !clientModel->getOptionsModel()->getMinimizeOnClose()) { @@ -747,18 +718,8 @@ void BitcoinGUI::gotoSendCoinsPage() void BitcoinGUI::gotoSignMessageTab(QString addr) { -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction->setChecked(true); - centralWidget->setCurrentWidget(signVerifyMessageDialog); - - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - - signVerifyMessageDialog->showTab_SM(false); -#else // call show() in showTab_SM() signVerifyMessageDialog->showTab_SM(true); -#endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_SM(addr); @@ -766,18 +727,8 @@ void BitcoinGUI::gotoSignMessageTab(QString addr) void BitcoinGUI::gotoVerifyMessageTab(QString addr) { -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction->setChecked(true); - centralWidget->setCurrentWidget(signVerifyMessageDialog); - - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - - signVerifyMessageDialog->showTab_VM(false); -#else // call show() in showTab_VM() signVerifyMessageDialog->showTab_VM(true); -#endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_VM(addr); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index acf84eb941..c67e887c0f 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -80,7 +80,6 @@ private: QAction *addressBookAction; QAction *signMessageAction; QAction *verifyMessageAction; - QAction *firstClassMessagingAction; QAction *aboutAction; QAction *receiveCoinsAction; QAction *optionsAction; @@ -124,7 +123,7 @@ public slots: /** Asks the user whether to pay the transaction fee or to cancel the transaction. It is currently not possible to pass a return value to another thread through BlockingQueuedConnection, so an indirected pointer is used. - http://bugreports.qt.nokia.com/browse/QTBUG-10440 + https://bugreports.qt-project.org/browse/QTBUG-10440 @param[in] nFeeRequired the required fee @param[out] payFee true to pay the fee, false to not pay the fee @@ -153,7 +152,7 @@ private slots: void optionsClicked(); /** Show about dialog */ void aboutClicked(); -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); #endif diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 20d1830486..53e729727e 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 %i 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/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index eac35c27ae..71ab75ca3f 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -102,7 +102,7 @@ <string>Sign a message to prove you own a Bitcoin address</string> </property> <property name="text"> - <string>&Sign Message</string> + <string>Sign &Message</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> @@ -127,7 +127,7 @@ <item> <widget class="QPushButton" name="deleteButton"> <property name="toolTip"> - <string>Delete the currently selected address from the list. Only sending addresses can be deleted.</string> + <string>Delete the currently selected address from the list</string> </property> <property name="text"> <string>&Delete</string> diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 10a1586d4a..6e17565ab0 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -64,7 +64,7 @@ <string>Send to multiple recipients at once</string> </property> <property name="text"> - <string>&Add Recipient</string> + <string>Add &Recipient</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> @@ -153,7 +153,7 @@ <string>Confirm the send action</string> </property> <property name="text"> - <string>&Send</string> + <string>S&end</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> 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/macdockiconhandler.h b/src/qt/macdockiconhandler.h index d02c148f91..2092fb26b3 100644 --- a/src/qt/macdockiconhandler.h +++ b/src/qt/macdockiconhandler.h @@ -6,7 +6,12 @@ class QMenu; class QIcon; class QWidget; -class objc_object; + +#ifdef __OBJC__ +@class DockIconClickEventHandler; +#else +class DockIconClickEventHandler; +#endif /** Macintosh-specific dock icon handler. */ @@ -31,7 +36,7 @@ public slots: private: MacDockIconHandler(); - objc_object *m_dockIconClickEventHandler; + DockIconClickEventHandler *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; }; diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index df56e6949d..75684403eb 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -1,8 +1,8 @@ #include "macdockiconhandler.h" -#include <QtGui/QMenu> -#include <QtGui/QWidget> +#include <QMenu> +#include <QWidget> extern void qt_mac_set_dock_menu(QMenu*); diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index c1c177dbfe..8028190b82 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -16,7 +16,7 @@ #include <stdint.h> #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC #include <ApplicationServices/ApplicationServices.h> extern bool qt_mac_execute_apple_script(const QString &script, AEDesc *ret); #endif @@ -46,7 +46,7 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, mode = Freedesktop; } #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC // Check if Growl is installed (based on Qt's tray icon implementation) CFURLRef cfurl; OSStatus status = LSGetApplicationForInfo(kLSUnknownType, kLSUnknownCreator, CFSTR("growlTicket"), kLSRolesAll, 0, &cfurl); @@ -225,7 +225,7 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString & } // Based on Qt's tray icon implementation -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC void Notificator::notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon) { const QString script( @@ -285,7 +285,7 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c case QSystemTray: notifySystray(cls, title, text, icon, millisTimeout); break; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC case Growl12: case Growl13: notifyGrowl(cls, title, text, icon); diff --git a/src/qt/notificator.h b/src/qt/notificator.h index 8abc0b2ec2..abb47109b3 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -61,7 +61,7 @@ private: void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout); #endif void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC void notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon); #endif }; diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index f8d1fe56fb..8025126c25 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -46,7 +46,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) : ui->proxyIp->installEventFilter(this); /* Window elements init */ -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC ui->tabWindow->setVisible(false); #endif diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index caa33414b2..756fe61ecd 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/qt/qtipcserver.cpp b/src/qt/qtipcserver.cpp index ec2d56b9e3..74f44fac57 100644 --- a/src/qt/qtipcserver.cpp +++ b/src/qt/qtipcserver.cpp @@ -74,8 +74,6 @@ void ipcScanRelay(int argc, char *argv[]) static void ipcThread(void* pArg) { - IMPLEMENT_RANDOMIZE_STACK(ipcThread(pArg)); - // Make this thread recognisable as the GUI-IPC thread RenameThread("bitcoin-gui-ipc"); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 7d5b6fed53..2b8a0c049b 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -192,13 +192,14 @@ RPCConsole::RPCConsole(QWidget *parent) : { ui->setupUi(this); -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC ui->openDebugLogfileButton->setIcon(QIcon(":/icons/export")); ui->showCLOptionsButton->setIcon(QIcon(":/icons/options")); #endif // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); + ui->messagesWidget->installEventFilter(this); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); @@ -218,15 +219,34 @@ RPCConsole::~RPCConsole() bool RPCConsole::eventFilter(QObject* obj, QEvent *event) { - if(obj == ui->lineEdit) + if(event->type() == QEvent::KeyPress) // Special key handling { - if(event->type() == QEvent::KeyPress) + QKeyEvent *keyevt = static_cast<QKeyEvent*>(event); + int key = keyevt->key(); + Qt::KeyboardModifiers mod = keyevt->modifiers(); + switch(key) { - QKeyEvent *key = static_cast<QKeyEvent*>(event); - switch(key->key()) + case Qt::Key_Up: if(obj == ui->lineEdit) { browseHistory(-1); return true; } break; + case Qt::Key_Down: if(obj == ui->lineEdit) { browseHistory(1); return true; } break; + case Qt::Key_PageUp: /* pass paging keys to messages widget */ + case Qt::Key_PageDown: + if(obj == ui->lineEdit) { - case Qt::Key_Up: browseHistory(-1); return true; - case Qt::Key_Down: browseHistory(1); return true; + QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt)); + return true; + } + break; + default: + // Typing in messages widget brings focus to line edit, and redirects key there + // Exclude most combinations and keys that emit no text, except paste shortcuts + if(obj == ui->messagesWidget && ( + (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) || + ((mod & Qt::ControlModifier) && key == Qt::Key_V) || + ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert))) + { + ui->lineEdit->setFocus(); + QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt)); + return true; } } } diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 789681ad90..ca2c615333 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -21,7 +21,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : { ui->setupUi(this); -#ifdef Q_WS_MAC // Icons on push buttons are very uncommon on Mac +#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac ui->addButton->setIcon(QIcon()); ui->clearButton->setIcon(QIcon()); ui->sendButton->setIcon(QIcon()); diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index def2f83c30..8a6e050c11 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -25,7 +25,7 @@ public: void setModel(WalletModel *model); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 71891e79ca..c4d84c388c 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -17,7 +17,7 @@ SendCoinsEntry::SendCoinsEntry(QWidget *parent) : { ui->setupUi(this); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC ui->payToLayout->setSpacing(4); #endif #if QT_VERSION >= 0x040700 diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index db6cba0d80..0ac14c1472 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -27,7 +27,7 @@ public: void setValue(const SendCoinsRecipient &value); - /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). + /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ QWidget *setupTabChain(QWidget *prev); diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 3e7eca59ca..efc77e190e 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -64,11 +64,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) { strHTML += "<b>" + tr("Source") + ":</b> " + tr("Generated") + "<br>"; } - else if (!wtx.mapValue["from"].empty()) + else if (wtx.mapValue.count("from") && !wtx.mapValue["from"].empty()) { // Online transaction - if (!wtx.mapValue["from"].empty()) - strHTML += "<b>" + tr("From") + ":</b> " + GUIUtil::HtmlEscape(wtx.mapValue["from"]) + "<br>"; + strHTML += "<b>" + tr("From") + ":</b> " + GUIUtil::HtmlEscape(wtx.mapValue["from"]) + "<br>"; } else { @@ -104,7 +103,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // To // - if (!wtx.mapValue["to"].empty()) + if (wtx.mapValue.count("to") && !wtx.mapValue["to"].empty()) { // Online transaction std::string strAddress = wtx.mapValue["to"]; @@ -160,7 +159,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) if (wallet->IsMine(txout)) continue; - if (wtx.mapValue["to"].empty()) + if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty()) { // Offline transaction CTxDestination address; @@ -209,9 +208,9 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // Message // - if (!wtx.mapValue["message"].empty()) + if (wtx.mapValue.count("message") && !wtx.mapValue["message"].empty()) strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["message"], true) + "<br>"; - if (!wtx.mapValue["comment"].empty()) + if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>"; strHTML += "<b>" + tr("Transaction ID") + ":</b> " + wtx.GetHash().ToString().c_str() + "<br>"; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index cc60e2732b..4c3071984f 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -9,18 +9,8 @@ bool TransactionRecord::showTransaction(const CWalletTx &wtx) { if (wtx.IsCoinBase()) { - // Don't show generated coin until confirmed by at least one block after it - // so we don't get the user's hopes up until it looks like it's probably accepted. - // - // It is not an error when generated blocks are not accepted. By design, - // some percentage of blocks, like 10% or more, will end up not accepted. - // This is the normal mechanism by which the network copes with latency. - // - // We display regular transactions right away before any confirmation - // because they can always get into some block eventually. Generated coins - // are special because if their block is not accepted, they are not valid. - // - if (wtx.GetDepthInMainChain() < 2) + // Ensures we show generated coins / mined transactions at depth 1 + if (!wtx.IsInMainChain()) { return false; } diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index ed2a70a350..7acf5deaa3 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -38,7 +38,7 @@ TransactionView::TransactionView(QWidget *parent) : QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC hlayout->setSpacing(5); hlayout->addSpacing(26); #else @@ -47,7 +47,7 @@ TransactionView::TransactionView(QWidget *parent) : #endif dateWidget = new QComboBox(this); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC dateWidget->setFixedWidth(121); #else dateWidget->setFixedWidth(120); @@ -62,7 +62,7 @@ TransactionView::TransactionView(QWidget *parent) : hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC typeWidget->setFixedWidth(121); #else typeWidget->setFixedWidth(120); @@ -91,7 +91,7 @@ TransactionView::TransactionView(QWidget *parent) : /* Do not move this to the XML file, Qt before 4.7 will choke on it */ amountWidget->setPlaceholderText(tr("Min amount")); #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC amountWidget->setFixedWidth(97); #else amountWidget->setFixedWidth(100); @@ -110,7 +110,7 @@ TransactionView::TransactionView(QWidget *parent) : vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC hlayout->addSpacing(width+2); #else hlayout->addSpacing(width); 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 3d0d05de84..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(); } @@ -725,7 +725,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) if ((int)keys.size() < nRequired) throw runtime_error( strprintf("not enough keys supplied " - "(got %d keys, but need at least %d to redeem)", keys.size(), nRequired)); + "(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired)); std::vector<CKey> pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) @@ -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,13 +1390,13 @@ 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 // unencrypted private keys. So: StartShutdown(); - return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet"; + return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup."; } class DescribeAddressVisitor : public boost::static_visitor<Object> diff --git a/src/script.cpp b/src/script.cpp index c34fbec82d..4357a9a1b3 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -54,12 +54,29 @@ bool CastToBool(const valtype& vch) return false; } +// +// WARNING: This does not work as expected for signed integers; the sign-bit +// is left in place as the integer is zero-extended. The correct behavior +// would be to move the most significant bit of the last byte during the +// resize process. MakeSameSize() is currently only used by the disabled +// opcodes OP_AND, OP_OR, and OP_XOR. +// void MakeSameSize(valtype& vch1, valtype& vch2) { // Lengthen the shorter one if (vch1.size() < vch2.size()) + // PATCH: + // +unsigned char msb = vch1[vch1.size()-1]; + // +vch1[vch1.size()-1] &= 0x7f; + // vch1.resize(vch2.size(), 0); + // +vch1[vch1.size()-1] = msb; vch1.resize(vch2.size(), 0); if (vch2.size() < vch1.size()) + // PATCH: + // +unsigned char msb = vch2[vch2.size()-1]; + // +vch2[vch2.size()-1] &= 0x7f; + // vch2.resize(vch1.size(), 0); + // +vch2[vch2.size()-1] = msb; vch2.resize(vch1.size(), 0); } @@ -663,6 +680,11 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co } break; + // + // WARNING: These disabled opcodes exhibit unexpected behavior + // when used on signed integers due to a bug in MakeSameSize() + // [see definition of MakeSameSize() above]. + // case OP_AND: case OP_OR: case OP_XOR: @@ -672,7 +694,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co return false; valtype& vch1 = stacktop(-2); valtype& vch2 = stacktop(-1); - MakeSameSize(vch1, vch2); + MakeSameSize(vch1, vch2); // <-- NOT SAFE FOR SIGNED VALUES if (opcode == OP_AND) { for (unsigned int i = 0; i < vch1.size(); i++) diff --git a/src/sync.h b/src/sync.h index 98640e6eab..e80efbe001 100644 --- a/src/sync.h +++ b/src/sync.h @@ -31,7 +31,7 @@ void static inline LeaveCritical() {} void PrintLockContention(const char* pszName, const char* pszFile, int nLine); #endif -/** Wrapper around boost::interprocess::scoped_lock */ +/** Wrapper around boost::unique_lock<Mutex> */ template<typename Mutex> class CMutexLock { diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 3f265f1fe3..7602fa93a6 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -1,87 +1,259 @@ #include <boost/test/unit_test.hpp> +#include "json/json_spirit_reader_template.h" +#include "json/json_spirit_writer_template.h" +#include "json/json_spirit_utils.h" #include "base58.h" +#include "util.h" + +using namespace json_spirit; +extern Array read_json(const std::string& filename); BOOST_AUTO_TEST_SUITE(base58_tests) -// TODO: -// EncodeBase58Check -// DecodeBase58Check -// CBase58Data -// bool SetString(const char* psz) - // bool SetString(const std::string& str) - // std::string ToString() const - // int CompareTo(const CBase58Data& b58) const - // bool operator==(const CBase58Data& b58) const - // bool operator<=(const CBase58Data& b58) const - // bool operator>=(const CBase58Data& b58) const - // bool operator< (const CBase58Data& b58) const - // bool operator> (const CBase58Data& b58) const - -// CBitcoinAddress - // bool SetHash160(const uint160& hash160) - // bool SetPubKey(const std::vector<unsigned char>& vchPubKey) - // bool IsValid() const - // CBitcoinAddress() - // CBitcoinAddress(uint160 hash160In) - // CBitcoinAddress(const std::vector<unsigned char>& vchPubKey) - // CBitcoinAddress(const std::string& strAddress) - // CBitcoinAddress(const char* pszAddress) - // uint160 GetHash160() const - -#define U(x) (reinterpret_cast<const unsigned char*>(x)) -static struct { - const unsigned char *data; - int size; -} vstrIn[] = { -{U(""), 0}, -{U("\x61"), 1}, -{U("\x62\x62\x62"), 3}, -{U("\x63\x63\x63"), 3}, -{U("\x73\x69\x6d\x70\x6c\x79\x20\x61\x20\x6c\x6f\x6e\x67\x20\x73\x74\x72\x69\x6e\x67"), 20}, -{U("\x00\xeb\x15\x23\x1d\xfc\xeb\x60\x92\x58\x86\xb6\x7d\x06\x52\x99\x92\x59\x15\xae\xb1\x72\xc0\x66\x47"), 25}, -{U("\x51\x6b\x6f\xcd\x0f"), 5}, -{U("\xbf\x4f\x89\x00\x1e\x67\x02\x74\xdd"), 9}, -{U("\x57\x2e\x47\x94"), 4}, -{U("\xec\xac\x89\xca\xd9\x39\x23\xc0\x23\x21"), 10}, -{U("\x10\xc8\x51\x1e"), 4}, -{U("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"), 10}, +// Goal: test low-level base58 encoding functionality +BOOST_AUTO_TEST_CASE(base58_EncodeBase58) +{ + Array tests = read_json("base58_encode_decode.json"); + + BOOST_FOREACH(Value& tv, tests) + { + Array test = tv.get_array(); + std::string strTest = write_string(tv, false); + if (test.size() < 2) // Allow for extra stuff (useful for comments) + { + BOOST_ERROR("Bad test: " << strTest); + continue; + } + std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str()); + std::string base58string = test[1].get_str(); + BOOST_CHECK_MESSAGE( + EncodeBase58(&sourcedata[0], &sourcedata[sourcedata.size()]) == base58string, + strTest); + } +} + +// Goal: test low-level base58 decoding functionality +BOOST_AUTO_TEST_CASE(base58_DecodeBase58) +{ + Array tests = read_json("base58_encode_decode.json"); + std::vector<unsigned char> result; + + BOOST_FOREACH(Value& tv, tests) + { + Array test = tv.get_array(); + std::string strTest = write_string(tv, false); + if (test.size() < 2) // Allow for extra stuff (useful for comments) + { + BOOST_ERROR("Bad test: " << strTest); + continue; + } + std::vector<unsigned char> expected = ParseHex(test[0].get_str()); + std::string base58string = test[1].get_str(); + BOOST_CHECK_MESSAGE(DecodeBase58(base58string, result), strTest); + BOOST_CHECK_MESSAGE(result.size() == expected.size() && std::equal(result.begin(), result.end(), expected.begin()), strTest); + } + + BOOST_CHECK(!DecodeBase58("invalid", result)); +} + +// Visitor to check address type +class TestAddrTypeVisitor : public boost::static_visitor<bool> +{ +private: + std::string exp_addrType; +public: + TestAddrTypeVisitor(const std::string &exp_addrType) : exp_addrType(exp_addrType) { } + bool operator()(const CKeyID &id) const + { + return (exp_addrType == "pubkey"); + } + bool operator()(const CScriptID &id) const + { + return (exp_addrType == "script"); + } + bool operator()(const CNoDestination &no) const + { + return (exp_addrType == "none"); + } }; -const char *vstrOut[] = { -"", -"2g", -"a3gV", -"aPEr", -"2cFupjhnEsSn59qHXstmK2ffpLv2", -"1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L", -"ABnLTmg", -"3SEo3LWLoPntC", -"3EFU7m", -"EJDM8drfXA6uyA", -"Rt5zm", -"1111111111" +// Visitor to check address payload +class TestPayloadVisitor : public boost::static_visitor<bool> +{ +private: + std::vector<unsigned char> exp_payload; +public: + TestPayloadVisitor(std::vector<unsigned char> &exp_payload) : exp_payload(exp_payload) { } + bool operator()(const CKeyID &id) const + { + uint160 exp_key(exp_payload); + return exp_key == id; + } + bool operator()(const CScriptID &id) const + { + uint160 exp_key(exp_payload); + return exp_key == id; + } + bool operator()(const CNoDestination &no) const + { + return exp_payload.size() == 0; + } }; -BOOST_AUTO_TEST_CASE(base58_EncodeBase58) +// Goal: check that parsed keys match test payload +BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) { - for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++) + Array tests = read_json("base58_keys_valid.json"); + std::vector<unsigned char> result; + CBitcoinSecret secret; + CBitcoinAddress addr; + // Save global state + bool fTestNet_stored = fTestNet; + + BOOST_FOREACH(Value& tv, tests) { - BOOST_CHECK_EQUAL(EncodeBase58(vstrIn[i].data, vstrIn[i].data + vstrIn[i].size), vstrOut[i]); + Array test = tv.get_array(); + std::string strTest = write_string(tv, false); + if (test.size() < 3) // Allow for extra stuff (useful for comments) + { + BOOST_ERROR("Bad test: " << strTest); + continue; + } + std::string exp_base58string = test[0].get_str(); + std::vector<unsigned char> exp_payload = ParseHex(test[1].get_str()); + const Object &metadata = test[2].get_obj(); + bool isPrivkey = find_value(metadata, "isPrivkey").get_bool(); + bool isTestnet = find_value(metadata, "isTestnet").get_bool(); + fTestNet = isTestnet; // Override testnet flag + if(isPrivkey) + { + bool isCompressed = find_value(metadata, "isCompressed").get_bool(); + // Must be valid private key + // Note: CBitcoinSecret::SetString tests isValid, whereas CBitcoinAddress does not! + BOOST_CHECK_MESSAGE(secret.SetString(exp_base58string), "!SetString:"+ strTest); + BOOST_CHECK_MESSAGE(secret.IsValid(), "!IsValid:" + strTest); + bool fCompressedOut = false; + CSecret privkey = secret.GetSecret(fCompressedOut); + BOOST_CHECK_MESSAGE(fCompressedOut == isCompressed, "compressed mismatch:" + strTest); + BOOST_CHECK_MESSAGE(privkey.size() == exp_payload.size() && std::equal(privkey.begin(), privkey.end(), exp_payload.begin()), "key mismatch:" + strTest); + + // Private key must be invalid public key + addr.SetString(exp_base58string); + BOOST_CHECK_MESSAGE(!addr.IsValid(), "IsValid privkey as pubkey:" + strTest); + } + else + { + std::string exp_addrType = find_value(metadata, "addrType").get_str(); // "script" or "pubkey" + // Must be valid public key + BOOST_CHECK_MESSAGE(addr.SetString(exp_base58string), "SetString:" + strTest); + BOOST_CHECK_MESSAGE(addr.IsValid(), "!IsValid:" + strTest); + BOOST_CHECK_MESSAGE(addr.IsScript() == (exp_addrType == "script"), "isScript mismatch" + strTest); + CTxDestination dest = addr.Get(); + BOOST_CHECK_MESSAGE(boost::apply_visitor(TestAddrTypeVisitor(exp_addrType), dest), "addrType mismatch" + strTest); + + // Public key must be invalid private key + secret.SetString(exp_base58string); + BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest); + } } + // Restore global state + fTestNet = fTestNet_stored; } -BOOST_AUTO_TEST_CASE(base58_DecodeBase58) +// Goal: check that generated keys match test vectors +BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) { + Array tests = read_json("base58_keys_valid.json"); std::vector<unsigned char> result; - for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++) + // Save global state + bool fTestNet_stored = fTestNet; + + BOOST_FOREACH(Value& tv, tests) { - std::vector<unsigned char> expected(vstrIn[i].data, vstrIn[i].data + vstrIn[i].size); - BOOST_CHECK(DecodeBase58(vstrOut[i], result)); - BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end()); + Array test = tv.get_array(); + std::string strTest = write_string(tv, false); + if (test.size() < 3) // Allow for extra stuff (useful for comments) + { + BOOST_ERROR("Bad test: " << strTest); + continue; + } + std::string exp_base58string = test[0].get_str(); + std::vector<unsigned char> exp_payload = ParseHex(test[1].get_str()); + const Object &metadata = test[2].get_obj(); + bool isPrivkey = find_value(metadata, "isPrivkey").get_bool(); + bool isTestnet = find_value(metadata, "isTestnet").get_bool(); + fTestNet = isTestnet; // Override testnet flag + if(isPrivkey) + { + bool isCompressed = find_value(metadata, "isCompressed").get_bool(); + CBitcoinSecret secret; + secret.SetSecret(CSecret(exp_payload.begin(), exp_payload.end()), isCompressed); + BOOST_CHECK_MESSAGE(secret.ToString() == exp_base58string, "result mismatch: " + strTest); + } + else + { + std::string exp_addrType = find_value(metadata, "addrType").get_str(); + CTxDestination dest; + if(exp_addrType == "pubkey") + { + dest = CKeyID(uint160(exp_payload)); + } + else if(exp_addrType == "script") + { + dest = CScriptID(uint160(exp_payload)); + } + else if(exp_addrType == "none") + { + dest = CNoDestination(); + } + else + { + BOOST_ERROR("Bad addrtype: " << strTest); + continue; + } + CBitcoinAddress addrOut; + BOOST_CHECK_MESSAGE(boost::apply_visitor(CBitcoinAddressVisitor(&addrOut), dest), "encode dest: " + strTest); + BOOST_CHECK_MESSAGE(addrOut.ToString() == exp_base58string, "mismatch: " + strTest); + } + } + + // Visiting a CNoDestination must fail + CBitcoinAddress dummyAddr; + CTxDestination nodest = CNoDestination(); + BOOST_CHECK(!boost::apply_visitor(CBitcoinAddressVisitor(&dummyAddr), nodest)); + + // Restore global state + fTestNet = fTestNet_stored; +} + +// Goal: check that base58 parsing code is robust against a variety of corrupted data +BOOST_AUTO_TEST_CASE(base58_keys_invalid) +{ + Array tests = read_json("base58_keys_invalid.json"); // Negative testcases + std::vector<unsigned char> result; + CBitcoinSecret secret; + CBitcoinAddress addr; + + BOOST_FOREACH(Value& tv, tests) + { + Array test = tv.get_array(); + std::string strTest = write_string(tv, false); + if (test.size() < 1) // Allow for extra stuff (useful for comments) + { + BOOST_ERROR("Bad test: " << strTest); + continue; + } + std::string exp_base58string = test[0].get_str(); + + // must be invalid as public and as private key + addr.SetString(exp_base58string); + BOOST_CHECK_MESSAGE(!addr.IsValid(), "IsValid pubkey:" + strTest); + secret.SetString(exp_base58string); + BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid privkey:" + strTest); } - BOOST_CHECK(!DecodeBase58("invalid", result)); } + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/data/base58_encode_decode.json b/src/test/data/base58_encode_decode.json new file mode 100644 index 0000000000..9448f256d9 --- /dev/null +++ b/src/test/data/base58_encode_decode.json @@ -0,0 +1,14 @@ +[ +["", ""], +["61", "2g"], +["626262", "a3gV"], +["636363", "aPEr"], +["73696d706c792061206c6f6e6720737472696e67", "2cFupjhnEsSn59qHXstmK2ffpLv2"], +["00eb15231dfceb60925886b67d065299925915aeb172c06647", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"], +["516b6fcd0f", "ABnLTmg"], +["bf4f89001e670274dd", "3SEo3LWLoPntC"], +["572e4794", "3EFU7m"], +["ecac89cad93923c02321", "EJDM8drfXA6uyA"], +["10c8511e", "Rt5zm"], +["00000000000000000000", "1111111111"] +] diff --git a/src/test/data/base58_keys_invalid.json b/src/test/data/base58_keys_invalid.json new file mode 100644 index 0000000000..a088620f1b --- /dev/null +++ b/src/test/data/base58_keys_invalid.json @@ -0,0 +1,152 @@ +[ + [ + "" + ], + [ + "x" + ], + [ + "37qgekLpCCHrQuSjvX3fs496FWTGsHFHizjJAs6NPcR47aefnnCWECAhHV6E3g4YN7u7Yuwod5Y" + ], + [ + "dzb7VV1Ui55BARxv7ATxAtCUeJsANKovDGWFVgpTbhq9gvPqP3yv" + ], + [ + "MuNu7ZAEDFiHthiunm7dPjwKqrVNCM3mAz6rP9zFveQu14YA8CxExSJTHcVP9DErn6u84E6Ej7S" + ], + [ + "rPpQpYknyNQ5AEHuY6H8ijJJrYc2nDKKk9jjmKEXsWzyAQcFGpDLU2Zvsmoi8JLR7hAwoy3RQWf" + ], + [ + "4Uc3FmN6NQ6zLBK5QQBXRBUREaaHwCZYsGCueHauuDmJpZKn6jkEskMB2Zi2CNgtb5r6epWEFfUJq" + ], + [ + "7aQgR5DFQ25vyXmqZAWmnVCjL3PkBcdVkBUpjrjMTcghHx3E8wb" + ], + [ + "17QpPprjeg69fW1DV8DcYYCKvWjYhXvWkov6MJ1iTTvMFj6weAqW7wybZeH57WTNxXVCRH4veVs" + ], + [ + "KxuACDviz8Xvpn1xAh9MfopySZNuyajYMZWz16Dv2mHHryznWUp3" + ], + [ + "7nK3GSmqdXJQtdohvGfJ7KsSmn3TmGqExug49583bDAL91pVSGq5xS9SHoAYL3Wv3ijKTit65th" + ], + [ + "cTivdBmq7bay3RFGEBBuNfMh2P1pDCgRYN2Wbxmgwr4ki3jNUL2va" + ], + [ + "gjMV4vjNjyMrna4fsAr8bWxAbwtmMUBXJS3zL4NJt5qjozpbQLmAfK1uA3CquSqsZQMpoD1g2nk" + ], + [ + "emXm1naBMoVzPjbk7xpeTVMFy4oDEe25UmoyGgKEB1gGWsK8kRGs" + ], + [ + "7VThQnNRj1o3Zyvc7XHPRrjDf8j2oivPTeDXnRPYWeYGE4pXeRJDZgf28ppti5hsHWXS2GSobdqyo" + ], + [ + "1G9u6oCVCPh2o8m3t55ACiYvG1y5BHewUkDSdiQarDcYXXhFHYdzMdYfUAhfxn5vNZBwpgUNpso" + ], + [ + "31QQ7ZMLkScDiB4VyZjuptr7AEc9j1SjstF7pRoLhHTGkW4Q2y9XELobQmhhWxeRvqcukGd1XCq" + ], + [ + "DHqKSnpxa8ZdQyH8keAhvLTrfkyBMQxqngcQA5N8LQ9KVt25kmGN" + ], + [ + "2LUHcJPbwLCy9GLH1qXmfmAwvadWw4bp4PCpDfduLqV17s6iDcy1imUwhQJhAoNoN1XNmweiJP4i" + ], + [ + "7USRzBXAnmck8fX9HmW7RAb4qt92VFX6soCnts9s74wxm4gguVhtG5of8fZGbNPJA83irHVY6bCos" + ], + [ + "1DGezo7BfVebZxAbNT3XGujdeHyNNBF3vnficYoTSp4PfK2QaML9bHzAMxke3wdKdHYWmsMTJVu" + ], + [ + "2D12DqDZKwCxxkzs1ZATJWvgJGhQ4cFi3WrizQ5zLAyhN5HxuAJ1yMYaJp8GuYsTLLxTAz6otCfb" + ], + [ + "8AFJzuTujXjw1Z6M3fWhQ1ujDW7zsV4ePeVjVo7D1egERqSW9nZ" + ], + [ + "163Q17qLbTCue8YY3AvjpUhotuaodLm2uqMhpYirsKjVqnxJRWTEoywMVY3NbBAHuhAJ2cF9GAZ" + ], + [ + "2MnmgiRH4eGLyLc9eAqStzk7dFgBjFtUCtu" + ], + [ + "461QQ2sYWxU7H2PV4oBwJGNch8XVTYYbZxU" + ], + [ + "2UCtv53VttmQYkVU4VMtXB31REvQg4ABzs41AEKZ8UcB7DAfVzdkV9JDErwGwyj5AUHLkmgZeobs" + ], + [ + "cSNjAsnhgtiFMi6MtfvgscMB2Cbhn2v1FUYfviJ1CdjfidvmeW6mn" + ], + [ + "gmsow2Y6EWAFDFE1CE4Hd3Tpu2BvfmBfG1SXsuRARbnt1WjkZnFh1qGTiptWWbjsq2Q6qvpgJVj" + ], + [ + "nksUKSkzS76v8EsSgozXGMoQFiCoCHzCVajFKAXqzK5on9ZJYVHMD5CKwgmX3S3c7M1U3xabUny" + ], + [ + "L3favK1UzFGgdzYBF2oBT5tbayCo4vtVBLJhg2iYuMeePxWG8SQc" + ], + [ + "7VxLxGGtYT6N99GdEfi6xz56xdQ8nP2dG1CavuXx7Rf2PrvNMTBNevjkfgs9JmkcGm6EXpj8ipyPZ" + ], + [ + "2mbZwFXF6cxShaCo2czTRB62WTx9LxhTtpP" + ], + [ + "dB7cwYdcPSgiyAwKWL3JwCVwSk6epU2txw" + ], + [ + "HPhFUhUAh8ZQQisH8QQWafAxtQYju3SFTX" + ], + [ + "4ctAH6AkHzq5ioiM1m9T3E2hiYEev5mTsB" + ], + [ + "Hn1uFi4dNexWrqARpjMqgT6cX1UsNPuV3cHdGg9ExyXw8HTKadbktRDtdeVmY3M1BxJStiL4vjJ" + ], + [ + "Sq3fDbvutABmnAHHExJDgPLQn44KnNC7UsXuT7KZecpaYDMU9Txs" + ], + [ + "6TqWyrqdgUEYDQU1aChMuFMMEimHX44qHFzCUgGfqxGgZNMUVWJ" + ], + [ + "giqJo7oWqFxNKWyrgcBxAVHXnjJ1t6cGoEffce5Y1y7u649Noj5wJ4mmiUAKEVVrYAGg2KPB3Y4" + ], + [ + "cNzHY5e8vcmM3QVJUcjCyiKMYfeYvyueq5qCMV3kqcySoLyGLYUK" + ], + [ + "37uTe568EYc9WLoHEd9jXEvUiWbq5LFLscNyqvAzLU5vBArUJA6eydkLmnMwJDjkL5kXc2VK7ig" + ], + [ + "EsYbG4tWWWY45G31nox838qNdzksbPySWc" + ], + [ + "nbuzhfwMoNzA3PaFnyLcRxE9bTJPDkjZ6Rf6Y6o2ckXZfzZzXBT" + ], + [ + "cQN9PoxZeCWK1x56xnz6QYAsvR11XAce3Ehp3gMUdfSQ53Y2mPzx" + ], + [ + "1Gm3N3rkef6iMbx4voBzaxtXcmmiMTqZPhcuAepRzYUJQW4qRpEnHvMojzof42hjFRf8PE2jPde" + ], + [ + "2TAq2tuN6x6m233bpT7yqdYQPELdTDJn1eU" + ], + [ + "ntEtnnGhqPii4joABvBtSEJG6BxjT2tUZqE8PcVYgk3RHpgxgHDCQxNbLJf7ardf1dDk2oCQ7Cf" + ], + [ + "Ky1YjoZNgQ196HJV3HpdkecfhRBmRZdMJk89Hi5KGfpfPwS2bUbfd" + ], + [ + "2A1q1YsMZowabbvta7kTy2Fd6qN4r5ZCeG3qLpvZBMzCixMUdkN2Y4dHB1wPsZAeVXUGD83MfRED" + ] +] diff --git a/src/test/data/base58_keys_valid.json b/src/test/data/base58_keys_valid.json new file mode 100644 index 0000000000..e1e252e22d --- /dev/null +++ b/src/test/data/base58_keys_valid.json @@ -0,0 +1,452 @@ +[ + [ + "1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i", + "65a16059864a2fdbc7c99a4723a8395bc6f188eb", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3CMNFxN1oHBc4R1EpboAL5yzHGgE611Xou", + "74f209f6ea907e2ea48f74fae05782ae8a665257", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs", + "53c0307d6851aa0ce7825ba883c6bd9ad242b486", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2N2JD6wb56AfK4tfmM6PwdVmoYk2dCKf4Br", + "6349a418fc4578d10a372b54b45c280cc8c4382f", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr", + "eddbdc1168f1daeadbd3e44c1e3f8f5a284c2029f78ad26af98583a499de5b19", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "Kz6UJmQACJmLtaQj5A3JAge4kVTNQ8gbvXuwbmCj7bsaabudb3RD", + "55c9bccb9ed68446d1b75273bbce89d7fe013a8acd1625514420fb2aca1a21c4", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "9213qJab2HNEpMpYNBa7wHGFKKbkDn24jpANDs2huN3yi4J11ko", + "36cb93b9ab1bdabf7fb9f2c04f1b9cc879933530ae7842398eef5a63a56800c2", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cTpB4YiyKiBcPxnefsDpbnDxFDffjqJob8wGCEDXxgQ7zQoMXJdH", + "b9f4892c9e8282028fea1d2667c4dc5213564d41fc5783896a0d843fc15089f3", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1Ax4gZtb7gAit2TivwejZHYtNNLT18PUXJ", + "6d23156cbbdcc82a5a47eee4c2c7c583c18b6bf4", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3QjYXhTkvuj8qPaXHTTWb5wjXhdsLAAWVy", + "fcc5460dd6e2487c7d75b1963625da0e8f4c5975", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "n3ZddxzLvAY9o7184TB4c6FJasAybsw4HZ", + "f1d470f9b02370fdec2e6b708b08ac431bf7a5f7", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NBFNJTktNa7GZusGbDbGKRZTxdK9VVez3n", + "c579342c2c4c9220205e2cdc285617040c924a0a", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5K494XZwps2bGyeL71pWid4noiSNA2cfCibrvRWqcHSptoFn7rc", + "a326b95ebae30164217d7a7f57d72ab2b54e3be64928a19da0210b9568d4015e", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L1RrrnXkcKut5DEMwtDthjwRcTTwED36thyL1DebVrKuwvohjMNi", + "7d998b45c219a1e38e99e7cbd312ef67f77a455a9b50c730c27f02c6f730dfb4", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "93DVKyFYwSN6wEo3E2fCrFPUp17FtrtNi2Lf7n4G3garFb16CRj", + "d6bca256b5abc5602ec2e1c121a08b0da2556587430bcf7e1898af2224885203", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cTDVKtMGVYWTHCb1AFjmVbEbWjvKpKqKgMaR3QJxToMSQAhmCeTN", + "a81ca4e8f90181ec4b61b6a7eb998af17b2cb04de8a03b504b9e34c4c61db7d9", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1C5bSj1iEGUgSTbziymG7Cn18ENQuT36vv", + "7987ccaa53d02c8873487ef919677cd3db7a6912", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3AnNxabYGoTxYiTEZwFEnerUoeFXK2Zoks", + "63bcc565f9e68ee0189dd5cc67f1b0e5f02f45cb", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "n3LnJXCqbPjghuVs8ph9CYsAe4Sh4j97wk", + "ef66444b5b17f14e8fae6e7e19b045a78c54fd79", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NB72XtkjpnATMggui83aEtPawyyKvnbX2o", + "c3e55fceceaa4391ed2a9677f4a4d34eacd021a0", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KaBW9vNtWNhc3ZEDyNCiXLPdVPHCikRxSBWwV9NrpLLa4LsXi9", + "e75d936d56377f432f404aabb406601f892fd49da90eb6ac558a733c93b47252", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L1axzbSyynNYA8mCAhzxkipKkfHtAXYF4YQnhSKcLV8YXA874fgT", + "8248bd0375f2f75d7e274ae544fb920f51784480866b102384190b1addfbaa5c", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "927CnUkUbasYtDwYwVn2j8GdTuACNnKkjZ1rpZd2yBB1CLcnXpo", + "44c4f6a096eac5238291a94cc24c01e3b19b8d8cef72874a079e00a242237a52", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cUcfCMRjiQf85YMzzQEk9d1s5A4K7xL5SmBCLrezqXFuTVefyhY7", + "d1de707020a9059d6d3abaf85e17967c6555151143db13dbb06db78df0f15c69", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1Gqk4Tv79P91Cc1STQtU3s1W6277M2CVWu", + "adc1cc2081a27206fae25792f28bbc55b831549d", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "33vt8ViH5jsr115AGkW6cEmEz9MpvJSwDk", + "188f91a931947eddd7432d6e614387e32b244709", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mhaMcBxNh5cqXm4aTQ6EcVbKtfL6LGyK2H", + "1694f5bc1a7295b600f40018a618a6ea48eeb498", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2MxgPqX1iThW3oZVk9KoFcE5M4JpiETssVN", + "3b9b3fd7a50d4f08d1a5b0f62f644fa7115ae2f3", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5HtH6GdcwCJA4ggWEL1B3jzBBUB8HPiBi9SBc5h9i4Wk4PSeApR", + "091035445ef105fa1bb125eccfb1882f3fe69592265956ade751fd095033d8d0", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L2xSYmMeVo3Zek3ZTsv9xUrXVAmrWxJ8Ua4cw8pkfbQhcEFhkXT8", + "ab2b4bcdfc91d34dee0ae2a8c6b6668dadaeb3a88b9859743156f462325187af", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "92xFEve1Z9N8Z641KQQS7ByCSb8kGjsDzw6fAmjHN1LZGKQXyMq", + "b4204389cef18bbe2b353623cbf93e8678fbc92a475b664ae98ed594e6cf0856", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cVM65tdYu1YK37tNoAyGoJTR13VBYFva1vg9FLuPAsJijGvG6NEA", + "e7b230133f1b5489843260236b06edca25f66adb1be455fbd38d4010d48faeef", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "1JwMWBVLtiqtscbaRHai4pqHokhFCbtoB4", + "c4c1b72491ede1eedaca00618407ee0b772cad0d", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3QCzvfL4ZRvmJFiWWBVwxfdaNBT8EtxB5y", + "f6fe69bcb548a829cce4c57bf6fff8af3a5981f9", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "mizXiucXRCsEriQCHUkCqef9ph9qtPbZZ6", + "261f83568a098a8638844bd7aeca039d5f2352c0", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2NEWDzHWwY5ZZp8CQWbB7ouNMLqCia6YRda", + "e930e1834a4d234702773951d627cce82fbb5d2e", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KQmDryMNDcisTzRp3zEq9e4awRmJrEVU1j5vFRTKpRNYPqYrMg", + "d1fab7ab7385ad26872237f1eb9789aa25cc986bacc695e07ac571d6cdac8bc0", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "L39Fy7AC2Hhj95gh3Yb2AU5YHh1mQSAHgpNixvm27poizcJyLtUi", + "b0bbede33ef254e8376aceb1510253fc3550efd0fcf84dcd0c9998b288f166b3", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "91cTVUcgydqyZLgaANpf1fvL55FH53QMm4BsnCADVNYuWuqdVys", + "037f4192c630f399d9271e26c575269b1d15be553ea1a7217f0cb8513cef41cb", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cQspfSzsgLeiJGB2u8vrAiWpCU4MxUT6JseWo2SjXy4Qbzn2fwDw", + "6251e205e8ad508bab5596bee086ef16cd4b239e0cc0c5d7c4e6035441e7d5de", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "19dcawoKcZdQz365WpXWMhX6QCUpR9SY4r", + "5eadaf9bb7121f0f192561a5a62f5e5f54210292", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "37Sp6Rv3y4kVd1nQ1JV5pfqXccHNyZm1x3", + "3f210e7277c899c3a155cc1c90f4106cbddeec6e", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "myoqcgYiehufrsnnkqdqbp69dddVDMopJu", + "c8a3c2a09a298592c3e180f02487cd91ba3400b5", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "2N7FuwuUuoTBrDFdrAZ9KxBmtqMLxce9i1C", + "99b31df7c9068d1481b596578ddbb4d3bd90baeb", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": true + } + ], + [ + "5KL6zEaMtPRXZKo1bbMq7JDjjo1bJuQcsgL33je3oY8uSJCR5b4", + "c7666842503db6dc6ea061f092cfb9c388448629a6fe868d068c42a488b478ae", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "KwV9KAfwbwt51veZWNscRTeZs9CKpojyu1MsPnaKTF5kz69H1UN2", + "07f0803fc5399e773555ab1e8939907e9badacc17ca129e67a2f5f2ff84351dd", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": false + } + ], + [ + "93N87D6uxSBzwXvpokpzg8FFmfQPmvX4xHoWQe3pLdYpbiwT5YV", + "ea577acfb5d1d14d3b7b195c321566f12f87d2b77ea3a53f68df7ebf8604a801", + { + "isCompressed": false, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "cMxXusSihaX58wpJ3tNuuUcZEQGt6DKJ1wEpxys88FFaQCYjku9h", + "0b3b34f0958d8a268193a9814da92c3e8b58b4a4378a542863e34ac289cd830c", + { + "isCompressed": true, + "isPrivkey": true, + "isTestnet": true + } + ], + [ + "13p1ijLwsnrcuyqcTvJXkq2ASdXqcnEBLE", + "1ed467017f043e91ed4c44b4e8dd674db211c4e6", + { + "addrType": "pubkey", + "isPrivkey": false, + "isTestnet": false + } + ], + [ + "3ALJH9Y951VCGcVZYAdpA3KchoP9McEj1G", + "5ece0cadddc415b1980f001785947120acdb36fc", + { + "addrType": "script", + "isPrivkey": false, + "isTestnet": false + } + ] +] diff --git a/src/uint256.h b/src/uint256.h index fc5ed26592..abd0b71e6f 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -306,7 +306,7 @@ public: psz += 2; // hex string to uint - static unsigned char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; + static const unsigned char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; const char* pbegin = psz; while (phexdigit[(unsigned char)*psz] || *psz == '0') psz++; diff --git a/src/util.cpp b/src/util.cpp index d1270348e0..296842acc3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -156,7 +156,7 @@ void RandAddSeedPerfmon() { RAND_add(pdata, nSize, nSize/100.0); memset(pdata, 0, nSize); - printf("RandAddSeed() %d bytes\n", nSize); + printf("RandAddSeed() %lu bytes\n", nSize); } #endif } @@ -274,7 +274,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...) return ret; } -string vstrprintf(const std::string &format, va_list ap) +string vstrprintf(const char *format, va_list ap) { char buffer[50000]; char* p = buffer; @@ -284,7 +284,11 @@ string vstrprintf(const std::string &format, va_list ap) { va_list arg_ptr; va_copy(arg_ptr, ap); - ret = _vsnprintf(p, limit, format.c_str(), arg_ptr); +#ifdef WIN32 + ret = _vsnprintf(p, limit, format, arg_ptr); +#else + ret = vsnprintf(p, limit, format, arg_ptr); +#endif va_end(arg_ptr); if (ret >= 0 && ret < limit) break; @@ -301,7 +305,7 @@ string vstrprintf(const std::string &format, va_list ap) return str; } -string real_strprintf(const std::string &format, int dummy, ...) +string real_strprintf(const char *format, int dummy, ...) { va_list arg_ptr; va_start(arg_ptr, dummy); @@ -310,6 +314,15 @@ string real_strprintf(const std::string &format, int dummy, ...) return str; } +string real_strprintf(const std::string &format, int dummy, ...) +{ + va_list arg_ptr; + va_start(arg_ptr, dummy); + string str = vstrprintf(format.c_str(), arg_ptr); + va_end(arg_ptr); + return str; +} + bool error(const char *format, ...) { va_list arg_ptr; @@ -411,7 +424,7 @@ bool ParseMoney(const char* pszIn, int64& nRet) } -static signed char phexdigit[256] = +static const signed char phexdigit[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, diff --git a/src/util.h b/src/util.h index 2409ccb79c..d80b3c28b2 100644 --- a/src/util.h +++ b/src/util.h @@ -41,7 +41,6 @@ static const int64 CENT = 1000000; #define UBEGIN(a) ((unsigned char*)&(a)) #define UEND(a) ((unsigned char*)&((&(a))[1])) #define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) -#define printf OutputDebugStringF #ifndef PRI64d #if defined(_MSC_VER) || defined(__MSVCRT__) @@ -55,6 +54,26 @@ static const int64 CENT = 1000000; #endif #endif +/* Format characters for (s)size_t and ptrdiff_t */ +#if defined(_MSC_VER) || defined(__MSVCRT__) + /* (s)size_t and ptrdiff_t have the same size specifier in MSVC: + http://msdn.microsoft.com/en-us/library/tcxf1dw6%28v=vs.100%29.aspx + */ + #define PRIszx "Ix" + #define PRIszu "Iu" + #define PRIszd "Id" + #define PRIpdx "Ix" + #define PRIpdu "Iu" + #define PRIpdd "Id" +#else /* C99 standard */ + #define PRIszx "zx" + #define PRIszu "zu" + #define PRIszd "zd" + #define PRIpdx "tx" + #define PRIpdu "tu" + #define PRIpdd "td" +#endif + // This is needed because the foreach macro can't get over the comma in pair<t1, t2> #define PAIRTYPE(t1, t2) std::pair<t1, t2> @@ -80,11 +99,7 @@ T* alignup(T* p) #define S_IRUSR 0400 #define S_IWUSR 0200 #endif -#define unlink _unlink #else -#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) -#define strlwr(psz) to_lower(psz) -#define _strlwr(psz) to_lower(psz) #define MAX_PATH 1024 inline void Sleep(int64 n) { @@ -94,6 +109,15 @@ inline void Sleep(int64 n) } #endif +/* This GNU C extension enables the compiler to check the format string against the parameters provided. + * X is the number of the "format string" parameter, and Y is the number of the first variadic parameter. + * Parameters count from 1. + */ +#ifdef __GNUC__ +#define ATTR_WARN_PRINTF(X,Y) __attribute__((format(printf,X,Y))) +#else +#define ATTR_WARN_PRINTF(X,Y) +#endif @@ -121,18 +145,34 @@ extern bool fReopenDebugLog; void RandAddSeed(); void RandAddSeedPerfmon(); -int OutputDebugStringF(const char* pszFormat, ...); -int my_snprintf(char* buffer, size_t limit, const char* format, ...); +int ATTR_WARN_PRINTF(1,2) OutputDebugStringF(const char* pszFormat, ...); -/* It is not allowed to use va_start with a pass-by-reference argument. - (C++ standard, 18.7, paragraph 3). Use a dummy argument to work around this, and use a - macro to keep similar semantics. +/* + Rationale for the real_strprintf / strprintf construction: + It is not allowed to use va_start with a pass-by-reference argument. + (C++ standard, 18.7, paragraph 3). Use a dummy argument to work around this, and use a + macro to keep similar semantics. */ + +/** Overload strprintf for char*, so that GCC format type warnings can be given */ +std::string ATTR_WARN_PRINTF(1,3) real_strprintf(const char *format, int dummy, ...); +/** Overload strprintf for std::string, to be able to use it with _ (translation). + * This will not support GCC format type warnings (-Wformat) so be careful. + */ std::string real_strprintf(const std::string &format, int dummy, ...); #define strprintf(format, ...) real_strprintf(format, 0, __VA_ARGS__) -std::string vstrprintf(const std::string &format, va_list ap); +std::string vstrprintf(const char *format, va_list ap); + +bool ATTR_WARN_PRINTF(1,2) error(const char *format, ...); + +/* Redefine printf so that it directs output to debug.log + * + * Do this *after* defining the other printf-like functions, because otherwise the + * __attribute__((format(printf,X,Y))) gets expanded to __attribute__((format(OutputDebugStringF,X,Y))) + * which confuses gcc. + */ +#define printf OutputDebugStringF -bool error(const char *format, ...); void LogException(std::exception* pex, const char* pszThread); void PrintException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); @@ -237,9 +277,9 @@ inline int64 abs64(int64 n) template<typename T> std::string HexStr(const T itbegin, const T itend, bool fSpaces=false) { - std::vector<char> rv; - static char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + std::string rv; + static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; rv.reserve((itend-itbegin)*3); for(T it = itbegin; it < itend; ++it) { @@ -250,7 +290,7 @@ std::string HexStr(const T itbegin, const T itend, bool fSpaces=false) rv.push_back(hexmap[val&15]); } - return std::string(rv.begin(), rv.end()); + return rv; } inline std::string HexStr(const std::vector<unsigned char>& vch, bool fSpaces=false) @@ -366,20 +406,6 @@ bool SoftSetBoolArg(const std::string& strArg, bool fValue); -// Randomize the stack to help protect against buffer overrun exploits -#define IMPLEMENT_RANDOMIZE_STACK(ThreadFn) \ - { \ - static char nLoops; \ - if (nLoops <= 0) \ - nLoops = GetRand(20) + 1; \ - if (nLoops-- > 1) \ - { \ - ThreadFn; \ - return; \ - } \ - } - - template<typename T1> inline uint256 Hash(const T1 pbegin, const T1 pend) { diff --git a/src/wallet.cpp b/src/wallet.cpp index 880f7aa8bd..f3e71f59aa 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -804,7 +804,7 @@ void CWallet::ReacceptWalletTransactions() // Update fSpent if a tx got spent somewhere else by a copy of wallet.dat if (txindex.vSpent.size() != wtx.vout.size()) { - printf("ERROR: ReacceptWalletTransactions() : txindex.vSpent.size() %d != wtx.vout.size() %d\n", txindex.vSpent.size(), wtx.vout.size()); + printf("ERROR: ReacceptWalletTransactions() : txindex.vSpent.size() %"PRIszu" != wtx.vout.size() %"PRIszu"\n", txindex.vSpent.size(), wtx.vout.size()); continue; } for (unsigned int i = 0; i < txindex.vSpent.size(); i++) @@ -960,7 +960,7 @@ int64 CWallet::GetImmatureBalance() const for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx& pcoin = (*it).second; - if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.GetDepthInMainChain() >= 2) + if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.IsInMainChain()) nTotal += GetCredit(pcoin); } } @@ -1424,7 +1424,7 @@ void CWallet::PrintWallet(const CBlock& block) if (mapWallet.count(block.vtx[0].GetHash())) { CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()]; - printf(" mine: %d %d %d", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit()); + printf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit()); } } printf("\n"); @@ -1511,7 +1511,7 @@ bool CWallet::TopUpKeyPool() if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey()))) throw runtime_error("TopUpKeyPool() : writing generated key failed"); setKeyPool.insert(nEnd); - printf("keypool added key %"PRI64d", size=%d\n", nEnd, setKeyPool.size()); + printf("keypool added key %"PRI64d", size=%"PRIszu"\n", nEnd, setKeyPool.size()); } } return true; diff --git a/src/walletdb.h b/src/walletdb.h index d339d4c3f1..f078481811 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -33,21 +33,10 @@ private: CWalletDB(const CWalletDB&); void operator=(const CWalletDB&); public: - bool ReadName(const std::string& strAddress, std::string& strName) - { - strName = ""; - return Read(std::make_pair(std::string("name"), strAddress), strName); - } - bool WriteName(const std::string& strAddress, const std::string& strName); bool EraseName(const std::string& strAddress); - bool ReadTx(uint256 hash, CWalletTx& wtx) - { - return Read(std::make_pair(std::string("tx"), hash), wtx); - } - bool WriteTx(uint256 hash, const CWalletTx& wtx) { nWalletDBUpdated++; @@ -60,12 +49,6 @@ public: return Erase(std::make_pair(std::string("tx"), hash)); } - bool ReadKey(const CPubKey& vchPubKey, CPrivKey& vchPrivKey) - { - vchPrivKey.clear(); - return Read(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey); - } - bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey) { nWalletDBUpdated++; @@ -91,13 +74,6 @@ public: return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); } - // Support for BIP 0013 : see https://en.bitcoin.it/wiki/BIP_0013 - bool ReadCScript(const uint160 &hash, CScript& redeemScript) - { - redeemScript.clear(); - return Read(std::make_pair(std::string("cscript"), hash), redeemScript); - } - bool WriteCScript(const uint160& hash, const CScript& redeemScript) { nWalletDBUpdated++; @@ -121,12 +97,6 @@ public: return Write(std::string("orderposnext"), nOrderPosNext); } - bool ReadDefaultKey(std::vector<unsigned char>& vchPubKey) - { - vchPubKey.clear(); - return Read(std::string("defaultkey"), vchPubKey); - } - bool WriteDefaultKey(const CPubKey& vchPubKey) { nWalletDBUpdated++; |