aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--COPYING (renamed from license.txt)0
l---------README1
-rw-r--r--base58.h201
-rw-r--r--contrib/Bitcoin.app/Contents/Info.plist32
-rw-r--r--contrib/Bitcoin.app/Contents/MacOS/.higit0
-rw-r--r--contrib/Bitcoin.app/Contents/Resources/BitcoinAppIcon.icnsbin0 -> 286031 bytes
-rw-r--r--contrib/gitian-win32.yml84
-rw-r--r--contrib/gitian.yml30
-rw-r--r--contrib/wx-patches/README4
-rw-r--r--contrib/wx-patches/toplevel.cpp.diff86
-rw-r--r--contrib/wx-patches/toplevel.h.diff9
-rw-r--r--doc/README45
-rw-r--r--doc/README_windows.txt2
-rw-r--r--doc/build-msw.txt (renamed from build-msw.txt)13
-rw-r--r--doc/build-osx.txt (renamed from build-osx.txt)89
-rw-r--r--doc/build-unix.txt (renamed from build-unix.txt)13
-rw-r--r--doc/coding.txt (renamed from coding.txt)0
-rw-r--r--doc/release-process.txt45
-rw-r--r--locale/cs/LC_MESSAGES/bitcoin.mobin0 -> 20692 bytes
-rw-r--r--locale/cs/LC_MESSAGES/bitcoin.po1079
-rw-r--r--locale/de/LC_MESSAGES/bitcoin.mobin16242 -> 24800 bytes
-rw-r--r--locale/de/LC_MESSAGES/bitcoin.po891
-rw-r--r--locale/eo/LC_MESSAGES/bitcoin.mobin0 -> 20523 bytes
-rw-r--r--locale/eo/LC_MESSAGES/bitcoin.po1029
-rw-r--r--locale/es/LC_MESSAGES/bitcoin.mobin16064 -> 20718 bytes
-rw-r--r--locale/es/LC_MESSAGES/bitcoin.po939
-rw-r--r--locale/fr/LC_MESSAGES/bitcoin.po5
-rw-r--r--locale/it/LC_MESSAGES/bitcoin.mobin15725 -> 20832 bytes
-rw-r--r--locale/it/LC_MESSAGES/bitcoin.po874
-rw-r--r--locale/lt/LC_MESSAGES/bitcoin.mobin0 -> 19060 bytes
-rw-r--r--locale/lt/LC_MESSAGES/bitcoin.po971
-rw-r--r--locale/nl/LC_MESSAGES/bitcoin.mobin15598 -> 20886 bytes
-rw-r--r--locale/nl/LC_MESSAGES/bitcoin.po824
-rw-r--r--locale/pl/LC_MESSAGES/bitcoin.po1082
-rw-r--r--locale/pt/LC_MESSAGES/bitcoin.po5
-rw-r--r--locale/ru/LC_MESSAGES/bitcoin.mobin21763 -> 25742 bytes
-rw-r--r--locale/ru/LC_MESSAGES/bitcoin.po918
-rw-r--r--locale/sv/LC_MESSAGES/bitcoin.mobin0 -> 20407 bytes
-rw-r--r--locale/sv/LC_MESSAGES/bitcoin.po973
-rw-r--r--locale/zh_cn/LC_MESSAGES/bitcoin.mobin0 -> 19663 bytes
-rw-r--r--locale/zh_cn/LC_MESSAGES/bitcoin.po967
-rw-r--r--rc/bitcoin.icobin25782 -> 0 bytes
-rw-r--r--sha256.cpp475
-rw-r--r--share/pixmaps/addressbook16.bmp (renamed from rc/addressbook16.bmp)bin1334 -> 1334 bytes
-rw-r--r--share/pixmaps/addressbook16mask.bmp (renamed from rc/addressbook16mask.bmp)bin126 -> 126 bytes
-rw-r--r--share/pixmaps/addressbook20.bmp (renamed from rc/addressbook20.bmp)bin1478 -> 1478 bytes
-rw-r--r--share/pixmaps/addressbook20mask.bmp (renamed from rc/addressbook20mask.bmp)bin142 -> 142 bytes
-rw-r--r--share/pixmaps/bitcoin-bc.ico (renamed from rc/bitcoin-bc.ico)bin22486 -> 22486 bytes
-rw-r--r--share/pixmaps/bitcoin.icobin0 -> 93256 bytes
-rw-r--r--share/pixmaps/check.ico (renamed from rc/check.ico)bin766 -> 766 bytes
-rw-r--r--share/pixmaps/favicon.ico (renamed from rc/favicon.ico)bin2550 -> 2550 bytes
-rw-r--r--share/pixmaps/nsis-header.bmpbin0 -> 25818 bytes
-rw-r--r--share/pixmaps/nsis-wizard.bmpbin0 -> 154542 bytes
-rw-r--r--share/pixmaps/send16.bmp (renamed from rc/send16.bmp)bin1334 -> 1334 bytes
-rw-r--r--share/pixmaps/send16mask.bmp (renamed from rc/send16mask.bmp)bin126 -> 126 bytes
-rw-r--r--share/pixmaps/send16masknoshadow.bmp (renamed from rc/send16masknoshadow.bmp)bin126 -> 126 bytes
-rw-r--r--share/pixmaps/send20.bmp (renamed from rc/send20.bmp)bin1478 -> 1478 bytes
-rw-r--r--share/pixmaps/send20mask.bmp (renamed from rc/send20mask.bmp)bin142 -> 142 bytes
-rw-r--r--share/setup.nsi (renamed from setup.nsi)29
-rw-r--r--share/ui.rc15
-rw-r--r--share/uiproject.fbp (renamed from uiproject.fbp)218
-rw-r--r--src/base58.h308
-rw-r--r--src/bignum.h (renamed from bignum.h)16
-rw-r--r--src/crypter.cpp132
-rw-r--r--src/crypter.h96
-rw-r--r--src/cryptopp/License.txt (renamed from cryptopp/License.txt)0
-rw-r--r--src/cryptopp/Readme.txt (renamed from cryptopp/Readme.txt)0
-rw-r--r--src/cryptopp/config.h (renamed from cryptopp/config.h)0
-rw-r--r--src/cryptopp/cpu.cpp (renamed from cryptopp/cpu.cpp)2
-rw-r--r--src/cryptopp/cpu.h (renamed from cryptopp/cpu.h)0
-rw-r--r--src/cryptopp/cryptlib.h (renamed from cryptopp/cryptlib.h)0
-rw-r--r--src/cryptopp/iterhash.h (renamed from cryptopp/iterhash.h)0
-rw-r--r--src/cryptopp/misc.h (renamed from cryptopp/misc.h)0
-rw-r--r--src/cryptopp/obj/.gitignore (renamed from cryptopp/obj/.gitignore)0
-rw-r--r--src/cryptopp/pch.h (renamed from cryptopp/pch.h)0
-rw-r--r--src/cryptopp/secblock.h (renamed from cryptopp/secblock.h)0
-rw-r--r--src/cryptopp/sha.cpp (renamed from cryptopp/sha.cpp)0
-rw-r--r--src/cryptopp/sha.h (renamed from cryptopp/sha.h)0
-rw-r--r--src/cryptopp/simple.h (renamed from cryptopp/simple.h)0
-rw-r--r--src/cryptopp/smartptr.h (renamed from cryptopp/smartptr.h)0
-rw-r--r--src/cryptopp/stdcpp.h (renamed from cryptopp/stdcpp.h)0
-rw-r--r--src/db.cpp (renamed from db.cpp)246
-rw-r--r--src/db.h (renamed from db.h)210
-rw-r--r--src/headers.h (renamed from headers.h)37
-rw-r--r--src/init.cpp (renamed from init.cpp)85
-rw-r--r--src/init.h (renamed from init.h)7
-rw-r--r--src/irc.cpp (renamed from irc.cpp)60
-rw-r--r--src/irc.h (renamed from irc.h)7
-rw-r--r--src/json/LICENSE.txt (renamed from json/LICENSE.txt)0
-rw-r--r--src/json/json_spirit.h (renamed from json/json_spirit.h)0
-rw-r--r--src/json/json_spirit_error_position.h (renamed from json/json_spirit_error_position.h)0
-rw-r--r--src/json/json_spirit_reader.cpp (renamed from json/json_spirit_reader.cpp)0
-rw-r--r--src/json/json_spirit_reader.h (renamed from json/json_spirit_reader.h)0
-rw-r--r--src/json/json_spirit_reader_template.h (renamed from json/json_spirit_reader_template.h)0
-rw-r--r--src/json/json_spirit_stream_reader.h (renamed from json/json_spirit_stream_reader.h)0
-rw-r--r--src/json/json_spirit_utils.h (renamed from json/json_spirit_utils.h)0
-rw-r--r--src/json/json_spirit_value.cpp (renamed from json/json_spirit_value.cpp)0
-rw-r--r--src/json/json_spirit_value.h (renamed from json/json_spirit_value.h)0
-rw-r--r--src/json/json_spirit_writer.cpp (renamed from json/json_spirit_writer.cpp)0
-rw-r--r--src/json/json_spirit_writer.h (renamed from json/json_spirit_writer.h)0
-rw-r--r--src/json/json_spirit_writer_template.h (renamed from json/json_spirit_writer_template.h)0
-rw-r--r--src/key.h (renamed from key.h)112
-rw-r--r--src/keystore.cpp170
-rw-r--r--src/keystore.h120
-rw-r--r--src/main.cpp (renamed from main.cpp)1700
-rw-r--r--src/main.h (renamed from main.h)727
-rw-r--r--src/makefile.linux-mingw106
-rw-r--r--src/makefile.mingw (renamed from makefile.mingw)25
-rw-r--r--src/makefile.osx (renamed from makefile.osx)14
-rw-r--r--src/makefile.unix (renamed from makefile.unix)27
-rw-r--r--src/makefile.vc (renamed from makefile.vc)47
-rw-r--r--src/net.cpp (renamed from net.cpp)381
-rw-r--r--src/net.h (renamed from net.h)188
-rw-r--r--src/noui.h (renamed from noui.h)16
-rw-r--r--src/obj/.gitignore (renamed from obj/.gitignore)0
-rw-r--r--src/obj/nogui/.gitignore (renamed from obj/nogui/.gitignore)0
-rw-r--r--src/obj/test/.gitignore2
-rw-r--r--src/rpc.cpp (renamed from rpc.cpp)814
-rw-r--r--src/rpc.h (renamed from rpc.h)1
-rw-r--r--src/script.cpp (renamed from script.cpp)108
-rw-r--r--src/script.h (renamed from script.h)90
-rw-r--r--src/serialize.h (renamed from serialize.h)155
-rw-r--r--src/strlcpy.h (renamed from strlcpy.h)4
-rw-r--r--src/test/README21
-rw-r--r--src/test/script_tests.cpp173
-rw-r--r--src/test/test_bitcoin.cpp18
-rw-r--r--src/test/transaction_tests.cpp25
-rw-r--r--src/test/uint160_tests.cpp18
-rw-r--r--src/test/uint256_tests.cpp18
-rw-r--r--src/ui.cpp (renamed from ui.cpp)675
-rw-r--r--src/ui.h (renamed from ui.h)53
-rw-r--r--src/uibase.cpp (renamed from uibase.cpp)37
-rw-r--r--src/uibase.h (renamed from uibase.h)56
-rw-r--r--src/uint256.h (renamed from uint256.h)17
-rw-r--r--src/util.cpp (renamed from util.cpp)163
-rw-r--r--src/util.h (renamed from util.h)160
-rw-r--r--src/wallet.cpp1352
-rw-r--r--src/wallet.h640
-rw-r--r--src/xpm/about.xpm (renamed from xpm/about.xpm)0
-rw-r--r--src/xpm/addressbook16.xpm (renamed from xpm/addressbook16.xpm)0
-rw-r--r--src/xpm/addressbook20.xpm (renamed from xpm/addressbook20.xpm)0
-rw-r--r--src/xpm/bitcoin16.xpm (renamed from xpm/bitcoin16.xpm)0
-rw-r--r--src/xpm/bitcoin20.xpm (renamed from xpm/bitcoin20.xpm)0
-rw-r--r--src/xpm/bitcoin32.xpm (renamed from xpm/bitcoin32.xpm)0
-rw-r--r--src/xpm/bitcoin48.xpm (renamed from xpm/bitcoin48.xpm)0
-rw-r--r--src/xpm/bitcoin80.xpm (renamed from xpm/bitcoin80.xpm)0
-rw-r--r--src/xpm/check.xpm (renamed from xpm/check.xpm)0
-rw-r--r--src/xpm/send16.xpm (renamed from xpm/send16.xpm)0
-rw-r--r--src/xpm/send16noshadow.xpm (renamed from xpm/send16noshadow.xpm)0
-rw-r--r--src/xpm/send20.xpm (renamed from xpm/send20.xpm)0
-rw-r--r--ui.rc15
152 files changed, 15302 insertions, 6108 deletions
diff --git a/.gitignore b/.gitignore
index 1990117cfd..aeeef170e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
-*.exe
-bitcoin
-bitcoind
+src/*.exe
+src/bitcoin
+src/bitcoind
+.*.swp
+*.*~*
diff --git a/license.txt b/COPYING
index ab042014e8..ab042014e8 100644
--- a/license.txt
+++ b/COPYING
diff --git a/README b/README
new file mode 120000
index 0000000000..42061c01a1
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+README.md \ No newline at end of file
diff --git a/base58.h b/base58.h
deleted file mode 100644
index 828f8d578d..0000000000
--- a/base58.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
-
-//
-// Why base-58 instead of standard base-64 encoding?
-// - Don't want 0OIl characters that look the same in some fonts and
-// could be used to create visually identical looking account numbers.
-// - A string with non-alphanumeric characters is not as easily accepted as an account number.
-// - E-mail usually won't line-break if there's no punctuation to break at.
-// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
-//
-
-
-static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
-
-
-inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
-{
- CAutoBN_CTX pctx;
- CBigNum bn58 = 58;
- CBigNum bn0 = 0;
-
- // Convert big endian data to little endian
- // Extra zero at the end make sure bignum will interpret as a positive number
- vector<unsigned char> vchTmp(pend-pbegin+1, 0);
- reverse_copy(pbegin, pend, vchTmp.begin());
-
- // Convert little endian data to bignum
- CBigNum bn;
- bn.setvch(vchTmp);
-
- // Convert bignum to string
- string str;
- str.reserve((pend - pbegin) * 138 / 100 + 1);
- CBigNum dv;
- CBigNum rem;
- while (bn > bn0)
- {
- if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
- throw bignum_error("EncodeBase58 : BN_div failed");
- bn = dv;
- unsigned int c = rem.getulong();
- str += pszBase58[c];
- }
-
- // Leading zeroes encoded as base58 zeros
- for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
- str += pszBase58[0];
-
- // Convert little endian string to big endian
- reverse(str.begin(), str.end());
- return str;
-}
-
-inline string EncodeBase58(const vector<unsigned char>& vch)
-{
- return EncodeBase58(&vch[0], &vch[0] + vch.size());
-}
-
-inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
-{
- CAutoBN_CTX pctx;
- vchRet.clear();
- CBigNum bn58 = 58;
- CBigNum bn = 0;
- CBigNum bnChar;
- while (isspace(*psz))
- psz++;
-
- // Convert big endian string to bignum
- for (const char* p = psz; *p; p++)
- {
- const char* p1 = strchr(pszBase58, *p);
- if (p1 == NULL)
- {
- while (isspace(*p))
- p++;
- if (*p != '\0')
- return false;
- break;
- }
- bnChar.setulong(p1 - pszBase58);
- if (!BN_mul(&bn, &bn, &bn58, pctx))
- throw bignum_error("DecodeBase58 : BN_mul failed");
- bn += bnChar;
- }
-
- // Get bignum as little endian data
- vector<unsigned char> vchTmp = bn.getvch();
-
- // Trim off sign byte if present
- if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
- vchTmp.erase(vchTmp.end()-1);
-
- // Restore leading zeros
- int nLeadingZeros = 0;
- for (const char* p = psz; *p == pszBase58[0]; p++)
- nLeadingZeros++;
- vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
-
- // Convert little endian data to big endian
- reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
- return true;
-}
-
-inline bool DecodeBase58(const string& str, vector<unsigned char>& vchRet)
-{
- return DecodeBase58(str.c_str(), vchRet);
-}
-
-
-
-
-
-inline string EncodeBase58Check(const vector<unsigned char>& vchIn)
-{
- // add 4-byte hash check to the end
- vector<unsigned char> vch(vchIn);
- uint256 hash = Hash(vch.begin(), vch.end());
- vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
- return EncodeBase58(vch);
-}
-
-inline bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet)
-{
- if (!DecodeBase58(psz, vchRet))
- return false;
- if (vchRet.size() < 4)
- {
- vchRet.clear();
- return false;
- }
- uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
- if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
- {
- vchRet.clear();
- return false;
- }
- vchRet.resize(vchRet.size()-4);
- return true;
-}
-
-inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
-{
- return DecodeBase58Check(str.c_str(), vchRet);
-}
-
-
-
-
-
-
-#define ADDRESSVERSION ((unsigned char)(fTestNet ? 111 : 0))
-
-inline string Hash160ToAddress(uint160 hash160)
-{
- // add 1-byte version number to the front
- vector<unsigned char> vch(1, ADDRESSVERSION);
- vch.insert(vch.end(), UBEGIN(hash160), UEND(hash160));
- return EncodeBase58Check(vch);
-}
-
-inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
-{
- vector<unsigned char> vch;
- if (!DecodeBase58Check(psz, vch))
- return false;
- if (vch.empty())
- return false;
- unsigned char nVersion = vch[0];
- if (vch.size() != sizeof(hash160Ret) + 1)
- return false;
- memcpy(&hash160Ret, &vch[1], sizeof(hash160Ret));
- return (nVersion <= ADDRESSVERSION);
-}
-
-inline bool AddressToHash160(const string& str, uint160& hash160Ret)
-{
- return AddressToHash160(str.c_str(), hash160Ret);
-}
-
-inline bool IsValidBitcoinAddress(const char* psz)
-{
- uint160 hash160;
- return AddressToHash160(psz, hash160);
-}
-
-inline bool IsValidBitcoinAddress(const string& str)
-{
- return IsValidBitcoinAddress(str.c_str());
-}
-
-
-
-
-inline string PubKeyToAddress(const vector<unsigned char>& vchPubKey)
-{
- return Hash160ToAddress(Hash160(vchPubKey));
-}
diff --git a/contrib/Bitcoin.app/Contents/Info.plist b/contrib/Bitcoin.app/Contents/Info.plist
new file mode 100644
index 0000000000..bfeb2f8de4
--- /dev/null
+++ b/contrib/Bitcoin.app/Contents/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>Bitcoin</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>bitcoin</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.bitcoin.bitcoin</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Bitcoin</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.3.25</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>325</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.5</string>
+ <key>CFBundleIconFile</key>
+ <string>BitcoinAppIcon.icns</string>
+ <key>LSMultipleInstancesProhibited</key>
+ <true/>
+</dict>
+</plist>
diff --git a/contrib/Bitcoin.app/Contents/MacOS/.higit b/contrib/Bitcoin.app/Contents/MacOS/.higit
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/contrib/Bitcoin.app/Contents/MacOS/.higit
diff --git a/contrib/Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns b/contrib/Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
new file mode 100644
index 0000000000..033ce1a607
--- /dev/null
+++ b/contrib/Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
Binary files differ
diff --git a/contrib/gitian-win32.yml b/contrib/gitian-win32.yml
new file mode 100644
index 0000000000..07d31c717e
--- /dev/null
+++ b/contrib/gitian-win32.yml
@@ -0,0 +1,84 @@
+---
+name: "bitcoin"
+suites:
+- "lucid"
+architectures:
+- "i386"
+packages:
+- "mingw32"
+- "git-core"
+- "unzip"
+- "nsis"
+reference_datetime: "2011-01-30 00:00:00"
+remotes:
+- "url": "https://github.com/bitcoin/bitcoin.git"
+ "dir": "bitcoin"
+files:
+- "wxWidgets-2.9.1.tar.bz2"
+- "boost_1_43_0.tar.bz2"
+- "openssl-1.0.0d.tar.gz"
+- "db-4.7.25.NC.tar.gz"
+- "upnpc-exe-win32-20110215.zip"
+- "miniupnpc-1.5.20110215.tar.gz"
+- "WSPiApi.h"
+script: |
+ #
+ tar xjf wxWidgets-2.9.1.tar.bz2
+ cd wxWidgets-2.9.1
+ ./configure --host=i586-mingw32msvc --build=i686-linux --disable-shared --enable-monolithic --without-libpng --disable-svg
+ perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h
+ make $MAKEOPTS
+ cd ..
+ #
+ tar xzf openssl-1.0.0d.tar.gz
+ cd openssl-1.0.0d
+ ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw
+ make
+ cd ..
+ #
+ tar xzf db-4.7.25.NC.tar.gz
+ cd db-4.7.25.NC/build_unix
+ ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include"
+ make $MAKEOPTS
+ cd ../..
+ #
+ tar xjf boost_1_43_0.tar.bz2
+ cd boost_1_43_0
+ echo "using gcc : 4.4 : i586-mingw32msvc-g++
+ :
+ <rc>i586-mingw32msvc-windres
+ <archiver>i586-mingw32msvc-ar
+ ;" > user-config.jam
+ ./bootstrap.sh --without-icu
+ ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
+ cd ..
+ #
+ mkdir upnpc-exe-win32-20110215
+ cd upnpc-exe-win32-20110215
+ unzip ../upnpc-exe-win32-20110215.zip
+ mkdir miniupnpc
+ cd miniupnpc
+ tar xzf ../../miniupnpc-1.5.20110215.tar.gz
+ mv ./miniupnpc-1.5.20110215/* ./
+ cd ../..
+ #
+ cp WSPiApi.h $HOME/build
+ #
+ cd bitcoin
+ mkdir -p $OUTDIR/src
+ cp -a . $OUTDIR/src
+ rm -rf $OUTDIR/src/.git
+ cp -a $OUTDIR/src/locale $OUTDIR
+ cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt
+ cp $OUTDIR/src/COPYING $OUTDIR/license.txt
+ cd src
+ sed 's/$(DEBUGFLAGS)//' < makefile.linux-mingw > makefile.linux-mingw.2 && mv makefile.linux-mingw.2 makefile.linux-mingw
+ sed 's|//#include <WSPiApi.h>|#include <WSPiApi.h>|' < net.cpp > net.cpp.2 && mv net.cpp.2 net.cpp
+ make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoin.exe USE_UPNP=1
+ make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0
+ i586-mingw32msvc-strip bitcoin.exe
+ i586-mingw32msvc-strip bitcoind.exe
+ makensis ../share/setup.nsi
+ cp bitcoin.exe ../share/bitcoin-*-win32-setup.exe $OUTDIR/
+ mkdir $OUTDIR/daemon
+ cp bitcoind.exe $OUTDIR/daemon
diff --git a/contrib/gitian.yml b/contrib/gitian.yml
index 92385e50b2..90be8934fa 100644
--- a/contrib/gitian.yml
+++ b/contrib/gitian.yml
@@ -6,7 +6,7 @@ architectures:
- "i386"
- "amd64"
packages:
-- "libdb4.8++-dev"
+- "libdb4.7++-dev"
- "libxxf86vm-dev"
- "libgtk2.0-dev"
- "libboost-all-dev"
@@ -18,20 +18,40 @@ remotes:
"dir": "bitcoin"
files:
- "wxWidgets-2.9.1.tar.bz2"
+- "miniupnpc-1.5.tar.gz"
+- "toplevel.h.diff"
+- "toplevel.cpp.diff"
script: |
INSTDIR="$HOME/install"
export LIBRARY_PATH="$INSTDIR/lib"
+ #
+ tar xzf miniupnpc-1.5.tar.gz
+ cd miniupnpc-1.5
+ INSTALLPREFIX=$INSTDIR make $MAKEOPTS install
+ cd ..
+ #
tar xjf wxWidgets-2.9.1.tar.bz2
cd wxWidgets-2.9.1
+ cd include/wx/gtk
+ patch < ../../../../toplevel.h.diff
+ cd ../../../src/gtk
+ patch < ../../../toplevel.cpp.diff
+ cd ../..
./configure --prefix=$INSTDIR --enable-monolithic --disable-shared
perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h
make $MAKEOPTS install
- cd ../bitcoin
+ cd ..
+ #
+ cd bitcoin
mkdir -p $OUTDIR/src
cp -a . $OUTDIR/src
rm -rf $OUTDIR/src/.git
mv $OUTDIR/src/locale $OUTDIR
- cp $OUTDIR/src/license.txt $OUTDIR
- make -f makefile.unix $MAKEOPTS WXLIBS="-Wl,-Bstatic -l wx_gtk2u-2.9 -Wl,-Bdynamic -l gtk-x11-2.0 -l SM -l Xxf86vm" INCLUDEPATHS="`$INSTDIR/bin/wx-config --cflags`" bitcoin bitcoind
+ cp $OUTDIR/src/doc/README $OUTDIR
+ cp $OUTDIR/src/COPYING $OUTDIR
+ cd src
+ sed 's/$(DEBUGFLAGS)//' < makefile.unix > makefile.unix.2 && mv makefile.unix.2 makefile.unix
+ PATH=$INSTDIR/bin:$PATH make -f makefile.unix CXX="g++ -I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoin USE_UPNP=1
+ PATH=$INSTDIR/bin:$PATH make -f makefile.unix CXX="g++ -I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0
mkdir -p $OUTDIR/bin/$GBUILD_BITS
- cp bitcoin bitcoind $OUTDIR/bin/$GBUILD_BITS
+ install -s bitcoin bitcoind $OUTDIR/bin/$GBUILD_BITS
diff --git a/contrib/wx-patches/README b/contrib/wx-patches/README
new file mode 100644
index 0000000000..2afb4a9e91
--- /dev/null
+++ b/contrib/wx-patches/README
@@ -0,0 +1,4 @@
+This folder contains two patches which are applied to wxWidgets
+2.9.1 before building the wxWidgets which is used for release
+versions of bitcoin. They make the GUI show up on newer OSs
+with new libgtks, such as Ubuntu 11.04.
diff --git a/contrib/wx-patches/toplevel.cpp.diff b/contrib/wx-patches/toplevel.cpp.diff
new file mode 100644
index 0000000000..359abf28d4
--- /dev/null
+++ b/contrib/wx-patches/toplevel.cpp.diff
@@ -0,0 +1,86 @@
+--- /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67326)
++++ /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67496)
+@@ -72,4 +72,8 @@
+ // send any activate events at all
+ static int g_sendActivateEvent = -1;
++
++// Whether _NET_REQUEST_FRAME_EXTENTS support is working
++// 0 == not tested yet, 1 == working, 2 == broken
++static int gs_requestFrameExtentsStatus;
+
+ //-----------------------------------------------------------------------------
+@@ -432,4 +436,12 @@
+ if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property)
+ {
++ if (win->m_netFrameExtentsTimerId)
++ {
++ // WM support for _NET_REQUEST_FRAME_EXTENTS is working
++ gs_requestFrameExtentsStatus = 1;
++ g_source_remove(win->m_netFrameExtentsTimerId);
++ win->m_netFrameExtentsTimerId = 0;
++ }
++
+ wxSize decorSize = win->m_decorSize;
+ int left, right, top, bottom;
+@@ -439,4 +451,22 @@
+ win->GTKUpdateDecorSize(decorSize);
+ }
++ return false;
++}
++}
++
++extern "C" {
++static gboolean request_frame_extents_timeout(void* data)
++{
++ // WM support for _NET_REQUEST_FRAME_EXTENTS is broken
++ gs_requestFrameExtentsStatus = 2;
++ gdk_threads_enter();
++ wxTopLevelWindowGTK* win = static_cast<wxTopLevelWindowGTK*>(data);
++ win->m_netFrameExtentsTimerId = 0;
++ wxSize decorSize = win->m_decorSize;
++ int left, right, top, bottom;
++ if (wxGetFrameExtents(gtk_widget_get_window(win->m_widget), &left, &right, &top, &bottom))
++ decorSize.Set(left + right, top + bottom);
++ win->GTKUpdateDecorSize(decorSize);
++ gdk_threads_leave();
+ return false;
+ }
+@@ -459,4 +489,5 @@
+ m_deferShowAllowed = true;
+ m_updateDecorSize = true;
++ m_netFrameExtentsTimerId = 0;
+
+ m_urgency_hint = -2;
+@@ -811,5 +842,6 @@
+ if (deferShow)
+ {
+- deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget);
++ deferShow = gs_requestFrameExtentsStatus != 2 &&
++ m_deferShowAllowed && !gtk_widget_get_realized(m_widget);
+ if (deferShow)
+ {
+@@ -829,11 +861,4 @@
+ // GetSize()/SetSize() because it makes window bigger between each
+ // restore and save.
+- m_updateDecorSize = deferShow;
+- }
+- if (deferShow)
+- {
+- // Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken
+- const char* name = gdk_x11_screen_get_window_manager_name(screen);
+- deferShow = strcmp(name, "Fluxbox") != 0;
+ m_updateDecorSize = deferShow;
+ }
+@@ -875,4 +900,12 @@
+ (XEvent*)&xevent);
+
++ if (gs_requestFrameExtentsStatus == 0)
++ {
++ // if WM does not respond to request within 1 second,
++ // we assume support for _NET_REQUEST_FRAME_EXTENTS is not working
++ m_netFrameExtentsTimerId =
++ g_timeout_add(1000, request_frame_extents_timeout, this);
++ }
++
+ // defer calling gtk_widget_show()
+ m_isShown = true;
diff --git a/contrib/wx-patches/toplevel.h.diff b/contrib/wx-patches/toplevel.h.diff
new file mode 100644
index 0000000000..c2718d4637
--- /dev/null
+++ b/contrib/wx-patches/toplevel.h.diff
@@ -0,0 +1,9 @@
+--- /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 65373)
++++ /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 67496)
+@@ -114,4 +114,6 @@
+ // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
+ int m_urgency_hint;
++ // timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling
++ unsigned m_netFrameExtentsTimerId;
+
+ // return the size of the window without WM decorations
diff --git a/doc/README b/doc/README
index 3137d0adc7..f72bca01f7 100644
--- a/doc/README
+++ b/doc/README
@@ -1,4 +1,4 @@
-Bitcoin 0.3.21 BETA
+Bitcoin 0.3.25 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
@@ -24,6 +24,49 @@ Unpack the files into a directory and run:
bin/64/bitcoin (GUI, 64-bit)
bin/64/bitcoind (headless, 64-bit)
+
+Wallet Encryption
+-----------------
+Bitcoin supports native wallet encryption so that people who steal your
+wallet file don't automatically get access to all of your Bitcoins.
+In order to enable this feature, chose "Encrypt Wallet" from the
+Options menu. You will be prompted to enter a passphrase, which
+will be used as the key to encrypt your wallet and will be needed
+every time you wish to send Bitcoins. If you lose this passphrase,
+you will lose access to spend all of the bitcoins in your wallet,
+no one, not even the Bitcoin developers can recover your Bitcoins.
+This means you are responsible for your own security, store your
+password in a secure location and do not forget it.
+
+Remember that the encryption built into bitcoin only encrypts the
+actual keys which are required to send your bitcoins, not the full
+wallet. This means that someone who steals your wallet file will
+be able to see all the addresses which belong to you, as well as the
+relevant transactions, you are only protected from someone spending
+your coins.
+
+It is recommended that you backup your wallet file before you
+encrypt your wallet. To do this, close the Bitcoin client and
+copy the wallet.dat file from ~/.bitcoin/ on Linux, /Users/(user
+name)/Application Support/Bitcoin/ on Mac OSX, and %APPDATA%/Bitcoin/
+on Windows (that is /Users/(user name)/AppData/Roaming/Bitcoin on
+Windows Vista and 7 and /Documents and Settings/(user name)/Application
+Data/Bitcoin on Windows XP). Once you have copied that file to a
+safe location, reopen the Bitcoin client and Encrypt your wallet.
+If everything goes fine, delete the backup and enjoy your encrypted
+wallet. Note that once you encrypt your wallet, you will never be
+able to go back to a version of the Bitcoin client older than 0.4.
+
+Keep in mind that you are always responsible for you own security.
+All it takes is a slightly more advanced wallet-stealing trojan which
+installs a keylogger to steal your wallet passphrase as you enter it
+in addition to your wallet file and you have lost all your Bitcoins.
+Wallet encryption cannot keep you safe if you do not practice
+good security, such as running up-to-date antivirus software, only
+entering your wallet passphrase in the Bitcoin client and using the
+same passphrase only as your wallet passphrase.
+
+
See the documentation at the bitcoin wiki:
https://en.bitcoin.it/wiki/Main_Page
diff --git a/doc/README_windows.txt b/doc/README_windows.txt
index 4c2065235b..e715b32068 100644
--- a/doc/README_windows.txt
+++ b/doc/README_windows.txt
@@ -1,4 +1,4 @@
-Bitcoin 0.3.21 BETA
+Bitcoin 0.3.25 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
diff --git a/build-msw.txt b/doc/build-msw.txt
index a28c7ef859..1911008d1f 100644
--- a/build-msw.txt
+++ b/doc/build-msw.txt
@@ -28,7 +28,7 @@ Libraries you need to download separately and build:
default path download
wxWidgets \wxwidgets-2.9.1-mgw http://www.wxwidgets.org/downloads/
-OpenSSL \openssl-1.0.0c-mgw http://www.openssl.org/source/
+OpenSSL \openssl-1.0.0d-mgw http://www.openssl.org/source/
Berkeley DB \db-4.7.25.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost-1.43.0-mgw http://www.boost.org/users/download/
miniupnpc \upnpc-exe-win32-20110215 http://miniupnp.tuxfamily.org/files/
@@ -42,7 +42,7 @@ miniupnpc New (3-clause) BSD license
Versions used in this release:
wxWidgets 2.9.1
-OpenSSL 1.0.0c
+OpenSSL 1.0.0d
Berkeley DB 4.7.25.NC
Boost 1.43.0
miniupnpc 1.5-20110215
@@ -66,15 +66,10 @@ 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.0c-mgw
+cd /c/openssl-1.0.0d-mgw
./config
make
-perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
-dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
-
-after that openssl libeay is in main source dir (openssl-1.0.0c-mgw)
-
Berkeley DB
-----------
MSYS shell:
@@ -106,7 +101,7 @@ Get miniupnpc-1.5.20110215.tar.gz and copy *.h to \upnpc-exe-win32-20110215\mini
Bitcoin
-------
DOS prompt:
-cd \bitcoin
+cd \bitcoin\src
mingw32-make bitcoin.exe bitcoind.exe -f makefile.mingw
strip bitcoin.exe
strip bitcoind.exe
diff --git a/build-osx.txt b/doc/build-osx.txt
index 79279838d3..ddf025003b 100644
--- a/build-osx.txt
+++ b/doc/build-osx.txt
@@ -1,14 +1,16 @@
Copyright (c) 2010 Laszlo Hanyecz
-Distributed under the MIT/X11 software license, see the accompanying
-file license.txt 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/). This product includes
-cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
-software written by Thomas Bernard.
+Portions Copyright (c) 2011 Douglas Huff
+Distributed under the MIT/X11 software license, see the accompanying file
+license.txt 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/). This product includes cryptographic
+software written by Eric Young (eay@cryptsoft.com) and UPnP software written by
+Thomas Bernard.
Mac OS X build instructions
-Laszlo Hanyecz (solar@heliacal.net)
+Laszlo Hanyecz <solar@heliacal.net>
+Douglas Huff <dhuff@jrbobdobbs.org>
Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
@@ -16,18 +18,19 @@ Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
All of the commands should be executed in Terminal.app.. it's in
/Applications/Utilities
-You need to install XCode with all the options checked so that the compiler
-and everything is available in /usr not just /Developer
-I think it comes on the DVD but you can get the current version from
-http://developer.apple.com
+You need to install XCode with all the options checked so that the compiler and
+everything is available in /usr not just /Developer I think it comes on the DVD
+but you can get the current version from http://developer.apple.com
1. Pick a directory to work inside.. something like ~/bitcoin works. The
structure I use looks like this:
+
(~ is your home directory)
~/bitcoin
-~/bitcoin/trunk # source code
+~/bitcoin/bitcoin # Upstream source tree
+~/bitcoin/src # source code (symlink to ~/bitcoin/bitcoin/src)
~/bitcoin/deps # dependencies.. like libraries and headers needed to compile
~/bitcoin/Bitcoin.app # the application bundle where you can run the app
@@ -38,12 +41,15 @@ WARNING: do not use the ~ notation with the configure scripts.. use the full
name of the directory, for example /Users/james/bitcoin/deps for a user named
'james'. In my examples I am using 'macosuser' so make sure you change that.
-2. Check out the trunk version of the bitcoin code from subversion:
+2. Check out the bitcoin code from github:
cd ~/bitcoin
-svn checkout https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk
+git clone https://github.com/bitcoin/bitcoin.git
+ln -s bitcoin/src src
-This will make ~/bitcoin/trunk for you with all the files from subversion.
+This will make ~/bitcoin/bitcoin for you with all the files from git. This puts
+the actual sources in ~/bitcoin/bitcoin/src and create a symlink src in
+~/bitcoin to this location.
3. Get and build the dependencies
@@ -80,6 +86,8 @@ This is what my output looked like at the end:
OpenSSL
-------
+(System or MacPorts openssl will work fine. Optional.)
+
Download from http://www.openssl.org/source/
We would like to build this as a 32 bit/64 bit library so we actually build it
@@ -113,13 +121,15 @@ file lib/libcrypto.a
output should look like this:
lib/libcrypto.a: Mach-O universal binary with 2 architectures
-lib/libcrypto.a (for architecture i386): current ar archive random library
-lib/libcrypto.a (for architecture x86_64): current ar archive random library
+lib/libcrypto.a (for architecture i386): current ar archive random library
+lib/libcrypto.a (for architecture x86_64): current ar archive random library
miniupnpc
---------
+(MacPorts miniupnpc package works fine. You will need to modify makefile.)
+
The process for miniupnpc (optional) is similar to that of OpenSSL.
Download from http://miniupnp.tuxfamily.org/files/.
@@ -153,13 +163,15 @@ file lib/libminiupnpc.a
output should look like this:
lib/libminiupnpc.a: Mach-O universal binary with 2 architectures
-lib/libminiupnpc.a (for architecture i386): current ar archive random library
-lib/libminiupnpc.a (for architecture x86_64): current ar archive random library
+lib/libminiupnpc.a (for architecture i386): current ar archive random library
+lib/libminiupnpc.a (for architecture x86_64): current ar archive random library
Berkeley DB
-----------
+(System or MacPorts version work fine.)
+
Download from http://freshmeat.net/projects/berkeleydb/
cd ~/bitcoin/deps
@@ -171,6 +183,8 @@ cd db-4.8.26/build_unix
wxWidgets
---------
+(The wxWidgets-devel MacPorts package will work but will throw annoying assertion dialogs.)
+
This is the big one..
Check it out from svn
@@ -236,26 +250,29 @@ make install
Now you should be able to build bitcoin
-cd ~/bitcoin/trunk
+cd ~/bitcoin/src
make -f makefile.osx bitcoin
Before you can run it, you need to create an application bundle for Mac OS.
-Create the directories in terminal using mkdir and copy the files into place.
-They are available at http://heliacal.net/~solar/bitcoin/mac-build/
-You need the Info.plist and the .ins file. The Contents/MacOS/bitcoin file is
-the output of the build.
-Your directory structure should look like this:
-
-Bitcoin.app
-Bitcoin.app/Contents
-Bitcoin.app/Contents/Info.plist
-Bitcoin.app/Contents/MacOS
-Bitcoin.app/Contents/MacOS/bitcoin
-Bitcoin.app/Contents/Resources
-Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
-
-To run it you can just click the Bitcoin.app in Finder, or just do open
-~/bitcoin/Bitcoin.app
+
+A bundle is provided in contrib/Bitcoin.app.
+
+Copy the bitcoin binary in to it like this:
+ cp -pR ~/bitcoin/bitcoin/contrib/Bitcoin.app ~/bitcoin/
+ cp ~/bitcoin/src/bitcoin ~/bitcoin/Bitcoin.app/Contents/MacOS/
+
+To run it you can just click the Bitcoin.app in Finder, or just do:
+open ~/bitcoin/Bitcoin.app
+
If you want to run it with arguments you can just run it without backgrounding
by specifying the full name in terminal:
+
~/bitcoin/Bitcoin.app/Contents/MacOS/bitcoin -addnode=192.75.207.66
+
+You can also run it with arguments in the background with output going to the
+normal places for apps (Console) like this:
+
+open ~/bitcoin/Bitcoin.app --args -connect=192.75.207.66
+
+It is advisable to relocate Bitcoin.app to /Applications or $HOME/Applications.
+
diff --git a/build-unix.txt b/doc/build-unix.txt
index b959f1a2d9..0c4e88e523 100644
--- a/build-unix.txt
+++ b/doc/build-unix.txt
@@ -13,6 +13,8 @@ UNIX BUILD NOTES
To Build
--------
+cd src/
+
make -f makefile.unix # Bitcoin with wxWidgets GUI
or
make -f makefile.unix bitcoind # Headless bitcoin
@@ -37,9 +39,12 @@ You need to download wxWidgets from http://www.wxwidgets.org/downloads/
and build it yourself. See the build instructions and configure parameters
below.
-Requires miniupnpc for UPnP port mapping. To compile with UPnP support,
-install miniupnpc and compile after setting USE_UPNP. It can be downloaded
-from http://miniupnp.tuxfamily.org/files/.
+Requires miniupnpc for UPnP port mapping. It can be downloaded from
+http://miniupnp.tuxfamily.org/files/. UPnP support is compiled in and
+turned off by default. Set USE_UPNP to a different value to control this:
+USE_UPNP= no UPnP support, miniupnp not required;
+USE_UPNP=0 (the default) UPnP support turned off by default at runtime;
+USE_UPNP=1 UPnP support turned on by default at runtime.
Licenses of statically linked libraries:
wxWidgets LGPL 2.1 with very liberal exceptions
@@ -73,7 +78,7 @@ tar -xzvf wxWidgets-2.9.0.tar.gz
cd wxWidgets-2.9.0
mkdir buildgtk
cd buildgtk
-../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
+../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg
make
sudo su
make install
diff --git a/coding.txt b/doc/coding.txt
index 4707476697..4707476697 100644
--- a/coding.txt
+++ b/doc/coding.txt
diff --git a/doc/release-process.txt b/doc/release-process.txt
new file mode 100644
index 0000000000..4940afefa5
--- /dev/null
+++ b/doc/release-process.txt
@@ -0,0 +1,45 @@
+* update (commit) version in sources
+
+* update (commit) version in OSX app bundle
+
+ * CFBundleShortVersionString should have value like 0.3.23
+ * CFBundleVersion should have value like 323
+
+* tag version in git
+
+ $ git tag -a v0.3.23
+
+* write release notes. git shortlog helps a lot:
+
+ $ git shortlog --no-merges v0.3.22..
+
+* create source-only archive
+
+ $ git archive --format=tar --prefix=bitcoin-0.3.23/ HEAD | \
+ gzip -9c > ~/tmp/bitcoin-0.3.23-src.tar.gz
+
+* perform gitian builds
+
+ * From the bitcoin source dir
+ $ cd ../gitian-builder
+ $ ./bin/gbuild --commit bitcoin=v0.3.23 ../bitcoin/contrib/gitian.yml
+ $ ./bin/gbuild --commit bitcoin=v0.3.23 ../bitcoin/contrib/gitian-win32.yml
+
+ Build output expected:
+ 1. linux 32-bit and 64-bit binaries + source
+ 2. windows 32-bit binary + source
+ 3. windows installer
+
+* upload source and builds to SF
+
+* create SHA1SUMS for builds, and PGP-sign it
+
+* update bitcoin.org version
+
+* update forum version
+
+* update wiki
+
+* update wiki download links
+
+
diff --git a/locale/cs/LC_MESSAGES/bitcoin.mo b/locale/cs/LC_MESSAGES/bitcoin.mo
new file mode 100644
index 0000000000..80354cf764
--- /dev/null
+++ b/locale/cs/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/cs/LC_MESSAGES/bitcoin.po b/locale/cs/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..2275d901bf
--- /dev/null
+++ b/locale/cs/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,1079 @@
+# This file is distributed under the same license as the Bitcoin package.
+# xHire <xhire@mujmalysvet.cz>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-08-16 15:51+0100\n"
+"PO-Revision-Date: 2011-08-16 16:03+0100\n"
+"Last-Translator: xHire <xhire@mujmalysvet.cz>\n"
+"Language-Team: \n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/uibase.cpp:25
+#: ../../../src/ui.cpp:2985
+msgid "E&xit"
+msgstr "&Konec"
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "&Soubor"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "Tvá Bitcoinová &adresa..."
+
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "&Zašifruj peněženku..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "Změň &heslo pro šifrování peněženky..."
+
+#: ../../../src/uibase.cpp:42
+msgid "&Options..."
+msgstr "M&ožnosti"
+
+#: ../../../src/uibase.cpp:45
+msgid "&Settings"
+msgstr "Nas&tavení"
+
+#: ../../../src/uibase.cpp:49
+msgid "&About..."
+msgstr "&O programu"
+
+#: ../../../src/uibase.cpp:52
+msgid "&Help"
+msgstr "&Nápověda"
+
+#: ../../../src/uibase.cpp:61
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2202
+msgid "Send Coins"
+msgstr "Pošli mince"
+
+#: ../../../src/uibase.cpp:62
+msgid "Address Book"
+msgstr "Adresář"
+
+#: ../../../src/uibase.cpp:75
+msgid "Your Bitcoin Address:"
+msgstr "Tvá Bitcoinová adresa:"
+
+#: ../../../src/uibase.cpp:82
+msgid " &New... "
+msgstr " &Nová..."
+
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
+msgid " &Copy to Clipboard "
+msgstr " &Kopírovat do schránky"
+
+#: ../../../src/uibase.cpp:99
+msgid "Balance:"
+msgstr "Stav účtu:"
+
+#: ../../../src/uibase.cpp:115
+msgid " All"
+msgstr " Vše"
+
+#: ../../../src/uibase.cpp:115
+msgid " Sent"
+msgstr " Odeslané"
+
+#: ../../../src/uibase.cpp:115
+msgid " Received"
+msgstr " Přijaté"
+
+#: ../../../src/uibase.cpp:115
+msgid " In Progress"
+msgstr " Pracuje se na tom"
+
+#: ../../../src/uibase.cpp:136
+msgid "All Transactions"
+msgstr "Všechny transakce"
+
+#: ../../../src/uibase.cpp:147
+msgid "Sent/Received"
+msgstr "Odeslané/Přijaté"
+
+#: ../../../src/uibase.cpp:158
+msgid "Sent"
+msgstr "Odeslané"
+
+#: ../../../src/uibase.cpp:169
+msgid "Received"
+msgstr "Přijaté"
+
+#: ../../../src/uibase.cpp:312
+#: ../../../src/uibase.cpp:453
+#: ../../../src/uibase.cpp:552
+#: ../../../src/uibase.cpp:732
+#: ../../../src/uibase.cpp:793
+#: ../../../src/uibase.cpp:902
+#: ../../../src/uibase.cpp:991
+msgid "OK"
+msgstr "&Budiž"
+
+#: ../../../src/uibase.cpp:355
+msgid "&Start Bitcoin on system startup"
+msgstr "&Spustit Bitcoin při startu systému"
+
+#: ../../../src/uibase.cpp:358
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Minimalizovávat do ikony v panelu"
+
+#: ../../../src/uibase.cpp:361
+msgid "Map port using &UPnP"
+msgstr "Namapovat port přes &UPnP"
+
+#: ../../../src/uibase.cpp:364
+msgid "M&inimize to the tray on close"
+msgstr "Zavřením &minimalizovat do ikony"
+
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "&Připojit přes socks4 proxy (vyžaduje restart aplikace):"
+
+#: ../../../src/uibase.cpp:381
+msgid "Proxy &IP:"
+msgstr "&IP adresa proxy:"
+
+#: ../../../src/uibase.cpp:389
+msgid " &Port:"
+msgstr " &Port:"
+
+#: ../../../src/uibase.cpp:402
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Dobrovolný transakční poplatek za každý započatý KB napomáhá tomu, aby tvé transakce byly rychle zpracovány. Většina transakcí má do 1 KB. Doporučená výše poplatku je 0.01."
+
+#: ../../../src/uibase.cpp:409
+msgid "Pay transaction fee:"
+msgstr "Výše transakčního poplatku:"
+
+#: ../../../src/uibase.cpp:430
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../src/uibase.cpp:434
+msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
+msgstr ""
+
+#: ../../../src/uibase.cpp:456
+#: ../../../src/uibase.cpp:678
+#: ../../../src/uibase.cpp:737
+#: ../../../src/uibase.cpp:796
+#: ../../../src/uibase.cpp:905
+#: ../../../src/uibase.cpp:994
+msgid "Cancel"
+msgstr "&Zrušit"
+
+#: ../../../src/uibase.cpp:459
+msgid "&Apply"
+msgstr "&Použít"
+
+#: ../../../src/uibase.cpp:518
+msgid "Bitcoin "
+msgstr "Bitcoin"
+
+#: ../../../src/uibase.cpp:524
+msgid "version"
+msgstr "verze"
+
+#: ../../../src/uibase.cpp:535
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"Copyright (c) 2009-2011 Vývojáři Bitcoinu\n"
+"\n"
+"Tohle je experimentální program.\n"
+"\n"
+"Šířen pod licencí MIT/X11, viz přiložený soubor license.txt nebo \n"
+"http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití \n"
+"v OpenSSL Toolkitu (http://www.openssl.org/) a kryptografický program od \n"
+"Erika Younga (eay@cryptsoft.com) a program UPnP od Thomase Bernarda."
+
+#: ../../../src/uibase.cpp:591
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Vlož Bitcoinovou adresu (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:605
+msgid "Pay &To:"
+msgstr "&Komu:"
+
+#: ../../../src/uibase.cpp:620
+msgid "&Paste"
+msgstr "&Vložit"
+
+#: ../../../src/uibase.cpp:623
+msgid " Address &Book..."
+msgstr " &Adresář..."
+
+#: ../../../src/uibase.cpp:630
+msgid "&Amount:"
+msgstr "&Částka"
+
+#: ../../../src/uibase.cpp:640
+msgid "T&ransfer:"
+msgstr "&Převod:"
+
+#: ../../../src/uibase.cpp:646
+msgid " Standard"
+msgstr " Standard"
+
+#: ../../../src/uibase.cpp:673
+msgid "&Send"
+msgstr "&Poslat"
+
+#: ../../../src/uibase.cpp:721
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Připojuji..."
+
+#: ../../../src/uibase.cpp:771
+msgid "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. The highlighted address is displayed in the main window."
+msgstr "Tohle jsou tvé Bitcoinové adresy na příjem plateb. Asi budeš chtít dát jinou adresu každému odesílateli, abys věděl, kdo ti kolik platil. Označená adresa bude zobrazena v hlavním okně."
+
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
+msgid "&Edit..."
+msgstr "&Upravit..."
+
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
+msgid " &New Address... "
+msgstr " &Nová adresa..."
+
+#: ../../../src/uibase.cpp:847
+#: ../../../src/ui.cpp:2620
+msgid "Bitcoin Address"
+msgstr "Bitcoinová adresa"
+
+#: ../../../src/uibase.cpp:859
+msgid "Sending"
+msgstr "Cizí adresy (pro odesílání)"
+
+#: ../../../src/uibase.cpp:867
+msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
+msgstr "Tohle jsou tvé Bitcoinové adresy na příjem plateb. Můžeš dát jinou adresu každému odesílateli, abys věděl, kdo ti kolik platil. Označená adresa bude zobrazena v hlavním okně."
+
+#: ../../../src/uibase.cpp:880
+msgid "Receiving"
+msgstr "Tvoje adresy (pro příjem)"
+
+#: ../../../src/uibase.cpp:890
+msgid "&Delete"
+msgstr "&Smazat"
+
+#: ../../../src/rpc.cpp:2088
+#: ../../../src/rpc.cpp:2090
+#, c-format
+msgid "To use the %s option"
+msgstr "Pro použití volby %s"
+
+#: ../../../src/rpc.cpp:2092
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Varování: %s, musíš nastavit rpcpassword=<heslo>\n"
+"v konfiguračním souboru: %s\n"
+"Pokud tenhle soubor neexistuje, vytvoř ho s oprávněním pro čtení pouze pro vlastníka.\n"
+
+#: ../../../src/rpc.cpp:2265
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Musíš nastavit rpcpassword=<heslo> v konfiguračním souboru:\n"
+"%s\n"
+"Pokud tenhle soubor neexistuje, vytvoř ho s oprávněním pro čtení pouze pro vlastníka."
+
+#: ../../../src/util.cpp:870
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Varování: Prosím zkontroluj, že datum a čas jsou na tvém počítači správně nastaveny. Pokud jsou nastaveny špatně, Bitcoin nebude fungovat správně."
+
+#: ../../../src/util.cpp:904
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/wallet.cpp:1084
+msgid "Error: Wallet locked, unable to create transaction "
+msgstr "Chyba: Peněženka je zamčená, takže není možné vytvořit transakci"
+
+#: ../../../src/wallet.cpp:1092
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Chyba: Tato transakce vyžaduje transakční poplatek nejméně %s kvůli svému objemu, komplexnosti nebo utrácení nedávno přijaté hotovosti"
+
+#: ../../../src/wallet.cpp:1094
+msgid "Error: Transaction creation failed "
+msgstr "Chyba: Vytvoření transakce selhalo"
+
+#: ../../../src/wallet.cpp:1100
+#: ../../../src/ui.cpp:2176
+#: ../../../src/ui.cpp:2185
+#: ../../../src/ui.cpp:2336
+#: ../../../src/ui.cpp:2500
+msgid "Sending..."
+msgstr "Posílám..."
+
+#: ../../../src/wallet.cpp:1104
+msgid "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."
+msgstr "Chyba: Transakce byla odmítnuta. Tohle může nastat, pokud nějaké mince z tvé peněženky už jednou byly utraceny, například pokud používáš kopii souboru wallet.dat a mince byly utraceny v druhé kopii, ale nebyly označeny jako utracené v této."
+
+#: ../../../src/wallet.cpp:1117
+msgid "Invalid amount"
+msgstr "Neplatná částka"
+
+#: ../../../src/wallet.cpp:1119
+#: ../../../src/ui.cpp:2403
+#: ../../../src/ui.cpp:2474
+msgid "Insufficient funds"
+msgstr "Nedostatek peněz"
+
+#: ../../../src/ui.cpp:217
+#, c-format
+msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
+msgstr "Tahle transakce přesahuje velikostní limit. Pořád ji ale můžeš poslat, pokud za ni zaplatíš poplatek %s, který půjde uzlům, které tvou transakci zpracují, a navíc tak podpoříš síť. Chceš zaplatit poplatek?"
+
+#: ../../../src/ui.cpp:261
+#: ../../../src/ui.cpp:1247
+msgid "Enter the current passphrase to the wallet."
+msgstr "Zadej platné heslo pro peněženku."
+
+#: ../../../src/ui.cpp:262
+#: ../../../src/ui.cpp:1183
+#: ../../../src/ui.cpp:1200
+#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1274
+#: ../../../src/ui.cpp:1294
+msgid "Passphrase"
+msgstr "Heslo"
+
+#: ../../../src/ui.cpp:268
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Zadej platné heslo pro dešifrování peněženky."
+
+#: ../../../src/ui.cpp:276
+#: ../../../src/ui.cpp:1259
+#: ../../../src/ui.cpp:1316
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "Nezadal jsi správné heslo pro dešifrování peněženky."
+
+#: ../../../src/ui.cpp:353
+msgid "Status"
+msgstr "Stav"
+
+#: ../../../src/ui.cpp:354
+msgid "Date"
+msgstr "Datum"
+
+#: ../../../src/ui.cpp:355
+msgid "Description"
+msgstr "Popis"
+
+#: ../../../src/ui.cpp:356
+msgid "Debit"
+msgstr "Výdaje"
+
+#: ../../../src/ui.cpp:357
+msgid "Credit"
+msgstr "Příjmy"
+
+#: ../../../src/ui.cpp:568
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Otevřeno pro %d bloků"
+
+#: ../../../src/ui.cpp:570
+#, c-format
+msgid "Open until %s"
+msgstr "Otřevřeno dokud %s"
+
+#: ../../../src/ui.cpp:576
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/offline?"
+
+#: ../../../src/ui.cpp:578
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/nepotvrzeno"
+
+#: ../../../src/ui.cpp:580
+#, c-format
+msgid "%d confirmations"
+msgstr "%d potvrzení"
+
+#: ../../../src/ui.cpp:665
+msgid "Generated"
+msgstr "Vygenerováno"
+
+#: ../../../src/ui.cpp:673
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Vygenerováno (%s dozraje po %d blocích)"
+
+#: ../../../src/ui.cpp:677
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "Vygenerovaný - Varování: Tehnle blok nebyl obdržen žádným jiným uzlem a pravděpodobně nebude akceptován!"
+
+#: ../../../src/ui.cpp:681
+msgid "Generated (not accepted)"
+msgstr "Vygenerováno (neakceptováno)"
+
+#: ../../../src/ui.cpp:691
+msgid "From: "
+msgstr "Od: "
+
+#: ../../../src/ui.cpp:715
+msgid "Received with: "
+msgstr "Přijato adresou: "
+
+#: ../../../src/ui.cpp:760
+msgid "Payment to yourself"
+msgstr "Platba pro sebe sama"
+
+#: ../../../src/ui.cpp:794
+msgid "To: "
+msgstr "Pro: "
+
+#: ../../../src/ui.cpp:1109
+msgid " Generating"
+msgstr " Generuji"
+
+#: ../../../src/ui.cpp:1111
+msgid "(not connected)"
+msgstr "(nepřipojen)"
+
+#: ../../../src/ui.cpp:1114
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d spojení %d bloků %d transakcí"
+
+#: ../../../src/ui.cpp:1171
+msgid "Wallet already encrypted."
+msgstr "Peněženka je už zašifrovaná."
+
+#: ../../../src/ui.cpp:1182
+msgid ""
+"Enter the new passphrase to the wallet.\n"
+"Please use a passphrase of 10 or more random characters, or eight or more words."
+msgstr ""
+"Zadej nové heslo pro peněženku.\n"
+"Použij alespoň 10 náhodných znaků nebo alespoň 8 slov."
+
+#: ../../../src/ui.cpp:1189
+#: ../../../src/ui.cpp:1282
+msgid "Error: The supplied passphrase was too short."
+msgstr "Chyba: Zadané heslo je příliš krátké."
+
+#: ../../../src/ui.cpp:1193
+msgid ""
+"WARNING: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR BITCOINS!\n"
+"Are you sure you wish to encrypt your wallet?"
+msgstr ""
+"VAROVÁNÍ: Pokud zašifruješ peněženku a ztratíš či zapomeneš heslo, PŘIJDEŠ O VŠECHNY BITCOINY!\n"
+"Jsi si jistý, že chceš peněženku zašifrovat?"
+
+#: ../../../src/ui.cpp:1199
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Zadej ještě jednou nové heslo pro peněženku."
+
+#: ../../../src/ui.cpp:1208
+#: ../../../src/ui.cpp:1304
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Chyba: zadaná hesla nejsou shodná."
+
+#: ../../../src/ui.cpp:1218
+msgid "Wallet encryption failed."
+msgstr "Zašifrování peněženky selhalo."
+
+#: ../../../src/ui.cpp:1225
+msgid ""
+"Wallet Encrypted.\n"
+"Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer."
+msgstr ""
+"Peněženka je zašifrována.\n"
+"Pamatuj, že pouhé šifrování peněženky nemůže plně ochránit tvé bitcoiny před krádeží malwarem, kterým se může počítač nakazit."
+
+#: ../../../src/ui.cpp:1236
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Peněženka není zašifrovaná, musíš ji prvně zašifrovat."
+
+#: ../../../src/ui.cpp:1273
+msgid "Enter the new passphrase for the wallet."
+msgstr "Zadej nové heslo pro peněženku."
+
+#: ../../../src/ui.cpp:1293
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Zadej ještě jednou nové heslo pro peněženku."
+
+#: ../../../src/ui.cpp:1325
+msgid "Wallet Passphrase Changed."
+msgstr "Heslo peněženky bylo změněno."
+
+#: ../../../src/ui.cpp:1382
+#: ../../../src/ui.cpp:2815
+msgid "New Receiving Address"
+msgstr "Nová Bitcoinová adresa"
+
+#: ../../../src/ui.cpp:1383
+#: ../../../src/ui.cpp:2816
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Měl bys vždy použít novou adresu pro každou platbu, kterou přijímáš.\n"
+"\n"
+"Označení"
+
+#: ../../../src/ui.cpp:1467
+msgid "<b>Status:</b> "
+msgstr "<b>Stav:</b> "
+
+#: ../../../src/ui.cpp:1472
+msgid ", has not been successfully broadcast yet"
+msgstr ", ještě nebylo rozesláno"
+
+#: ../../../src/ui.cpp:1474
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", rozesláno přes %d uzel"
+
+#: ../../../src/ui.cpp:1476
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", rozesláno přes %d uzlů"
+
+#: ../../../src/ui.cpp:1480
+msgid "<b>Date:</b> "
+msgstr "<b>Datum:</b> "
+
+#: ../../../src/ui.cpp:1488
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Zdroj:</b> Vygenerováno<br>"
+
+#: ../../../src/ui.cpp:1494
+#: ../../../src/ui.cpp:1511
+msgid "<b>From:</b> "
+msgstr "<b>Od:</b> "
+
+#: ../../../src/ui.cpp:1511
+msgid "unknown"
+msgstr "neznámo"
+
+#: ../../../src/ui.cpp:1512
+#: ../../../src/ui.cpp:1536
+#: ../../../src/ui.cpp:1595
+msgid "<b>To:</b> "
+msgstr "<b>Pro:</b> "
+
+#: ../../../src/ui.cpp:1515
+msgid " (yours, label: "
+msgstr " (tvoje, označení: "
+
+#: ../../../src/ui.cpp:1517
+msgid " (yours)"
+msgstr " (tvoje)"
+
+#: ../../../src/ui.cpp:1554
+#: ../../../src/ui.cpp:1566
+#: ../../../src/ui.cpp:1612
+#: ../../../src/ui.cpp:1629
+msgid "<b>Credit:</b> "
+msgstr "<b>Příjem:</b> "
+
+#: ../../../src/ui.cpp:1556
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s dozraje po %d blocích)"
+
+#: ../../../src/ui.cpp:1558
+msgid "(not accepted)"
+msgstr "(neakceptováno)"
+
+#: ../../../src/ui.cpp:1603
+#: ../../../src/ui.cpp:1611
+#: ../../../src/ui.cpp:1626
+msgid "<b>Debit:</b> "
+msgstr "<b>Výdaj:</b> "
+
+#: ../../../src/ui.cpp:1617
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Transakční poplatek:</b> "
+
+#: ../../../src/ui.cpp:1633
+msgid "<b>Net amount:</b> "
+msgstr "<b>Čistá částka:</b> "
+
+#: ../../../src/ui.cpp:1640
+msgid "Message:"
+msgstr "Zpráva:"
+
+#: ../../../src/ui.cpp:1642
+msgid "Comment:"
+msgstr "Komentář:"
+
+#: ../../../src/ui.cpp:1645
+msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
+msgstr "Vygenerované mince musí čekat 120 bloků, než mohou být utraceny. Když jsi vygeneroval tenhle blok, tak byl rozposlán do sítě, aby byl přidán do řetězce bloků. Pokud se mu nepodaří dostat se do řetězce, změní se na \"neakceptovaný\" a nebude utratitelný. To se občas může přihodit, pokud jiný uzel vygeneruje blok zhruba ve stejném okamžiku jako ty."
+
+#: ../../../src/ui.cpp:1825
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Nemohu zapisovat do souboru autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1861
+msgid "Main"
+msgstr "Hlavní"
+
+#: ../../../src/ui.cpp:1871
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Spustit Bitcoin při startu okenního systému"
+
+#: ../../../src/ui.cpp:1878
+msgid "&Minimize on close"
+msgstr "&Zavřením pouze skrýt"
+
+#: ../../../src/ui.cpp:2020
+#, c-format
+msgid "version %s"
+msgstr "verze %s"
+
+#: ../../../src/ui.cpp:2143
+msgid "Error in amount "
+msgstr "Chyba v částce"
+
+#: ../../../src/ui.cpp:2148
+msgid "Amount exceeds your balance "
+msgstr "Částka překračuje stav účtu"
+
+#: ../../../src/ui.cpp:2153
+msgid "Total exceeds your balance when the "
+msgstr "Celková částka přesahuje stav tvého účtu, když "
+
+#: ../../../src/ui.cpp:2153
+msgid " transaction fee is included "
+msgstr " transakční poplatek je zahrnut"
+
+#: ../../../src/ui.cpp:2176
+msgid "Payment sent "
+msgstr "Platba odeslána"
+
+#: ../../../src/ui.cpp:2202
+msgid "Invalid address "
+msgstr "Neplatná adresa"
+
+#: ../../../src/ui.cpp:2257
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Posílám %s %s"
+
+#: ../../../src/ui.cpp:2330
+#: ../../../src/ui.cpp:2363
+msgid "CANCELLED"
+msgstr "ZRUŠENO"
+
+#: ../../../src/ui.cpp:2334
+msgid "Cancelled"
+msgstr "Zrušeno"
+
+#: ../../../src/ui.cpp:2336
+msgid "Transfer cancelled "
+msgstr "Převod zrušen"
+
+#: ../../../src/ui.cpp:2389
+msgid "Error: "
+msgstr "Chyba: "
+
+#: ../../../src/ui.cpp:2408
+msgid "Connecting..."
+msgstr "Připojuji..."
+
+#: ../../../src/ui.cpp:2413
+msgid "Unable to connect"
+msgstr "Nemohu se připojit"
+
+#: ../../../src/ui.cpp:2418
+msgid "Requesting public key..."
+msgstr "Požaduji veřejný klíč..."
+
+#: ../../../src/ui.cpp:2430
+msgid "Received public key..."
+msgstr "Přijat veřejný klíč..."
+
+#: ../../../src/ui.cpp:2444
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Příjemce neakceptuje transakce poslané IP adresou"
+
+#: ../../../src/ui.cpp:2446
+msgid "Transfer was not accepted"
+msgstr "Převod nebyl akceptován"
+
+#: ../../../src/ui.cpp:2455
+msgid "Invalid response received"
+msgstr "Přišla neplatná odpověď"
+
+#: ../../../src/ui.cpp:2470
+msgid "Creating transaction..."
+msgstr "Vytvářím transakci..."
+
+#: ../../../src/ui.cpp:2489
+#, c-format
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Tato transakce vyžaduje transakční poplatek nejméně %s kvůli svému objemu, komplexnosti nebo utrácení nedávno přijaté hotovosti"
+
+#: ../../../src/ui.cpp:2491
+msgid "Transaction creation failed"
+msgstr "Vytvoření transakce selhalo"
+
+#: ../../../src/ui.cpp:2502
+msgid "Transaction aborted"
+msgstr "Transakce zrušena"
+
+#: ../../../src/ui.cpp:2510
+msgid "Lost connection, transaction cancelled"
+msgstr "Spojení se ztratilo, takže transakce byla zrušena"
+
+#: ../../../src/ui.cpp:2526
+msgid "Sending payment..."
+msgstr "Posílám platbu..."
+
+#: ../../../src/ui.cpp:2532
+msgid "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."
+msgstr "Transakce byla odmítnuta. Tohle může nastat, pokud nějaké mince z tvé peněženky už jednou byly utraceny, například pokud používáš kopii souboru wallet.dat a mince byly utraceny v druhé kopii, ale nebyly označeny jako utracené v této."
+
+#: ../../../src/ui.cpp:2541
+msgid "Waiting for confirmation..."
+msgstr "Čekám na potvrzení..."
+
+#: ../../../src/ui.cpp:2559
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"Platba byla poslána, ale příjemce není schopen ji ověřit.\n"
+"Transakce je zaznamenána a bude připsána příjemci,\n"
+"ale poznámka u platby bude prázdná."
+
+#: ../../../src/ui.cpp:2568
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Platba byla odeslána, ale přišla neplatná odpověď"
+
+#: ../../../src/ui.cpp:2574
+msgid "Payment completed"
+msgstr "Platba je kompletní"
+
+#: ../../../src/ui.cpp:2616
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2803
+msgid "Name"
+msgstr "Jméno"
+
+#: ../../../src/ui.cpp:2617
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2803
+msgid "Address"
+msgstr "Adresa"
+
+#: ../../../src/ui.cpp:2619
+#: ../../../src/ui.cpp:2775
+msgid "Label"
+msgstr "Označení"
+
+#: ../../../src/ui.cpp:2745
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
+msgstr "Tohle je jedna z tvých vlastních adres pro příjem plateb a nemůže být zadána do adresáře."
+
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2769
+msgid "Edit Address"
+msgstr "Upravit adresu"
+
+#: ../../../src/ui.cpp:2775
+msgid "Edit Address Label"
+msgstr "Upravit označení adresy"
+
+#: ../../../src/ui.cpp:2803
+#: ../../../src/ui.cpp:2809
+msgid "Add Address"
+msgstr "Přidat adresu"
+
+#: ../../../src/ui.cpp:2897
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../src/ui.cpp:2899
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - Generování"
+
+#: ../../../src/ui.cpp:2901
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (nepřipojen)"
+
+#: ../../../src/ui.cpp:2980
+msgid "&Open Bitcoin"
+msgstr "&Otevřít Bitcoin"
+
+#: ../../../src/ui.cpp:2981
+msgid "&Send Bitcoins"
+msgstr "&Poslat Bitcoiny"
+
+#: ../../../src/ui.cpp:2982
+msgid "O&ptions..."
+msgstr "&Možnosti..."
+
+#: ../../../src/ui.cpp:3211
+msgid "Program has crashed and will terminate. "
+msgstr "Program havaroval a bude ukončen."
+
+#: ../../../src/init.cpp:163
+msgid "Bitcoin version"
+msgstr "Bitcoin verze"
+
+#: ../../../src/init.cpp:164
+msgid "Usage:"
+msgstr "Užití:"
+
+#: ../../../src/init.cpp:166
+msgid "Send command to -server or bitcoind\n"
+msgstr "Poslat příkaz pro -server nebo bitcoind\n"
+
+#: ../../../src/init.cpp:167
+msgid "List commands\n"
+msgstr "Výpis příkazů\n"
+
+#: ../../../src/init.cpp:168
+msgid "Get help for a command\n"
+msgstr "Získat nápovědu pro příkaz\n"
+
+#: ../../../src/init.cpp:169
+msgid "Options:\n"
+msgstr "Možnosti:\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Konfigurační soubor (výchozí: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:171
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "PID soubor (výchozí: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:172
+msgid "Generate coins\n"
+msgstr "Generovat mince\n"
+
+#: ../../../src/init.cpp:173
+msgid "Don't generate coins\n"
+msgstr "Negenerovat mince\n"
+
+#: ../../../src/init.cpp:174
+msgid "Start minimized\n"
+msgstr "Startovat minimalizovaně\n"
+
+#: ../../../src/init.cpp:175
+msgid "Specify data directory\n"
+msgstr "Adresář pro data\n"
+
+#: ../../../src/init.cpp:176
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Zadej časový limit spojení (v milisekundách)\n"
+
+#: ../../../src/init.cpp:177
+msgid "Connect through socks4 proxy\n"
+msgstr "Připojovat se skrz socks4 proxy\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Povolit DNS dotazy pro addnode (přidání uzlu) a connect (připojení)\n"
+
+#: ../../../src/init.cpp:179
+msgid "Add a node to connect to\n"
+msgstr "Přidat uzel, ke kterému se připojit\n"
+
+#: ../../../src/init.cpp:180
+msgid "Connect only to the specified node\n"
+msgstr "Připojovat se pouze k udanému uzlu\n"
+
+#: ../../../src/init.cpp:181
+msgid "Don't accept connections from outside\n"
+msgstr "Nepřijímat připojení zvenčí\n"
+
+#: ../../../src/init.cpp:184
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Nesnažit se použít UPnP k namapování naslouchacího portu\n"
+
+#: ../../../src/init.cpp:186
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Snažit se použít UPnP k namapování naslouchacího portu\n"
+
+#: ../../../src/init.cpp:189
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Poplatek za KB, který se přidá ke každé odeslané transakci\n"
+
+#: ../../../src/init.cpp:191
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Akceptovat příkazy z příkazové řádky a přes JSON-RPC\n"
+
+#: ../../../src/init.cpp:194
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Běžet na pozadí jako démon a akceptovat příkazy\n"
+
+#: ../../../src/init.cpp:196
+msgid "Use the test network\n"
+msgstr "Použít testovací síť\n"
+
+#: ../../../src/init.cpp:197
+msgid "Username for JSON-RPC connections\n"
+msgstr "Uživatelské jméno pro JSON-RPC spojení\n"
+
+#: ../../../src/init.cpp:198
+msgid "Password for JSON-RPC connections\n"
+msgstr "Heslo pro JSON-RPC spojení\n"
+
+#: ../../../src/init.cpp:199
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Čekat na JSON-RPC spojení na <portu> (výchozí: 8332)\n"
+
+#: ../../../src/init.cpp:200
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Povolit JSON-RPC spojení ze specifikované IP adresy\n"
+
+#: ../../../src/init.cpp:201
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Posílat příkazy uzlu běžícím na <ip> (výchozí: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:202
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Nastavit zásobník klíčů na velikost <n> (výchozí: 100)\n"
+
+#: ../../../src/init.cpp:203
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Přeskenovat řetězec bloků na chybějící transakce peněženky\n"
+
+#: ../../../src/init.cpp:207
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"Možnosti SSL: (viz instrukce nastavení SSL v Bitcoin Wiki)\n"
+
+#: ../../../src/init.cpp:208
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Použít OpenSSL (https) pro JSON-RPC spojení\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Soubor se serverovým certifikátem (výchozí: server.cert)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Server private key (default: server.pem)\n"
+msgstr "Soubor se serverovým soukromým klíčem (výchozí: server.pem)\n"
+
+#: ../../../src/init.cpp:211
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Akceptovatelné šifry (výchozí: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:215
+msgid "This help message\n"
+msgstr "Tato nápověda\n"
+
+#: ../../../src/init.cpp:353
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Nedaří se mi získat zámek na datový adresář %s. Bitcoin pravděpodobně už jednou běží."
+
+#: ../../../src/init.cpp:379
+msgid "Error loading addr.dat \n"
+msgstr "Chyba při načítání addr.dat \n"
+
+#: ../../../src/init.cpp:385
+msgid "Error loading blkindex.dat \n"
+msgstr "Chyba při načítání blkindex.dat \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet corrupted \n"
+msgstr "Chyba při načítání wallet.dat: peněženka je poškozená \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin \n"
+msgstr "Chyba při načítání wallet.dat: peněženka vyžaduje novější verzi Bitcoinu \n"
+
+#: ../../../src/init.cpp:400
+msgid "Error loading wallet.dat \n"
+msgstr "Chyba při načítání wallet.dat \n"
+
+#: ../../../src/init.cpp:489
+msgid "Invalid -proxy address"
+msgstr "Neplatná -proxy adresa"
+
+#: ../../../src/init.cpp:514
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Neplatná částka pro -paytxfee=<částka>"
+
+#: ../../../src/init.cpp:518
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Varování: -paytxfee je nastaveno velmi vysoko. Toto je transakční poplatek, který zaplatíš za každou poslanou transakci."
+
+#: ../../../src/net.cpp:1622
+#, c-format
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Nedaří se mi připojit na port %d na tomhle počítači. Bitcoin už pravděpodobně jednou běží."
+
+#: ../../../src/main.cpp:1437
+msgid "Warning: Disk space is low "
+msgstr "Upozornění: Na disku je málo místa"
+
+#: ../../../src/uibase.h:151
+msgid "Transaction Details"
+msgstr "Detaily transakce"
+
+#: ../../../src/uibase.h:203
+msgid "Options"
+msgstr "Možnosti"
+
+#: ../../../src/uibase.h:232
+msgid "About Bitcoin"
+msgstr "O Bitcoinu"
+
+#: ../../../src/uibase.h:341
+msgid "Your Bitcoin Addresses"
+msgstr "Tvá Bitcoinová adresa"
+
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "Neplatná Bitcoinová adresa"
diff --git a/locale/de/LC_MESSAGES/bitcoin.mo b/locale/de/LC_MESSAGES/bitcoin.mo
index 5d5ec90e23..622661faf7 100644
--- a/locale/de/LC_MESSAGES/bitcoin.mo
+++ b/locale/de/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/de/LC_MESSAGES/bitcoin.po b/locale/de/LC_MESSAGES/bitcoin.po
index 33b32d17ee..94ecc96926 100644
--- a/locale/de/LC_MESSAGES/bitcoin.po
+++ b/locale/de/LC_MESSAGES/bitcoin.po
@@ -1,459 +1,689 @@
-# DataWraith <DataWraith@web.de>, 2010.
+# Jakob Kramer <censored@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"POT-Creation-Date: 2010-05-26 22:02-0000\n"
-"PO-Revision-Date: 2010-06-03 13:11+0200\n"
-"Last-Translator: DataWraith\n"
-"Language-Team: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-07-17 02:21+0100\n"
+"PO-Revision-Date: 2011-07-17 02:54+0100\n"
+"Last-Translator: Michael Bemmerl <mail@mx-server.de>\n"
+"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Virtaal 0.6.1\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
-"X-Generator: Lokalize 1.0\n"
-"Plural-Forms: nplurals=2; plural=n != 1;\n"
-#: ../../../init.cpp:342
-msgid "Usage: bitcoin [options]"
-msgstr "Verwendung: bitcoin [optionen]"
+#: ../../../src/init.cpp:162
+msgid "Bitcoin version"
+msgstr "Bitcoin Version"
-#: ../../../init.cpp:343
+#: ../../../src/init.cpp:163
+msgid "Usage:"
+msgstr "Verwendung:"
+
+#: ../../../src/init.cpp:165
+msgid "Send command to -server or bitcoind\n"
+msgstr "Sende Befehl zu -server oder bitcoind\n"
+
+#: ../../../src/init.cpp:166
+msgid "List commands\n"
+msgstr "Liste Befehle auf\n"
+
+#: ../../../src/init.cpp:167
+msgid "Get help for a command\n"
+msgstr "Hilfe für einen Befehl erhalten\n"
+
+#: ../../../src/init.cpp:168
msgid "Options:\n"
msgstr "Optionen:\n"
-#: ../../../init.cpp:344
+#: ../../../src/init.cpp:169
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Konfigurationsdatei bestimmen (Standard: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "pid-Datei bestimmen (Standard: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:171
msgid "Generate coins\n"
msgstr "Münzen erzeugen\n"
-#: ../../../init.cpp:345
+#: ../../../src/init.cpp:172
msgid "Don't generate coins\n"
msgstr "Keine Münzen erzeugen\n"
-#: ../../../init.cpp:346
+#: ../../../src/init.cpp:173
msgid "Start minimized\n"
msgstr "Minimiert starten\n"
-#: ../../../init.cpp:347
+#: ../../../src/init.cpp:174
msgid "Specify data directory\n"
msgstr "Datenverzeichnis festlegen\n"
-#: ../../../init.cpp:348
+#: ../../../src/init.cpp:175
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Verbindungs-Timeout in Milisekunden\n"
+
+#: ../../../src/init.cpp:176
msgid "Connect through socks4 proxy\n"
-msgstr "Socks4 Proxy verwenden\n"
+msgstr "Socks4-Proxy verwenden\n"
-#: ../../../init.cpp:349
+#: ../../../src/init.cpp:177
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "DNS-Auflösung für addnode und connect erlauben\n"
+
+#: ../../../src/init.cpp:178
msgid "Add a node to connect to\n"
msgstr "Einen Teilnehmer hinzufügen, zu dem verbunden werden soll\n"
-#: ../../../init.cpp:350
+#: ../../../src/init.cpp:179
msgid "Connect only to the specified node\n"
msgstr "Nur zu dem angegebenen Teilnehmer verbinden\n"
-#: ../../../init.cpp:351
+#: ../../../src/init.cpp:180
+msgid "Don't accept connections from outside\n"
+msgstr "Akzeptiere keine externen Verbindungen\n"
+
+#: ../../../src/init.cpp:183
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Versuche nicht, UPnP zur Portweiterleitung zu nutzen\n"
+
+#: ../../../src/init.cpp:185
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Versuche, UPnP zur Portweiterleitung zu nutzen\n"
+
+#: ../../../src/init.cpp:188
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Gebühr pro KB für Überweisungen, die Sie tätigen\n"
+
+#: ../../../src/init.cpp:190
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Akzeptiere Kommandozeile und JSON-RPC-Befehle\n"
+
+#: ../../../src/init.cpp:193
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Laufe im Hintergrund als Daemon und akzeptiere Befehle\n"
+
+#: ../../../src/init.cpp:195
+msgid "Use the test network\n"
+msgstr "Nutze das Testnetzwerk\n"
+
+#: ../../../src/init.cpp:196
+msgid "Username for JSON-RPC connections\n"
+msgstr "Benutzername für JSON-RPC-Verbindungen\n"
+
+#: ../../../src/init.cpp:197
+msgid "Password for JSON-RPC connections\n"
+msgstr "Passwort für JSON-RPC-Verbindungen\n"
+
+#: ../../../src/init.cpp:198
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Horche für JSON-RPC-Verbindungen auf <port> (Standard: 8332)\n"
+
+#: ../../../src/init.cpp:199
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Erlaube JSON-RPC-Verbindungen von bestimmter IP-Adresse\n"
+
+#: ../../../src/init.cpp:200
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Sende Befehle zum Knoten mit <ip> (Standard: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:201
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Setze Key-Pool-Größe auf <n> (Standard: 100)\n"
+
+#: ../../../src/init.cpp:202
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Frage die Block-Kette nach fehlenden Brieftaschen-Überweisungen ab\n"
+
+#: ../../../src/init.cpp:206
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL-Optionen: (siehe das Bitcoin-Wiki für SSL-Installationsanleitungen)\n"
+
+#: ../../../src/init.cpp:207
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Nutze OpenSSL (https) für JSON-RPC-Verbindungen\n"
+
+#: ../../../src/init.cpp:208
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Server-Zertifikatsdatei (Standard: server.cert)\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server private key (default: server.pem)\n"
+msgstr "Server-Geheimschlüssel (Standard: server.pem)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Anzunehmende Verschlüsselungen (Standard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:214
msgid "This help message\n"
msgstr "Diese Anleitung\n"
-#: ../../../init.cpp:455
+#: ../../../src/init.cpp:351
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Erhalte keine Datensperre für das Datenverzeichnis %s. Bitcoin läuft wahrscheinlich bereits."
+
+#: ../../../src/init.cpp:377
msgid "Error loading addr.dat \n"
msgstr "Fehler beim Laden von addr.dat \n"
-#: ../../../init.cpp:461
+#: ../../../src/init.cpp:383
msgid "Error loading blkindex.dat \n"
msgstr "Fehler beim Laden von blkindex.dat \n"
-#: ../../../init.cpp:468
+#: ../../../src/init.cpp:394
+msgid "Error loading wallet.dat: Wallet corrupted \n"
+msgstr "Fehler beim Laden von wallet.dat: Brieftasche beschädigt \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin \n"
+msgstr "Fehler beim Laden von wallet.dat: Die Brieftasche benötigt eine neuere Version von Bitcoin \n"
+
+#: ../../../src/init.cpp:398
msgid "Error loading wallet.dat \n"
msgstr "Fehler beim Laden von wallet.dat \n"
-#: ../../../init.cpp:536
+#: ../../../src/init.cpp:488
msgid "Invalid -proxy address"
msgstr "Ungültige -Proxy Adresse"
-#: ../../../init.cpp:629
-msgid "Program has crashed and will terminate. "
-msgstr "Das Programm ist abgestürzt und wird beendet. "
+#: ../../../src/init.cpp:513
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Ungültiger Betrag für -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:517
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Warnung: -paytxfee ist sehr hoch gesetzt. Das ist die Überweisungsgebühr, die Sie für das Senden einer Überweisung zahlen."
-#: ../../../main.cpp:1465
+#: ../../../src/main.cpp:1430
msgid "Warning: Disk space is low "
msgstr "Warnung: Festplatte fast voll "
-#: ../../../main.cpp:2994
+#: ../../../src/net.cpp:1615
#, c-format
-msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
-msgstr "Fehler: Die Überweisung ist sehr groß. Es wird eine Gebühr von %s erhoben. "
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Kann nicht zu Port %d auf diesem Computer verbinden. Bitcoin läuft wahrscheinlich bereits."
-#: ../../../main.cpp:2996
-msgid "Error: Transaction creation failed "
-msgstr "Fehler: Überweisung konnte nicht erzeugt werden. "
-
-#: ../../../main.cpp:3001
-#: ../../../ui.cpp:1761
-#: ../../../ui.cpp:1763
-#: ../../../ui.cpp:1904
-#: ../../../ui.cpp:2053
-msgid "Sending..."
-msgstr "Überweise..."
-
-#: ../../../main.cpp:3005
-msgid "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."
-msgstr "Fehler: Die Überweisung wurde abgelehnt. Das kann passieren, wenn einige der Münzen in Ihrer Brieftasche bereits ausgegeben wurden, z.B. weil Sie eine Kopie der Brieftasche (wallet.dat) gemacht haben. Bitcoins, die mithilfe der Kopie ausgegeben wurden, sind in dieser Brieftasche noch nicht als ausgegeben markiert worden."
-
-#: ../../../main.cpp:3017
-msgid "Invalid amount"
-msgstr "Ungültiger Betrag"
+#: ../../../src/rpc.cpp:2100
+#: ../../../src/rpc.cpp:2102
+#, c-format
+msgid "To use the %s option"
+msgstr "Um die %s-Option zu nutzen"
-#: ../../../main.cpp:3019
-#: ../../../ui.cpp:1971
-#: ../../../ui.cpp:2038
-msgid "Insufficient funds"
-msgstr "Unzureichende Geldmittel"
+#: ../../../src/rpc.cpp:2104
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Warnung: %s, müssen Sie rpcpassword=<password>\n"
+"in der Konfigurationsdatei %s einstellen.\n"
+"Wenn die Datei nicht existiert, erstellen Sie sie mit ausschließlich Besitzer-Leserechten.\n"
-#: ../../../main.cpp:3024
-msgid "Invalid bitcoin address"
-msgstr "Ungültige Bitcoin-Adresse"
+#: ../../../src/rpc.cpp:2277
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Sie müssen rpcpassword=<password> in der Konfigurationsdatei\n"
+"\"%s\" einstellen.\n"
+"Wenn die Datei nicht existiert, erstellen Sie sie mit ausschließlich Besitzer-Leserechten."
-#: ../../../ui.cpp:189
+#: ../../../src/ui.cpp:216
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
-msgstr "Diese Überweisung übersteigt das Betragslimit. Sie können sie trotzdem tätigen, aber es wird eine Gebühr von %s erhoben, die an den Teilnehmer ausgeschüttet wird, der Ihre Überweisung bearbeitet und dadurch hilft das Netzwerk am laufen zu halten. Möchten Sie die Gebühr entrichten?"
-
-#: ../../../ui.cpp:285
+msgstr "Diese Überweisung übersteigt das Betragslimit. Sie können sie trotzdem tätigen, aber es wird eine Gebühr von %s erhoben, die an den Teilnehmer ausgeschüttet wird, der Ihre Überweisung bearbeitet und dadurch hilft, das Netzwerk am laufen zu halten. Möchten Sie die Gebühr entrichten?"
+
+#: ../../../src/ui.cpp:259
+#: ../../../src/ui.cpp:1246
+msgid "Enter the current passphrase to the wallet."
+msgstr "Geben Sie die derzeitige Passphrase der Brieftasche ein."
+
+# See http://dict.leo.org/forum/viewUnsolvedquery.php?idThread=465865&idForum=2&lp=ende&lang=de
+#: ../../../src/ui.cpp:260
+#: ../../../src/ui.cpp:1182
+#: ../../../src/ui.cpp:1199
+#: ../../../src/ui.cpp:1247
+#: ../../../src/ui.cpp:1273
+#: ../../../src/ui.cpp:1293
+msgid "Passphrase"
+msgstr "Passphrase"
+
+#: ../../../src/ui.cpp:266
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Bitte geben Sie die derzeitige Passphrase zur Entschlüsselung der Brieftasche an."
+
+#: ../../../src/ui.cpp:274
+#: ../../../src/ui.cpp:1258
+#: ../../../src/ui.cpp:1315
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "Die eingegebene Passphrase zur Entschlüsselung der Brieftasche war inkorrekt."
+
+#: ../../../src/ui.cpp:351
msgid "Status"
msgstr "Status"
-#: ../../../ui.cpp:286
+#: ../../../src/ui.cpp:352
msgid "Date"
msgstr "Datum"
-#: ../../../ui.cpp:287
+#: ../../../src/ui.cpp:353
msgid "Description"
msgstr "Beschreibung"
-#: ../../../ui.cpp:288
+#: ../../../src/ui.cpp:354
msgid "Debit"
msgstr "Belastungen"
-#: ../../../ui.cpp:289
+#: ../../../src/ui.cpp:355
msgid "Credit"
msgstr "Gutschriften"
-#: ../../../ui.cpp:489
+#: ../../../src/ui.cpp:566
#, c-format
msgid "Open for %d blocks"
msgstr "Offen für %d Blöcke"
-#: ../../../ui.cpp:491
+#: ../../../src/ui.cpp:568
#, c-format
msgid "Open until %s"
msgstr "Offen bis %s"
-#: ../../../ui.cpp:497
+#: ../../../src/ui.cpp:574
#, c-format
msgid "%d/offline?"
msgstr "%d/Offline?"
-#: ../../../ui.cpp:499
+#: ../../../src/ui.cpp:576
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/nicht bestätigt"
-#: ../../../ui.cpp:501
+#: ../../../src/ui.cpp:578
#, c-format
msgid "%d confirmations"
msgstr "%d Bestätigungen"
-#: ../../../ui.cpp:584
+#: ../../../src/ui.cpp:663
msgid "Generated"
msgstr "Erzeugt"
-#: ../../../ui.cpp:592
+#: ../../../src/ui.cpp:671
#, c-format
msgid "Generated (%s matures in %d more blocks)"
msgstr "Erzeugt (%s reifen nach %d weiteren Blöcken)"
-#: ../../../ui.cpp:596
+#: ../../../src/ui.cpp:675
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
msgstr "Erzeugt - Warnung: Dieser Block wurde von keinem anderen Teilnehmer empfangen und wird wahrscheinlich nicht akzeptiert werden!"
-#: ../../../ui.cpp:600
+#: ../../../src/ui.cpp:679
msgid "Generated (not accepted)"
msgstr "Erzeugt (nicht akzeptiert)"
-#: ../../../ui.cpp:610
+#: ../../../src/ui.cpp:689
msgid "From: "
msgstr "Von: "
-#: ../../../ui.cpp:634
+#: ../../../src/ui.cpp:713
msgid "Received with: "
msgstr "Empfangen durch: "
-#: ../../../ui.cpp:676
+#: ../../../src/ui.cpp:759
msgid "Payment to yourself"
msgstr "Überweisung an Sie selbst"
-#: ../../../ui.cpp:713
+#: ../../../src/ui.cpp:793
msgid "To: "
msgstr "An: "
-#: ../../../ui.cpp:1009
+#: ../../../src/ui.cpp:1108
msgid " Generating"
msgstr " Erzeugen"
-#: ../../../ui.cpp:1011
+#: ../../../src/ui.cpp:1110
msgid "(not connected)"
msgstr "(nicht verbunden)"
-#: ../../../ui.cpp:1014
+#: ../../../src/ui.cpp:1113
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d Verbindungen %d Blöcke %d Überweisungen"
-#: ../../../ui.cpp:1123
-#: ../../../ui.cpp:2351
+#: ../../../src/ui.cpp:1170
+msgid "Wallet already encrypted."
+msgstr "Brieftasche bereits verschlüsselt."
+
+#: ../../../src/ui.cpp:1181
+msgid ""
+"Enter the new passphrase to the wallet.\n"
+"Please use a passphrase of 10 or more random characters, or eight or more words."
+msgstr ""
+"Geben Sie die neue Passphrase der Brieftasche ein.\n"
+"Bitte benutzen Sie eine Passphrase mit zehn oder mehr zufällig gewählten Zeichen, oder acht oder mehr Wörter."
+
+#: ../../../src/ui.cpp:1188
+#: ../../../src/ui.cpp:1281
+msgid "Error: The supplied passphrase was too short."
+msgstr "Fehler: Die angegebene Passphrase war zu kurz. "
+
+#: ../../../src/ui.cpp:1192
+msgid ""
+"WARNING: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR BITCOINS!\n"
+"Are you sure you wish to encrypt your wallet?"
+msgstr ""
+"WARNUNG: Wenn Sie Ihre Brieftasche verschlüsseln und die Passphrase verlieren, werden Sie ALLE IHRE BITCOINS VERLIEREN!\n"
+"Sind Sie sicher, dass Sie Ihre Brieftasche verschlüsseln wollen?"
+
+#: ../../../src/ui.cpp:1198
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Bitte geben Sie erneut Ihre neue Passphrase der Brieftasche ein."
+
+#: ../../../src/ui.cpp:1207
+#: ../../../src/ui.cpp:1303
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Fehler: Die angegebenen Passphrasen stimmten nicht überein."
+
+#: ../../../src/ui.cpp:1217
+msgid "Wallet encryption failed."
+msgstr "Verschlüsselung der Brieftasche fehlgeschlagen."
+
+#: ../../../src/ui.cpp:1224
+msgid ""
+"Wallet Encrypted.\n"
+"Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer."
+msgstr ""
+"Brieftasche verschlüsselt.\n"
+"Beachten Sie, dass das Verschlüsseln der Brieftasche Ihre Bitcoins nicht völlig vor Diebstahl durch Schadprogramme auf Ihrem Computer schützt."
+
+#: ../../../src/ui.cpp:1235
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Die Brieftasche ist nicht verschlüsselt, bitte verschlüsselen Sie sie erst."
+
+#: ../../../src/ui.cpp:1272
+msgid "Enter the new passphrase for the wallet."
+msgstr "Geben Sie die neue Passphrase der Brieftasche ein."
+
+#: ../../../src/ui.cpp:1292
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Geben Sie erneut die neue Passphrase der Brieftasche ein."
+
+#: ../../../src/ui.cpp:1324
+msgid "Wallet Passphrase Changed."
+msgstr "Die Passphrase der Brieftasche wurde geändert."
+
+#: ../../../src/ui.cpp:1381
+#: ../../../src/ui.cpp:2816
msgid "New Receiving Address"
msgstr "&Neue Empfangs-Adresse"
-#: ../../../ui.cpp:1124
-#: ../../../ui.cpp:2352
+#: ../../../src/ui.cpp:1382
+#: ../../../src/ui.cpp:2817
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
-"Am besten verwenden Sie für jede Zahlung die Sie erhalten eine neue Adresse.\n"
+"Am besten verwenden Sie für jede Zahlung, die Sie erhalten, eine neue Adresse.\n"
"\n"
"Beschreibung"
-#: ../../../ui.cpp:1193
+#: ../../../src/ui.cpp:1466
msgid "<b>Status:</b> "
msgstr "<b>Status:</b> "
-#: ../../../ui.cpp:1198
+#: ../../../src/ui.cpp:1471
msgid ", has not been successfully broadcast yet"
msgstr ", wurde noch nicht erfolgreich übertragen"
-#: ../../../ui.cpp:1200
+#: ../../../src/ui.cpp:1473
#, c-format
msgid ", broadcast through %d node"
msgstr ", durch %d Teilnehmer übertragen"
-#: ../../../ui.cpp:1202
+#: ../../../src/ui.cpp:1475
#, c-format
msgid ", broadcast through %d nodes"
msgstr ", durch %d Teilnehmer übertragen"
-#: ../../../ui.cpp:1206
+#: ../../../src/ui.cpp:1479
msgid "<b>Date:</b> "
msgstr "<b>Datum</b> "
-#: ../../../ui.cpp:1214
+#: ../../../src/ui.cpp:1487
msgid "<b>Source:</b> Generated<br>"
-msgstr "<b>Quelle:</b>Erzeugt<br>"
+msgstr "<b>Quelle:</b> Erzeugt<br>"
-#: ../../../ui.cpp:1220
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1493
+#: ../../../src/ui.cpp:1511
msgid "<b>From:</b> "
msgstr "<b>Von:</b> "
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1511
msgid "unknown"
msgstr "Unbekannt"
-#: ../../../ui.cpp:1239
-#: ../../../ui.cpp:1263
-#: ../../../ui.cpp:1322
+#: ../../../src/ui.cpp:1512
+#: ../../../src/ui.cpp:1536
+#: ../../../src/ui.cpp:1595
msgid "<b>To:</b> "
msgstr "<b>An:</b> "
-#: ../../../ui.cpp:1242
+#: ../../../src/ui.cpp:1515
msgid " (yours, label: "
msgstr " (Eigene, Beschreibung: "
-#: ../../../ui.cpp:1244
+#: ../../../src/ui.cpp:1517
msgid " (yours)"
msgstr " (Eigene)"
-#: ../../../ui.cpp:1281
-#: ../../../ui.cpp:1293
-#: ../../../ui.cpp:1356
+#: ../../../src/ui.cpp:1554
+#: ../../../src/ui.cpp:1566
+#: ../../../src/ui.cpp:1612
+#: ../../../src/ui.cpp:1629
msgid "<b>Credit:</b> "
msgstr "<b>Gutschrift:</b> "
-#: ../../../ui.cpp:1283
+#: ../../../src/ui.cpp:1556
#, c-format
msgid "(%s matures in %d more blocks)"
msgstr "(%s reifen nach %d weiteren Blöcken)"
-#: ../../../ui.cpp:1285
+#: ../../../src/ui.cpp:1558
msgid "(not accepted)"
msgstr "(nicht akzeptiert)"
-#: ../../../ui.cpp:1330
-#: ../../../ui.cpp:1353
+#: ../../../src/ui.cpp:1603
+#: ../../../src/ui.cpp:1611
+#: ../../../src/ui.cpp:1626
msgid "<b>Debit:</b> "
msgstr "<b>Belastung:</b> "
-#: ../../../ui.cpp:1344
+#: ../../../src/ui.cpp:1617
msgid "<b>Transaction fee:</b> "
msgstr "<b>Überweisungsgebühr:</b> "
-#: ../../../ui.cpp:1360
+#: ../../../src/ui.cpp:1633
msgid "<b>Net amount:</b> "
msgstr "<b>Nettobetrag:</b> "
-#: ../../../ui.cpp:1367
+#: ../../../src/ui.cpp:1640
msgid "Message:"
msgstr "Nachricht:"
-#: ../../../ui.cpp:1370
+#: ../../../src/ui.cpp:1642
+msgid "Comment:"
+msgstr "Kommentar:"
+
+#: ../../../src/ui.cpp:1645
msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
-msgstr ""
-"Erzeugte Münzen müssen 120 Blöcke lang reifen. Als Sie diesen Block erzeugt haben, wurde er an alle Teilnehmer übertragen, damit er zur Block-Kette hinzugefügt werden kann. Falls der Block es nicht in die Block-Kette schafft, wird die Beschreibung zu \"nicht akzeptiert\" geändert, und Sie können die Münzen nicht ausgeben. Dies kann manchmal "
-"passieren, wenn Sie und ein anderer Teilnehmer annähernd zeitgleich einen Block erzeugen."
+msgstr "Erzeugte Münzen müssen 120 Blöcke lang reifen. Als Sie diesen Block erzeugt haben, wurde er an alle Teilnehmer übertragen, damit er zur Block-Kette hinzugefügt werden kann. Falls der Block es nicht in die Block-Kette schafft, wird die Beschreibung zu \"nicht akzeptiert\" geändert, und Sie können die Münzen nicht ausgeben. Dies kann manchmal passieren, wenn Sie und ein anderer Teilnehmer annähernd zeitgleich einen Block erzeugen."
+
+#: ../../../src/ui.cpp:1825
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Kann Datei autostart/bitcoin.desktop nicht schreiben"
-#: ../../../ui.cpp:1437
+#: ../../../src/ui.cpp:1861
msgid "Main"
msgstr "Haupt"
-#: ../../../ui.cpp:1442
+#: ../../../src/ui.cpp:1871
+msgid "&Start Bitcoin on window system startup"
+msgstr "Bitcoin beim &Systemstart ausführen"
+
+#: ../../../src/ui.cpp:1878
msgid "&Minimize on close"
-msgstr "Beim schließen &Minimieren"
+msgstr "Beim Schließen &minimieren"
-#: ../../../ui.cpp:1595
+#: ../../../src/ui.cpp:2020
#, c-format
-msgid "version %s%s BETA"
-msgstr "Version %s%s BETA"
+msgid "version %s"
+msgstr "Version %s"
-#: ../../../ui.cpp:1681
-msgid "Will appear as \"From: Unknown\""
-msgstr "Wird als \"Von: Unbekannt\" erscheinen"
-
-#: ../../../ui.cpp:1681
-msgid "n/a"
-msgstr "Unbekannt"
-
-#: ../../../ui.cpp:1681
-msgid "Unknown"
-msgstr "Unbekannt"
-
-#: ../../../ui.cpp:1682
-msgid "Can't include a message when sending to a Bitcoin address"
-msgstr "Beim überweisen an eine Bitcoin-Adresse kann keine Nachricht angegeben werden."
-
-#: ../../../ui.cpp:1735
+#: ../../../src/ui.cpp:2143
msgid "Error in amount "
msgstr "Fehler in Betrag "
-#: ../../../ui.cpp:1735
-#: ../../../ui.cpp:1740
-#: ../../../ui.cpp:1745
-#: ../../../ui.cpp:1771
-#: ../../../uibase.cpp:61
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2202
+#: ../../../src/uibase.cpp:61
msgid "Send Coins"
msgstr "Überweisen"
-#: ../../../ui.cpp:1740
+#: ../../../src/ui.cpp:2148
msgid "Amount exceeds your balance "
msgstr "Der Betrag übersteigt Ihr Guthaben "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:2153
msgid "Total exceeds your balance when the "
-msgstr "Der Betrag übersteigt Ihr Guthaben, wenn man die Überweisungsgebühr von "
+msgstr "Der Betrag übersteigt Ihr Guthaben, wenn man die "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:2153
msgid " transaction fee is included "
-msgstr " berücksichtigt "
+msgstr " Überweisungsgebühr berücksichtigt "
-#: ../../../ui.cpp:1761
+#: ../../../src/ui.cpp:2176
msgid "Payment sent "
msgstr "Zahlung überwiesen "
-#: ../../../ui.cpp:1771
+#: ../../../src/ui.cpp:2176
+#: ../../../src/ui.cpp:2185
+#: ../../../src/ui.cpp:2336
+#: ../../../src/ui.cpp:2500
+#: ../../../src/wallet.cpp:1097
+msgid "Sending..."
+msgstr "Überweise ..."
+
+#: ../../../src/ui.cpp:2202
msgid "Invalid address "
msgstr "Ungültige Adresse "
-#: ../../../ui.cpp:1825
+#: ../../../src/ui.cpp:2257
#, c-format
msgid "Sending %s to %s"
msgstr "Überweise %s an %s"
-#: ../../../ui.cpp:1898
-#: ../../../ui.cpp:1931
+#: ../../../src/ui.cpp:2330
+#: ../../../src/ui.cpp:2363
msgid "CANCELLED"
msgstr "ANNULLIERT"
-#: ../../../ui.cpp:1902
+#: ../../../src/ui.cpp:2334
msgid "Cancelled"
msgstr "Annulliert"
-#: ../../../ui.cpp:1904
+#: ../../../src/ui.cpp:2336
msgid "Transfer cancelled "
msgstr "Überweisung annulliert "
-#: ../../../ui.cpp:1957
+#: ../../../src/ui.cpp:2389
msgid "Error: "
msgstr "Fehler: "
-#: ../../../ui.cpp:1976
+#: ../../../src/ui.cpp:2403
+#: ../../../src/ui.cpp:2474
+#: ../../../src/wallet.cpp:1116
+msgid "Insufficient funds"
+msgstr "Unzureichende Geldmittel"
+
+#: ../../../src/ui.cpp:2408
msgid "Connecting..."
-msgstr "Verbinde..."
+msgstr "Verbinde ..."
-#: ../../../ui.cpp:1981
+#: ../../../src/ui.cpp:2413
msgid "Unable to connect"
msgstr "Kann nicht verbinden"
-#: ../../../ui.cpp:1986
+#: ../../../src/ui.cpp:2418
msgid "Requesting public key..."
-msgstr "Fordere öffentlichen Schlüssel an..."
+msgstr "Fordere öffentlichen Schlüssel an ..."
-#: ../../../ui.cpp:1998
+#: ../../../src/ui.cpp:2430
msgid "Received public key..."
-msgstr "Öffentlichen Schlüssel empfangen..."
+msgstr "Öffentlicher Schlüssel empfangen ..."
+
+#: ../../../src/ui.cpp:2444
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Empfänger akzeptiert keine Überweisungen von IP-Adressen"
-#: ../../../ui.cpp:2010
+#: ../../../src/ui.cpp:2446
msgid "Transfer was not accepted"
msgstr "Überweisung wurde nicht akzeptiert"
-#: ../../../ui.cpp:2019
+#: ../../../src/ui.cpp:2455
msgid "Invalid response received"
msgstr "Ungültige Antwort erhalten"
-#: ../../../ui.cpp:2034
+#: ../../../src/ui.cpp:2470
msgid "Creating transaction..."
-msgstr "Erstelle Überweisung..."
+msgstr "Erstelle Überweisung ..."
-#: ../../../ui.cpp:2046
+#: ../../../src/ui.cpp:2489
#, c-format
-msgid "This is an oversized transaction that requires a transaction fee of %s"
-msgstr "Die Überweisung ist sehr groß. Es wird eine Gebühr von %s erhoben."
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Diese Überweisung benötigt eine Überweisungsgebühr von mindestens %s wegen ihres Betrags, Komplexität oder der Benutzung kürzlich erhaltener Geldmittel"
-#: ../../../ui.cpp:2048
+#: ../../../src/ui.cpp:2491
msgid "Transaction creation failed"
msgstr "Überweisung konnte nicht erzeugt werden."
-#: ../../../ui.cpp:2055
+#: ../../../src/ui.cpp:2502
msgid "Transaction aborted"
msgstr "Überweisung abgebrochen"
-#: ../../../ui.cpp:2063
+#: ../../../src/ui.cpp:2510
msgid "Lost connection, transaction cancelled"
msgstr "Verbindung verloren, Überweisungsvorgang abgebrochen"
-#: ../../../ui.cpp:2079
+#: ../../../src/ui.cpp:2526
msgid "Sending payment..."
-msgstr "Überweise Zahlung..."
+msgstr "Überweise Zahlung ..."
-#: ../../../ui.cpp:2085
+#: ../../../src/ui.cpp:2532
msgid "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."
msgstr "Die Überweisung wurde abgelehnt. Das kann passieren, wenn einige der Münzen in Ihrer Brieftasche bereits ausgegeben wurden, z.B. weil Sie eine Kopie der Brieftasche (wallet.dat) gemacht haben. Bitcoins, die mithilfe der Kopie ausgegeben wurden, sind in dieser Brieftasche noch nicht als ausgegeben markiert worden."
-#: ../../../ui.cpp:2092
+#: ../../../src/ui.cpp:2541
msgid "Waiting for confirmation..."
-msgstr "Warte auf Bestätigung..."
+msgstr "Warte auf Bestätigung ..."
-#: ../../../ui.cpp:2110
+#: ../../../src/ui.cpp:2559
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
@@ -461,246 +691,253 @@ msgid ""
msgstr ""
"Die Zahlung wurde überwiesen, aber der Empfänger konnte sie nicht bestätigen.\n"
"Die Überweisung wurde gespeichert und wird dem Empfänger gutgeschrieben,\n"
-"aber die begleitende Nachricht wird nicht ankommen."
+"aber die begleitende Nachricht wird leer sein."
-#: ../../../ui.cpp:2119
+#: ../../../src/ui.cpp:2568
msgid "Payment was sent, but an invalid response was received"
msgstr "Die Zahlung wurde überwiesen, aber die Antwort war fehlerhaft"
-#: ../../../ui.cpp:2125
+#: ../../../src/ui.cpp:2574
msgid "Payment completed"
msgstr "Zahlung ausgeführt"
-#: ../../../ui.cpp:2156
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2616
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2804
msgid "Name"
msgstr "Name"
-#: ../../../ui.cpp:2157
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2617
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2804
msgid "Address"
msgstr "Adresse"
-#: ../../../ui.cpp:2159
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2619
+#: ../../../src/ui.cpp:2776
msgid "Label"
msgstr "Beschreibung"
-#: ../../../ui.cpp:2160
-#: ../../../uibase.cpp:908
+#: ../../../src/ui.cpp:2620
+#: ../../../src/uibase.cpp:847
msgid "Bitcoin Address"
msgstr "Bitcoin-Adresse"
-#: ../../../ui.cpp:2284
+#: ../../../src/ui.cpp:2746
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Dies ist eine Ihrer eigenen Adressen für den Zahlungseingang und kann deshalb nicht in das Adressbuch übernommen werden. "
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2308
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2770
msgid "Edit Address"
msgstr "Adresse bearbeiten"
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2776
msgid "Edit Address Label"
msgstr "Beschreibung der Adresse bearbeiten"
-#: ../../../ui.cpp:2339
-#: ../../../ui.cpp:2345
+#: ../../../src/ui.cpp:2804
+#: ../../../src/ui.cpp:2810
msgid "Add Address"
msgstr "Adresse hinzufügen"
-#: ../../../ui.cpp:2421
+#: ../../../src/ui.cpp:2898
msgid "Bitcoin"
msgstr "Bitcoin"
-#: ../../../ui.cpp:2423
+#: ../../../src/ui.cpp:2900
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Erzeuge"
-#: ../../../ui.cpp:2425
+#: ../../../src/ui.cpp:2902
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (nicht verbunden)"
-#: ../../../ui.cpp:2500
+#: ../../../src/ui.cpp:2981
msgid "&Open Bitcoin"
-msgstr "Bitcoin Ö&ffnen"
+msgstr "Bitcoin ö&ffnen"
-#: ../../../ui.cpp:2501
-msgid "O&ptions..."
-msgstr "O&ptionen..."
+#: ../../../src/ui.cpp:2982
+msgid "&Send Bitcoins"
+msgstr "Bitcoins &senden"
-#: ../../../ui.cpp:2502
-#: ../../../uibase.cpp:34
-msgid "&Generate Coins"
-msgstr "Münzen Er&zeugen"
+#: ../../../src/ui.cpp:2983
+msgid "O&ptions..."
+msgstr "O&ptionen ..."
-#: ../../../ui.cpp:2505
-#: ../../../uibase.cpp:27
+#: ../../../src/ui.cpp:2986
+#: ../../../src/uibase.cpp:25
msgid "E&xit"
msgstr "B&eenden"
-#: ../../../uibase.cpp:30
+#: ../../../src/ui.cpp:3212
+msgid "Program has crashed and will terminate. "
+msgstr "Das Programm ist abgestürzt und wird beendet. "
+
+#: ../../../src/uibase.cpp:28
msgid "&File"
msgstr "&Datei"
-#: ../../../uibase.cpp:38
+#: ../../../src/uibase.cpp:32
msgid "&Your Receiving Addresses..."
msgstr "&Ihre Empfangs-Adressen..."
-#: ../../../uibase.cpp:42
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "Bri&eftasche verschlüsseln..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "Passphrase der Vers&chlüsselung der Brieftasche ändern..."
+
+#: ../../../src/uibase.cpp:42
msgid "&Options..."
msgstr "&Optionen..."
-#: ../../../uibase.cpp:45
+#: ../../../src/uibase.cpp:45
msgid "&Settings"
msgstr "&Einstellungen"
-#: ../../../uibase.cpp:49
+#: ../../../src/uibase.cpp:49
msgid "&About..."
msgstr "Ü&ber..."
-#: ../../../uibase.cpp:52
+#: ../../../src/uibase.cpp:52
msgid "&Help"
msgstr "&Hilfe"
-#: ../../../uibase.cpp:62
+#: ../../../src/uibase.cpp:62
msgid "Address Book"
msgstr "Adressbuch"
-#: ../../../uibase.cpp:77
+#: ../../../src/uibase.cpp:75
msgid "Your Bitcoin Address:"
msgstr "Ihre Bitcoin-Adresse:"
-#: ../../../uibase.cpp:84
+#: ../../../src/uibase.cpp:82
msgid " &New... "
msgstr " &Neu... "
-#: ../../../uibase.cpp:87
-#: ../../../uibase.cpp:851
-#: ../../../uibase.cpp:954
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
msgid " &Copy to Clipboard "
msgstr " In die Zwischenablage &kopieren "
-#: ../../../uibase.cpp:102
+#: ../../../src/uibase.cpp:99
msgid "Balance:"
msgstr "Kontostand:"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:115
msgid " All"
msgstr " Alle"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:115
msgid " Sent"
msgstr " Überwiesen"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:115
msgid " Received"
msgstr " Erhalten"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:115
msgid " In Progress"
msgstr " In Bearbeitung"
-#: ../../../uibase.cpp:142
+#: ../../../src/uibase.cpp:136
msgid "All Transactions"
msgstr "Alle Überweisungen"
-#: ../../../uibase.cpp:153
+#: ../../../src/uibase.cpp:147
msgid "Sent/Received"
msgstr "Überwiesen/Erhalten"
-#: ../../../uibase.cpp:164
+#: ../../../src/uibase.cpp:158
msgid "Sent"
msgstr "Überwiesen"
-#: ../../../uibase.cpp:175
+#: ../../../src/uibase.cpp:169
msgid "Received"
msgstr "Erhalten"
-#: ../../../uibase.cpp:318
-#: ../../../uibase.cpp:479
-#: ../../../uibase.cpp:580
-#: ../../../uibase.cpp:793
-#: ../../../uibase.cpp:854
-#: ../../../uibase.cpp:963
-#: ../../../uibase.cpp:1052
+#: ../../../src/uibase.cpp:312
+#: ../../../src/uibase.cpp:453
+#: ../../../src/uibase.cpp:552
+#: ../../../src/uibase.cpp:732
+#: ../../../src/uibase.cpp:793
+#: ../../../src/uibase.cpp:902
+#: ../../../src/uibase.cpp:991
msgid "OK"
msgstr "OK"
-#: ../../../uibase.cpp:361
-msgid "Optional transaction fee you give to the nodes that process your transactions."
-msgstr "Optionale Überweisungsgebühr, die Sie an den Teilnehmer entrichten, der Ihre Überweisungen bearbeitet."
-
-#: ../../../uibase.cpp:370
-msgid "Transaction fee:"
-msgstr "Überweisungsgebühr:"
-
-#: ../../../uibase.cpp:386
-msgid "&Limit coin generation to"
-msgstr "Erzeugung von Münzen auf"
-
-#: ../../../uibase.cpp:393
-msgid "processors"
-msgstr "Prozessoren &beschränken"
-
-#: ../../../uibase.cpp:399
+#: ../../../src/uibase.cpp:355
msgid "&Start Bitcoin on system startup"
msgstr "Bitcoin beim &Systemstart ausführen"
-#: ../../../uibase.cpp:403
+#: ../../../src/uibase.cpp:358
msgid "&Minimize to the tray instead of the taskbar"
msgstr "In den Infobereich statt in die Taskleiste &minimieren"
-#: ../../../uibase.cpp:407
+#: ../../../src/uibase.cpp:361
+msgid "Map port using &UPnP"
+msgstr "Portweiterleitung via &UPnP"
+
+#: ../../../src/uibase.cpp:364
msgid "M&inimize to the tray on close"
-msgstr "Beim schließen in den Infobereich m&inimieren"
+msgstr "Beim Schließen in den Infobereich m&inimieren"
-#: ../../../uibase.cpp:414
+#: ../../../src/uibase.cpp:370
msgid "&Connect through socks4 proxy: "
-msgstr "&Verbinden per Socks4-Proxy: "
+msgstr "&Per Socks4-Proxy verbinden: "
-#: ../../../uibase.cpp:426
+#: ../../../src/uibase.cpp:381
msgid "Proxy &IP:"
-msgstr "Proxy &IP:"
+msgstr "Proxy-&IP:"
-#: ../../../uibase.cpp:434
+#: ../../../src/uibase.cpp:389
msgid " &Port:"
msgstr " &Port:"
-#: ../../../uibase.cpp:456
+#: ../../../src/uibase.cpp:402
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Eine freiwillige Überweisungsgebühr pro KB, die dabei hilft, dass Ihre Überweisungen schnell durchgeführt werden. Die meisten Überweisungen sind 1 KB groß. Eine Gebühr von 0,01 ist empfohlen."
+
+#: ../../../src/uibase.cpp:409
+msgid "Pay transaction fee:"
+msgstr "Überweisungsgebühr:"
+
+#: ../../../src/uibase.cpp:430
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
-#: ../../../uibase.cpp:460
+#: ../../../src/uibase.cpp:434
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
-#: ../../../uibase.cpp:482
-#: ../../../uibase.cpp:735
-#: ../../../uibase.cpp:798
-#: ../../../uibase.cpp:857
-#: ../../../uibase.cpp:966
-#: ../../../uibase.cpp:1055
+#: ../../../src/uibase.cpp:456
+#: ../../../src/uibase.cpp:678
+#: ../../../src/uibase.cpp:737
+#: ../../../src/uibase.cpp:796
+#: ../../../src/uibase.cpp:905
+#: ../../../src/uibase.cpp:994
msgid "Cancel"
msgstr "Abbrechen"
-#: ../../../uibase.cpp:485
+#: ../../../src/uibase.cpp:459
msgid "&Apply"
msgstr "&Anwenden"
-#: ../../../uibase.cpp:546
+#: ../../../src/uibase.cpp:518
msgid "Bitcoin "
msgstr "Bitcoin "
-#: ../../../uibase.cpp:552
+#: ../../../src/uibase.cpp:524
msgid "version"
msgstr "Version"
-#: ../../../uibase.cpp:563
+#: ../../../src/uibase.cpp:535
msgid ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -711,7 +948,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
msgstr ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"Dies ist experimentelle Software.\n"
"\n"
@@ -719,51 +956,43 @@ msgstr ""
"Datei license.txt oder http://www.opensource.org/licenses/mit-license.php.\n"
"\n"
"Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Nutzung im\n"
-"OpenSSL Toolkit (http://www.openssl.org/) geschrieben wurde sowie\n"
+"OpenSSL Toolkit (http://www.openssl.org/) geschrieben wurde, sowie\n"
"kryptographische Software von Eric Young (eay@cryptsoft.com)\n"
"und UPnP-Software, entwickelt von Thomas Bernard."
-#: ../../../uibase.cpp:619
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
-msgstr "Geben Sie eine Bitcoin-Adresse (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) oder IP-Adresse (z.B. 123.45.6.7) ein"
+#: ../../../src/uibase.cpp:591
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Geben Sie eine Bitcoin-Adresse ein (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-#: ../../../uibase.cpp:633
+#: ../../../src/uibase.cpp:605
msgid "Pay &To:"
msgstr "Überweisen &An:"
-#: ../../../uibase.cpp:648
+#: ../../../src/uibase.cpp:620
msgid "&Paste"
msgstr "&Einfügen"
-#: ../../../uibase.cpp:651
+#: ../../../src/uibase.cpp:623
msgid " Address &Book..."
msgstr " Address&buch..."
-#: ../../../uibase.cpp:658
+#: ../../../src/uibase.cpp:630
msgid "&Amount:"
msgstr "&Betrag:"
-#: ../../../uibase.cpp:668
+#: ../../../src/uibase.cpp:640
msgid "T&ransfer:"
msgstr "Ü&berweisung:"
-#: ../../../uibase.cpp:674
+#: ../../../src/uibase.cpp:646
msgid " Standard"
msgstr " Standard"
-#: ../../../uibase.cpp:696
-msgid "&From:"
-msgstr "&Von:"
-
-#: ../../../uibase.cpp:713
-msgid "&Message:"
-msgstr "&Nachricht:"
-
-#: ../../../uibase.cpp:730
+#: ../../../src/uibase.cpp:673
msgid "&Send"
msgstr "Ü&berweisen"
-#: ../../../uibase.cpp:782
+#: ../../../src/uibase.cpp:721
msgid ""
"\n"
"\n"
@@ -771,50 +1000,84 @@ msgid ""
msgstr ""
"\n"
"\n"
-"Verbinde..."
+"Verbinde ..."
-#: ../../../uibase.cpp:832
+#: ../../../src/uibase.cpp:771
msgid "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. The highlighted address is displayed in the main window."
msgstr "Dies sind Ihre Bitcoin-Adressen zum Empfang von Zahlungen. Sie sollten vielleicht jedem Überweisenden eine andere Adresse geben um nachvollziehen zu können von wem eine Zahlung stammt. Die markierte Adresse wird im Hauptfenster angezeigt."
-#: ../../../uibase.cpp:845
-#: ../../../uibase.cpp:957
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
msgid "&Edit..."
msgstr "&Bearbeiten..."
-#: ../../../uibase.cpp:848
-#: ../../../uibase.cpp:960
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
msgid " &New Address... "
msgstr " &Neue Adresse... "
-#: ../../../uibase.cpp:920
+#: ../../../src/uibase.cpp:859
msgid "Sending"
msgstr "Überweise"
-#: ../../../uibase.cpp:928
+#: ../../../src/uibase.cpp:867
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
msgstr "Dies sind Ihre Bitcoin-Adressen zum Empfang von Zahlungen. Sie können jedem Überweisenden eine andere Adresse geben um nachvollziehen zu können von wem eine Zahlung stammt. Die markierte Adresse wird im Hauptfenster angezeigt."
-#: ../../../uibase.cpp:941
+#: ../../../src/uibase.cpp:880
msgid "Receiving"
msgstr "Empfange"
-#: ../../../uibase.cpp:951
+#: ../../../src/uibase.cpp:890
msgid "&Delete"
msgstr "&Löschen"
-#: ../../../uibase.h:150
+#: ../../../src/util.cpp:869
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Warnung: Bitte überprüfen Sie die Richtigkeit des Datums und der Uhrzeit Ihres Computers. Falls Ihre Uhr falsch läuft, wird Bitcoin nicht richtig funktionieren."
+
+#: ../../../src/util.cpp:903
+msgid "beta"
+msgstr "Beta"
+
+#: ../../../src/wallet.cpp:1081
+msgid "Error: Wallet locked, unable to create transaction "
+msgstr "Fehler: Brieftasche ist verschlossen; Überweisung konnte nicht erstellt werden "
+
+#: ../../../src/wallet.cpp:1089
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Fehler: Diese Überweisung benötigt eine Überweisungsgebühr von mindestens %s wegen ihrer Größe, Komplexität oder der Benutzung erst kürzlich erhaltener Geldmittel "
+
+#: ../../../src/wallet.cpp:1091
+msgid "Error: Transaction creation failed "
+msgstr "Fehler: Überweisung konnte nicht erzeugt werden. "
+
+#: ../../../src/wallet.cpp:1101
+msgid "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."
+msgstr "Fehler: Die Überweisung wurde abgelehnt. Das kann passieren, wenn einige der Münzen in Ihrer Brieftasche bereits ausgegeben wurden, z.B. weil Sie eine Kopie der Brieftasche (wallet.dat) gemacht haben. Bitcoins, die mithilfe der Kopie ausgegeben wurden, sind in dieser Brieftasche noch nicht als ausgegeben markiert worden."
+
+#: ../../../src/wallet.cpp:1114
+msgid "Invalid amount"
+msgstr "Ungültiger Betrag"
+
+#: ../../../src/wallet.cpp:1121
+msgid "Invalid bitcoin address"
+msgstr "Ungültige Bitcoin-Adresse"
+
+#: ../../../src/uibase.h:151
msgid "Transaction Details"
msgstr "Überweisungsdetails"
-#: ../../../uibase.h:203
+#: ../../../src/uibase.h:203
msgid "Options"
msgstr "Optionen"
-#: ../../../uibase.h:231
+#: ../../../src/uibase.h:232
msgid "About Bitcoin"
msgstr "Über Bitcoin"
-#: ../../../uibase.h:341
+#: ../../../src/uibase.h:341
msgid "Your Bitcoin Addresses"
msgstr "Ihre Bitcoin-Adressen"
+
diff --git a/locale/eo/LC_MESSAGES/bitcoin.mo b/locale/eo/LC_MESSAGES/bitcoin.mo
new file mode 100644
index 0000000000..5f898f2a5d
--- /dev/null
+++ b/locale/eo/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/eo/LC_MESSAGES/bitcoin.po b/locale/eo/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..e144cd8c76
--- /dev/null
+++ b/locale/eo/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,1029 @@
+#
+# Danube <none>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bitcoin 0.3.22\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-05-15 18:18+0100\n"
+"PO-Revision-Date: 2011-05-23 19:47+0200\n"
+"Last-Translator: Danube <none>\n"
+"Language-Team: Esperanto <none>\n"
+"Language: Esperanto\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: j\n"
+"X-Poedit-Language: Esperanto\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/net.cpp:1499
+#, c-format
+msgid ""
+"Unable to bind to port %d on this computer. Bitcoin is probably already "
+"running."
+msgstr ""
+"Ne povis alligi al la porton %d ĉe ĉi tiu komputilo. Verŝajne la Bitmonero "
+"jam estas rulanta."
+
+#: ../../../src/ui.cpp:202
+#, c-format
+msgid ""
+"This transaction is over the size limit. You can still send it for a fee of "
+"%s, which goes to the nodes that process your transaction and helps to "
+"support the network. Do you want to pay the fee?"
+msgstr ""
+"Tiu ĉi transakcio transpasas la grandeclimiton. Tamen vi povas sendi ĝin "
+"pagante transakcian koston de %s. Tiun koston ricevas la nodoj, kiuj "
+"realigas vian transakcion kaj kiuj helpas subteni la reton. Ĉu vi volas pagi "
+"la transakcian koston?"
+
+#: ../../../src/ui.cpp:301
+msgid "Status"
+msgstr "Stato"
+
+#: ../../../src/ui.cpp:302
+msgid "Date"
+msgstr "Dato"
+
+#: ../../../src/ui.cpp:303
+msgid "Description"
+msgstr "Priskribo"
+
+#: ../../../src/ui.cpp:304
+msgid "Debit"
+msgstr "Debeto"
+
+#: ../../../src/ui.cpp:305
+msgid "Credit"
+msgstr "Kredito"
+
+#: ../../../src/ui.cpp:511
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Malfermita por %d blokoj"
+
+#: ../../../src/ui.cpp:513
+#, c-format
+msgid "Open until %s"
+msgstr "Malfermita ĝis %s"
+
+#: ../../../src/ui.cpp:519
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/senkonekta?"
+
+#: ../../../src/ui.cpp:521
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/ne konfirmita"
+
+#: ../../../src/ui.cpp:523
+#, c-format
+msgid "%d confirmations"
+msgstr "%d konfirmoj"
+
+#: ../../../src/ui.cpp:608
+msgid "Generated"
+msgstr "Kreita"
+
+#: ../../../src/ui.cpp:616
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Kreita (%s maturiĝos post %d blokoj)"
+
+#: ../../../src/ui.cpp:620
+msgid ""
+"Generated - Warning: This block was not received by any other nodes and will "
+"probably not be accepted!"
+msgstr ""
+"Kreita - Averto: Tiu bloko ne estas ricevita de iuj ajn aliaj nodoj! "
+"Verŝajne ĝi ne estos akceptita!"
+
+#: ../../../src/ui.cpp:624
+msgid "Generated (not accepted)"
+msgstr "Kreita (ne akceptita)"
+
+#: ../../../src/ui.cpp:634
+msgid "From: "
+msgstr "De: "
+
+#: ../../../src/ui.cpp:658
+msgid "Received with: "
+msgstr "Ricevita per: "
+
+#: ../../../src/ui.cpp:704
+msgid "Payment to yourself"
+msgstr "Pago al vi mem"
+
+#: ../../../src/ui.cpp:738
+msgid "To: "
+msgstr "Al: "
+
+#: ../../../src/ui.cpp:1053
+msgid " Generating"
+msgstr " Kreanta"
+
+#: ../../../src/ui.cpp:1055
+msgid "(not connected)"
+msgstr "(ne konektita)"
+
+#: ../../../src/ui.cpp:1058
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d konektoj %d blokoj %d transakcioj"
+
+#: ../../../src/ui.cpp:1163 ../../../src/ui.cpp:2527
+msgid "New Receiving Address"
+msgstr "Nova Ricevadreso"
+
+#: ../../../src/ui.cpp:1164 ../../../src/ui.cpp:2528
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Uzu novan adreson por ĉiu ajn pago kiu vi ricevos.\n"
+"\n"
+"Etikedo"
+
+#: ../../../src/ui.cpp:1233
+msgid "<b>Status:</b> "
+msgstr "<b>Stato:</b> "
+
+#: ../../../src/ui.cpp:1238
+msgid ", has not been successfully broadcast yet"
+msgstr ", ankoraŭ ne estas dissendita sukcese"
+
+#: ../../../src/ui.cpp:1240
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", estas dissendita per %d nodo"
+
+#: ../../../src/ui.cpp:1242
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", estas dissendita per %d nodoj"
+
+#: ../../../src/ui.cpp:1246
+msgid "<b>Date:</b> "
+msgstr "<b>Dato:</b> "
+
+#: ../../../src/ui.cpp:1254
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Fonto:</b> Kreita<br>"
+
+#: ../../../src/ui.cpp:1260 ../../../src/ui.cpp:1278
+msgid "<b>From:</b> "
+msgstr "<b>De:</b> "
+
+#: ../../../src/ui.cpp:1278
+msgid "unknown"
+msgstr "nekonata"
+
+#: ../../../src/ui.cpp:1279 ../../../src/ui.cpp:1303 ../../../src/ui.cpp:1362
+msgid "<b>To:</b> "
+msgstr "<b>Al:</b> "
+
+#: ../../../src/ui.cpp:1282
+msgid " (yours, label: "
+msgstr " (via, etikedo: "
+
+#: ../../../src/ui.cpp:1284
+msgid " (yours)"
+msgstr " (via)"
+
+#: ../../../src/ui.cpp:1321 ../../../src/ui.cpp:1333 ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:1396
+msgid "<b>Credit:</b> "
+msgstr "<b>Кredito:</b> "
+
+#: ../../../src/ui.cpp:1323
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s maturiĝos post %d blokoj)"
+
+#: ../../../src/ui.cpp:1325
+msgid "(not accepted)"
+msgstr "(ne akceptita)"
+
+#: ../../../src/ui.cpp:1370 ../../../src/ui.cpp:1378 ../../../src/ui.cpp:1393
+msgid "<b>Debit:</b> "
+msgstr "<b>Debeto:</b> "
+
+#: ../../../src/ui.cpp:1384
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Transakcia kosto:</b> "
+
+#: ../../../src/ui.cpp:1400
+msgid "<b>Net amount:</b> "
+msgstr "<b>Neta kvanto:</b> "
+
+#: ../../../src/ui.cpp:1407
+msgid "Message:"
+msgstr "Mesaĝo:"
+
+#: ../../../src/ui.cpp:1409
+msgid "Comment:"
+msgstr "Komento:"
+
+#: ../../../src/ui.cpp:1412
+msgid ""
+"Generated coins must wait 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, it will change to \"not "
+"accepted\" and not be spendable. This may occasionally happen if another "
+"node generates a block within a few seconds of yours."
+msgstr ""
+"Kreitaj moneroj devas atendi dum 120 blokoj ĝis ili povas esti elspezita. "
+"Kiam vi kreis tiun blokon, ĝi estis dissendita al la reton por esti "
+"inkludita en la blokĉeno. Se ĝi malsukcesos esti inkludita en la ĉeno, ĝi "
+"ŝanĝiĝos al \\\"ne akceptita\\\" kaj estos neelspezebla. Kelkfoje tio povas "
+"okazi se alia nodo kreas blokon samtempe (dum kelkaj sekundoj)."
+
+#: ../../../src/ui.cpp:1592
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Ne povas skribi la dosieron autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1628
+msgid "Main"
+msgstr "Ĉefa"
+
+#: ../../../src/ui.cpp:1636
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Lanĉu Bitmoneron kiam vindozo ekas"
+
+#: ../../../src/ui.cpp:1643
+msgid "&Minimize on close"
+msgstr "Nur &kaŝiĝi anstataŭ malfermiĝi"
+
+#: ../../../src/ui.cpp:1785
+#, c-format
+msgid "version %s"
+msgstr "versio %s"
+
+#: ../../../src/ui.cpp:1897
+msgid "Error in amount "
+msgstr "Eraro en kvanto "
+
+#: ../../../src/ui.cpp:1897 ../../../src/ui.cpp:1902 ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:1942 ../../../src/uibase.cpp:55
+msgid "Send Coins"
+msgstr "Sendu monerojn"
+
+#: ../../../src/ui.cpp:1902
+msgid "Amount exceeds your balance "
+msgstr "Kvanto transpasas vian bonhavon "
+
+#: ../../../src/ui.cpp:1907
+msgid "Total exceeds your balance when the "
+msgstr "Entuta sumo transpasas vian bonhavon, se la "
+
+#: ../../../src/ui.cpp:1907
+msgid " transaction fee is included "
+msgstr " transakcia kosto estas inkludita "
+
+#: ../../../src/ui.cpp:1925
+msgid "Payment sent "
+msgstr "Pago sendita "
+
+#: ../../../src/ui.cpp:1925 ../../../src/ui.cpp:1930 ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2227 ../../../src/main.cpp:3999
+msgid "Sending..."
+msgstr "Sendanta..."
+
+#: ../../../src/ui.cpp:1942
+msgid "Invalid address "
+msgstr "Malvalida adreso "
+
+#: ../../../src/ui.cpp:1995
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Sendanta %s al %s"
+
+#: ../../../src/ui.cpp:2068 ../../../src/ui.cpp:2101
+msgid "CANCELLED"
+msgstr "MALVALIDIGITA"
+
+#: ../../../src/ui.cpp:2072
+msgid "Cancelled"
+msgstr "Malvalidigita"
+
+#: ../../../src/ui.cpp:2074
+msgid "Transfer cancelled "
+msgstr "Transfero malvalidigita "
+
+#: ../../../src/ui.cpp:2127
+msgid "Error: "
+msgstr "Eraro: "
+
+#: ../../../src/ui.cpp:2141 ../../../src/ui.cpp:2212
+#: ../../../src/main.cpp:4018
+msgid "Insufficient funds"
+msgstr "Malsufiĉa mono"
+
+#: ../../../src/ui.cpp:2146
+msgid "Connecting..."
+msgstr "Konektanta..."
+
+#: ../../../src/ui.cpp:2151
+msgid "Unable to connect"
+msgstr "Ne povas konekti"
+
+#: ../../../src/ui.cpp:2156
+msgid "Requesting public key..."
+msgstr "Postulanta publikan ĉifroŝlosilon..."
+
+#: ../../../src/ui.cpp:2168
+msgid "Received public key..."
+msgstr "Ricevinta publikan ĉifroŝlosilon..."
+
+#: ../../../src/ui.cpp:2182
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Adresato ne akceptas transakciojn senditajn per IP adreso"
+
+#: ../../../src/ui.cpp:2184
+msgid "Transfer was not accepted"
+msgstr "Transfero ne estis akceptita"
+
+#: ../../../src/ui.cpp:2193
+msgid "Invalid response received"
+msgstr "Malvalida respondo ricevita"
+
+#: ../../../src/ui.cpp:2208
+msgid "Creating transaction..."
+msgstr "Kreanta la transakcion..."
+
+#: ../../../src/ui.cpp:2220
+#, c-format
+msgid ""
+"This transaction requires a transaction fee of at least %s because of its "
+"amount, complexity, or use of recently received funds"
+msgstr ""
+"Tiu ĉi transakcio necesas transakcian koston de minimume %s, ĉar ĝia kvanto "
+"aŭ ĝia komplekseco aŭ la uzo de mono lastatempe ricevita."
+
+#: ../../../src/ui.cpp:2222
+msgid "Transaction creation failed"
+msgstr "La transakcio ne funkciis"
+
+#: ../../../src/ui.cpp:2229
+msgid "Transaction aborted"
+msgstr "Transakcio malvalidigita"
+
+#: ../../../src/ui.cpp:2237
+msgid "Lost connection, transaction cancelled"
+msgstr "Perdis la konekton, transakcio malvalidigita"
+
+#: ../../../src/ui.cpp:2253
+msgid "Sending payment..."
+msgstr "Sendanta pagon..."
+
+#: ../../../src/ui.cpp:2259
+msgid ""
+"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."
+msgstr ""
+"La transakcio estas malakceptita. Tio povas okazi se iom da moneroj en via "
+"monujo jam estis elspezata, ekzemple se vi uzis kopion de la monujo wallet."
+"dat kaj moneroj estis elspezita en la kopio, sed ne estas markata kiel "
+"elspezata ĉi tie."
+
+#: ../../../src/ui.cpp:2268
+msgid "Waiting for confirmation..."
+msgstr "Atendanta la konfirmon..."
+
+#: ../../../src/ui.cpp:2286
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"La pago estis sendita, sed la ricevanto ne povis atesti ĝin.\n"
+"La transakcio estas registrita kaj estos skribita en la krediton de la "
+"ricevanto,\n"
+"sed la komenta informo estas malplena."
+
+#: ../../../src/ui.cpp:2295
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Pago estis sendita, sed malvalida respondo estas ricivita"
+
+#: ../../../src/ui.cpp:2301
+msgid "Payment completed"
+msgstr "Pago kompletigita"
+
+#: ../../../src/ui.cpp:2332 ../../../src/ui.cpp:2478 ../../../src/ui.cpp:2515
+msgid "Name"
+msgstr "Nomo"
+
+#: ../../../src/ui.cpp:2333 ../../../src/ui.cpp:2478 ../../../src/ui.cpp:2515
+msgid "Address"
+msgstr "Adreso"
+
+#: ../../../src/ui.cpp:2335 ../../../src/ui.cpp:2490
+msgid "Label"
+msgstr "Etikedo"
+
+#: ../../../src/ui.cpp:2336 ../../../src/uibase.cpp:837
+msgid "Bitcoin Address"
+msgstr "Bitmonera adreso"
+
+#: ../../../src/ui.cpp:2460
+msgid ""
+"This is one of your own addresses for receiving payments and cannot be "
+"entered in the address book. "
+msgstr ""
+"Tiu ĉi estas unu el viaj adresoj mem pro ricevi pagojn. Ĝi ne povas esti "
+"enskribita en la adresaro. "
+
+#: ../../../src/ui.cpp:2478 ../../../src/ui.cpp:2484
+msgid "Edit Address"
+msgstr "Editu adreson"
+
+#: ../../../src/ui.cpp:2490
+msgid "Edit Address Label"
+msgstr "Editu adresan etikedon"
+
+#: ../../../src/ui.cpp:2515 ../../../src/ui.cpp:2521
+msgid "Add Address"
+msgstr "Aldonu adreson"
+
+#: ../../../src/ui.cpp:2598
+msgid "Bitcoin"
+msgstr "Bitmonero"
+
+#: ../../../src/ui.cpp:2600
+msgid "Bitcoin - Generating"
+msgstr "Bitmonero - Kreanta"
+
+#: ../../../src/ui.cpp:2602
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (ne konektita)"
+
+#: ../../../src/ui.cpp:2681
+msgid "&Open Bitcoin"
+msgstr "&Malfermu Bitmoneron"
+
+#: ../../../src/ui.cpp:2682
+msgid "&Send Bitcoins"
+msgstr "&Sendu bitmonerojn"
+
+#: ../../../src/ui.cpp:2683
+msgid "O&ptions..."
+msgstr "&Opcioj..."
+
+#: ../../../src/ui.cpp:2686 ../../../src/uibase.cpp:25
+msgid "E&xit"
+msgstr "&Fermu"
+
+#: ../../../src/ui.cpp:2902
+msgid "Program has crashed and will terminate. "
+msgstr "La programo kraŝis kaj haltiĝos. "
+
+#: ../../../src/main.cpp:1868
+msgid "Warning: Disk space is low "
+msgstr "Averto: Malmulte da storloko "
+
+#: ../../../src/main.cpp:3992
+#, c-format
+msgid ""
+"Error: This transaction requires a transaction fee of at least %s because of "
+"its amount, complexity, or use of recently received funds "
+msgstr ""
+"Eraro: Tiu ĉi transakcio necesas transakcian koston de minimume %s, ĉar ĝia "
+"kvanto aŭ ĝia komplekseco aŭ la uzo de mono lastatempe ricevitaŭ "
+
+#: ../../../src/main.cpp:3994
+msgid "Error: Transaction creation failed "
+msgstr "Eraro: La kreado de la transakcio ne funkciis "
+
+#: ../../../src/main.cpp:4003
+msgid ""
+"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."
+msgstr ""
+"Eraro: La transakcio estas malakceptita. Tio povas okazi se iom da moneroj "
+"en via monujo jam estas elspezita, ekzemple se vi uzis kopion de la monujo "
+"wallet.dat kaj moneroj estis elspezita en la kopio, sed ne estas markata "
+"kiel elspezata ĉi tie."
+
+#: ../../../src/main.cpp:4016
+msgid "Invalid amount"
+msgstr "Malvalida kvanto"
+
+#: ../../../src/main.cpp:4023
+msgid "Invalid bitcoin address"
+msgstr "Malvalida bitmonera adreso"
+
+#: ../../../src/rpc.cpp:1800 ../../../src/rpc.cpp:1802
+#, c-format
+msgid "To use the %s option"
+msgstr "Por uzi la %s optcion"
+
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file "
+"permissions.\n"
+msgstr ""
+"Averto: %s, vi devas meti rpcpassword=<pasvorto>\n"
+"en la agorda dosiero: %s\n"
+"Se la doriero ne ekzistas, kreu ĝin nurposedantlegeble.\n"
+
+#: ../../../src/rpc.cpp:1972
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file "
+"permissions."
+msgstr ""
+"Vi devas meti rpcpassword=<pasvorto> en la agorda dosiero:\n"
+"%s\n"
+"Se la dosiero ne ekzistas, kreu ĝin nurposedantlegeble."
+
+#: ../../../src/util.cpp:865
+msgid ""
+"Warning: Please check that your computer's date and time are correct. If "
+"your clock is wrong Bitcoin will not work properly."
+msgstr ""
+"Averto: Bonvole kontrolu ke la dato kaj la tempo de via komputilo estas "
+"ĝusta. Se viaj horloĝo malĝustas, Bitmonero ne funkcios korekte."
+
+#: ../../../src/util.cpp:898
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "&Dosiero"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "&Viaj ricevadresoj..."
+
+#: ../../../src/uibase.cpp:36
+msgid "&Options..."
+msgstr "&Opcioj..."
+
+#: ../../../src/uibase.cpp:39
+msgid "&Settings"
+msgstr "&Agordoj"
+
+#: ../../../src/uibase.cpp:43
+msgid "&About..."
+msgstr "&Pri..."
+
+#: ../../../src/uibase.cpp:46
+msgid "&Help"
+msgstr "&Helpo"
+
+#: ../../../src/uibase.cpp:56
+msgid "Address Book"
+msgstr "Adresaro"
+
+#: ../../../src/uibase.cpp:69
+msgid "Your Bitcoin Address:"
+msgstr "Via bitmonera adreso:"
+
+#: ../../../src/uibase.cpp:76
+msgid " &New... "
+msgstr " &Nova... "
+
+#: ../../../src/uibase.cpp:79 ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
+msgid " &Copy to Clipboard "
+msgstr " &Kopiu al la poŝon "
+
+#: ../../../src/uibase.cpp:93
+msgid "Balance:"
+msgstr "Bonhavo:"
+
+#: ../../../src/uibase.cpp:109
+msgid " All"
+msgstr " Ĉiom"
+
+#: ../../../src/uibase.cpp:109
+msgid " Sent"
+msgstr " Sendita"
+
+#: ../../../src/uibase.cpp:109
+msgid " Received"
+msgstr " Ricevita"
+
+#: ../../../src/uibase.cpp:109
+msgid " In Progress"
+msgstr " Progresanta"
+
+#: ../../../src/uibase.cpp:130
+msgid "All Transactions"
+msgstr "Ĉiuj transakcioj"
+
+#: ../../../src/uibase.cpp:141
+msgid "Sent/Received"
+msgstr "Sendita/Ricevita"
+
+#: ../../../src/uibase.cpp:152
+msgid "Sent"
+msgstr "Sendita"
+
+#: ../../../src/uibase.cpp:163
+msgid "Received"
+msgstr "Ricevita"
+
+#: ../../../src/uibase.cpp:302 ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542 ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783 ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
+msgid "OK"
+msgstr "Bone"
+
+#: ../../../src/uibase.cpp:345
+msgid "&Start Bitcoin on system startup"
+msgstr "&Lanĉigu Bitmoneron kiam la sistemo ekas"
+
+#: ../../../src/uibase.cpp:348
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Kaŝu al la programan pleton anstataŭ al la programan linion"
+
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Pordplusendo per &UPnP"
+
+#: ../../../src/uibase.cpp:354
+msgid "M&inimize to the tray on close"
+msgstr "K&aŝu al la programan pleton anstataŭ malfermu ĝin"
+
+#: ../../../src/uibase.cpp:360
+msgid "&Connect through socks4 proxy: "
+msgstr "&Konekti per socks4 prokuro: "
+
+#: ../../../src/uibase.cpp:371
+msgid "Proxy &IP:"
+msgstr "Prokura &IP:"
+
+#: ../../../src/uibase.cpp:379
+msgid " &Port:"
+msgstr " &Pordo:"
+
+#: ../../../src/uibase.cpp:392
+msgid ""
+"Optional transaction fee per KB that helps make sure your transactions are "
+"processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr ""
+"Volonta transakcia kosto po kilobajto, kiu helpas certigi ke viaj "
+"transakcioj estas plenumita rapide. La plej transacioj estas 1 kilobajto. "
+"Rekomendita transakcia kosto: 0.01"
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Pagu transakcian koston:"
+
+#: ../../../src/uibase.cpp:420
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../src/uibase.cpp:424
+msgid ""
+"// [don't translate] Let's not start multiple pages until the first page is "
+"filled up"
+msgstr ""
+
+#: ../../../src/uibase.cpp:446 ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727 ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895 ../../../src/uibase.cpp:984
+msgid "Cancel"
+msgstr "Malvalidigu"
+
+#: ../../../src/uibase.cpp:449
+msgid "&Apply"
+msgstr "&Apliku"
+
+#: ../../../src/uibase.cpp:508
+msgid "Bitcoin "
+msgstr "Bitmonero "
+
+#: ../../../src/uibase.cpp:514
+msgid "version"
+msgstr "versio"
+
+#: ../../../src/uibase.cpp:525
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in "
+"the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written "
+"by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"Kopirajto (c) 2009-2011 Disvolviĝuloj de Bitmonero\n"
+"\n"
+"Tio ĉi estas eksperimenta softvaro.\n"
+"\n"
+"Distribita laŭ la MIT/X11 softvara licenco. Vidu la kundonitan dosieron \n"
+"license.txt aŭ http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Tio ĉi produkto inkludas softvaron, kiu estas disvolviĝita de la OpenSSL "
+"projekto por uzo en la \n"
+"OpenSSL Toolkit (http://www.openssl.org/), kaj kriptografia softvaro verkita "
+"de \n"
+"Eric Young (eay@cryptsoft.com) kaj UPnP softvaro verkita de Thomas Bernard."
+
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Entajpu bitmoneran adreson (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:595
+msgid "Pay &To:"
+msgstr "Pagu &al:"
+
+#: ../../../src/uibase.cpp:610
+msgid "&Paste"
+msgstr "&Elpoŝigi"
+
+#: ../../../src/uibase.cpp:613
+msgid " Address &Book..."
+msgstr " &Adresaro..."
+
+#: ../../../src/uibase.cpp:620
+msgid "&Amount:"
+msgstr "&Kvanto:"
+
+#: ../../../src/uibase.cpp:630
+msgid "T&ransfer:"
+msgstr "T&ransfero:"
+
+#: ../../../src/uibase.cpp:636
+msgid " Standard"
+msgstr " Normo"
+
+#: ../../../src/uibase.cpp:663
+msgid "&Send"
+msgstr "&Sendu"
+
+#: ../../../src/uibase.cpp:711
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Konektanta..."
+
+#: ../../../src/uibase.cpp:761
+msgid ""
+"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. The highlighted address is displayed in the main window."
+msgstr ""
+"Tiuj ĉi estas viaj bitmonerajn adresojn por ricevi pagojn. Vi povus voli "
+"doni malsaman adreson al ĉiuj sendanto, por ke vi povas vidi kiu pagis vin. "
+"La markita adreso estas vidigita en la ĉefa fenestro."
+
+#: ../../../src/uibase.cpp:774 ../../../src/uibase.cpp:886
+msgid "&Edit..."
+msgstr "&Redakti..."
+
+#: ../../../src/uibase.cpp:777 ../../../src/uibase.cpp:889
+msgid " &New Address... "
+msgstr " &Nova adreso... "
+
+#: ../../../src/uibase.cpp:849
+msgid "Sending"
+msgstr "Sendanta"
+
+#: ../../../src/uibase.cpp:857
+msgid ""
+"These are your Bitcoin addresses for receiving payments. You can give a "
+"different one to each sender to keep track of who is paying you. The "
+"highlighted address will be displayed in the main window."
+msgstr ""
+"Tiuj estas viaj bitmoneraj adresoj por ricevi pagojn. Vi povas doni malsaman "
+"adreson al ĉiuj sendanto, por ke vi povas vidi kiu pagis vin. La markita "
+"adreso estas vidigita en la ĉefa fenestro."
+
+#: ../../../src/uibase.cpp:870
+msgid "Receiving"
+msgstr "Ricevanta"
+
+#: ../../../src/uibase.cpp:880
+msgid "&Delete"
+msgstr "&Viŝu"
+
+#: ../../../src/init.cpp:147
+msgid "Bitcoin version"
+msgstr "Versio de Bitmonero"
+
+#: ../../../src/init.cpp:148
+msgid "Usage:"
+msgstr "Uzado:"
+
+#: ../../../src/init.cpp:150
+msgid "Send command to -server or bitcoind\n"
+msgstr "Sendu komandon al aŭ -server aŭ bitcoind\n"
+
+#: ../../../src/init.cpp:151
+msgid "List commands\n"
+msgstr "Listigu komandojn\n"
+
+#: ../../../src/init.cpp:152
+msgid "Get help for a command\n"
+msgstr "Ricevu helpon de komando\n"
+
+#: ../../../src/init.cpp:153
+msgid "Options:\n"
+msgstr "Opcioj:\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Elektu agordan dosieron (defaŭlto: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:155
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Elektu pid dosieron (defaŭlto: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:156
+msgid "Generate coins\n"
+msgstr "Generate coins\n"
+
+#: ../../../src/init.cpp:157
+msgid "Don't generate coins\n"
+msgstr "Ne kreu monerojn\n"
+
+#: ../../../src/init.cpp:158
+msgid "Start minimized\n"
+msgstr "Lanĉiĝu kaŝe\n"
+
+#: ../../../src/init.cpp:159
+msgid "Specify data directory\n"
+msgstr "Elektu datenara dosierujon\n"
+
+#: ../../../src/init.cpp:160
+msgid "Connect through socks4 proxy\n"
+msgstr "Konektu per socks4 prokuro\n"
+
+#: ../../../src/init.cpp:161
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Permesu DNS solvon por aldoni nodon kaj konekti\n"
+
+#: ../../../src/init.cpp:162
+msgid "Add a node to connect to\n"
+msgstr "Aldonu nodon konektotan\n"
+
+#: ../../../src/init.cpp:163
+msgid "Connect only to the specified node\n"
+msgstr "Konektu nur al specifan nodon\n"
+
+#: ../../../src/init.cpp:164
+msgid "Don't accept connections from outside\n"
+msgstr "Ne akceptu eksterajn konektojn\n"
+
+#: ../../../src/init.cpp:167
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Ne provu uzi UPnP-on por la pordplusendo\n"
+
+#: ../../../src/init.cpp:169
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Provu uzi UPnP-on por la pordplusendo\n"
+
+#: ../../../src/init.cpp:172
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Kosto po kilobajto aldonota al viaj transakcioj sendataj\n"
+
+#: ../../../src/init.cpp:174
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Akceptu kaj komandliniajn kaj JSON-RPC-ajn komandojn\n"
+
+#: ../../../src/init.cpp:177
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Lanĉigu fone kiel demono kaj akceptu komandojn\n"
+
+#: ../../../src/init.cpp:179
+msgid "Use the test network\n"
+msgstr "Uzu la testreton\n"
+
+#: ../../../src/init.cpp:180
+msgid "Username for JSON-RPC connections\n"
+msgstr "Salutnomo por JSON-RPC-aj konektoj\n"
+
+#: ../../../src/init.cpp:181
+msgid "Password for JSON-RPC connections\n"
+msgstr "Pasvorto por JSON-RPC-aj konektoj\n"
+
+#: ../../../src/init.cpp:182
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Aŭskultu JSON-RPC-ajn konektojn ĉe <pordo> (defaŭlto: 8332)\n"
+
+#: ../../../src/init.cpp:183
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Permesu JSON-RPC-ajn konektojn el specifa IP-adreso\n"
+
+#: ../../../src/init.cpp:184
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Sendu komandojn al nodo rulanta ĉe <ip> (defaŭlto: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:185
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Difinu la grandecon de la ĉifroŝlosilaro kiel <n> (defaŭlto: 100)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Reskandu la blokĉenon por mankantaj transakcioj en la monujo\n"
+
+#: ../../../src/init.cpp:190
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL-aj opcioj: (Legu la Vikipedion de Bitmonero pri la agordaĵaj instruoj)\n"
+
+#: ../../../src/init.cpp:191
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Uzu OpenSSL (https) por JSON-RPC-aj konektoj\n"
+
+#: ../../../src/init.cpp:192
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Argorda doesiero de la servilo (defaŭlto: server.cert)\n"
+
+#: ../../../src/init.cpp:193
+msgid "Server private key (default: server.pem)\n"
+msgstr "Privata ĉifroŝlosilo de la servilo (defaŭlto: server.pem)\n"
+
+#: ../../../src/init.cpp:194
+msgid ""
+"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
+"@STRENGTH)\n"
+msgstr ""
+"\"Akcepteblaj ĉifroj (defaŭlto: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
+"@STRENGTH)\n"
+
+#: ../../../src/init.cpp:198
+msgid "This help message\n"
+msgstr "Ĉi tiu helpa mesaĝo\n"
+
+#: ../../../src/init.cpp:335
+#, c-format
+msgid ""
+"Cannot obtain a lock on data directory %s. Bitcoin is probably already "
+"running."
+msgstr ""
+"Ne povas ŝlosi la datenan dosierujon %s. Verŝajne alia instanco de la "
+"programo Bitmonero jam rulas."
+
+#: ../../../src/init.cpp:361
+msgid "Error loading addr.dat \n"
+msgstr "Eraro ŝarĝante la dosieron addr.dat \n"
+
+#: ../../../src/init.cpp:367
+msgid "Error loading blkindex.dat \n"
+msgstr "Eraro ŝarĝante la dosieron blkindex.dat \n"
+
+#: ../../../src/init.cpp:374
+msgid "Error loading wallet.dat \n"
+msgstr "Eraro ŝarĝante la dosieron wallet.dat \n"
+
+#: ../../../src/init.cpp:454
+msgid "Invalid -proxy address"
+msgstr "Malvalida prokuradreso (-proxy)"
+
+#: ../../../src/init.cpp:477
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Malvalida kvanto de la transakcia kosto (-paytxfee=<kvanto>)"
+
+#: ../../../src/init.cpp:481
+msgid ""
+"Warning: -paytxfee is set very high. This is the transaction fee you will "
+"pay if you send a transaction."
+msgstr ""
+"Averto: La transakcia kosto (-paytxfee) estas tre alta. Tiu ĉi estas la "
+"kosto, kiun vi devos pagi kiam vi sendos transakcion."
+
+#: ../../../src/uibase.h:147
+msgid "Transaction Details"
+msgstr "Detaloj pri transakcio"
+
+#: ../../../src/uibase.h:199
+msgid "Options"
+msgstr "Detaloj pri transakcio"
+
+#: ../../../src/uibase.h:228
+msgid "About Bitcoin"
+msgstr "Pri Bitmonero"
+
+#: ../../../src/uibase.h:337
+msgid "Your Bitcoin Addresses"
+msgstr "Viaj Bitmoneraj adresoj"
diff --git a/locale/es/LC_MESSAGES/bitcoin.mo b/locale/es/LC_MESSAGES/bitcoin.mo
index 234acbd011..e22b894c5a 100644
--- a/locale/es/LC_MESSAGES/bitcoin.mo
+++ b/locale/es/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/es/LC_MESSAGES/bitcoin.po b/locale/es/LC_MESSAGES/bitcoin.po
index 0617ab4b48..c67886e676 100644
--- a/locale/es/LC_MESSAGES/bitcoin.po
+++ b/locale/es/LC_MESSAGES/bitcoin.po
@@ -2,10 +2,11 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-26 22:02-0000\n"
-"PO-Revision-Date: 2011-03-16 20:55+0100\n"
-"Last-Translator: Santiago M. Mola <coldwind@coldwind.org>\n"
+"POT-Creation-Date: 2011-05-24 20:21-0500\n"
+"PO-Revision-Date: 2011-05-24 20:23-0500\n"
+"Last-Translator: Ariel Patiño <ariel@ficticio.com>\n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -13,719 +14,672 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
-#: ../../../init.cpp:174
-msgid "Cannot write autostart/bitcoin.desktop file"
-msgstr "No se puede escribir el fichero autostart/bitcoin.desktop"
-
-#: ../../../init.cpp:388
-msgid "Usage:"
-msgstr "Uso:"
-
-#: ../../../init.cpp:390
-msgid "Send command to bitcoin running with -server or -daemon\n"
-msgstr "Enviar comando a bitcoin corriendo con -server o -daemon\n"
-
-#: ../../../init.cpp:391
-msgid "Get help for a command\n"
-msgstr "Recibir ayuda para un comando\n"
-
-#: ../../../init.cpp:392
-msgid "List commands\n"
-msgstr "Lista de comandos\n"
-
-#: ../../../init.cpp:393
-msgid "Options:\n"
-msgstr "Opciones:\n"
-
-#: ../../../init.cpp:394
-msgid "Generate coins\n"
-msgstr "Generar monedas\n"
-
-#: ../../../init.cpp:395
-msgid "Don't generate coins\n"
-msgstr "No generar monedas\n"
-
-#: ../../../init.cpp:396
-msgid "Start minimized\n"
-msgstr "Arrancar minimizado\n"
-
-#: ../../../init.cpp:397
-msgid "Specify data directory\n"
-msgstr "Especificar directorio para los datos\n"
-
-#: ../../../init.cpp:398
-msgid "Connect through socks4 proxy\n"
-msgstr "Conectar mediante proxy socks4\n"
-
-#: ../../../init.cpp:399
-msgid "Add a node to connect to\n"
-msgstr "Agregar un nodo para conectarse\n"
-
-#: ../../../init.cpp:400
-msgid "Connect only to the specified node\n"
-msgstr "Conectar solo al nodo especificado\n"
-
-#: ../../../init.cpp:401
-msgid "Accept command line and JSON-RPC commands\n"
-msgstr "Aceptar comandos por linea de comandos y JSON-RPC\n"
-
-#: ../../../init.cpp:402
-msgid "Run in the background as a daemon and accept commands\n"
-msgstr "Correr en el fondo como demonio y aceptar comandos\n"
-
-#: ../../../init.cpp:403
-msgid "This help message\n"
-msgstr "Este mensaje de ayuda\n"
-
-#: ../../../init.cpp:503
-msgid "Error loading addr.dat \n"
-msgstr "Error cargando addr.dat \n"
-
-#: ../../../init.cpp:509
-msgid "Error loading blkindex.dat \n"
-msgstr "Error cargando blkindex.dat \n"
-
-#: ../../../init.cpp:516
-msgid "Error loading wallet.dat \n"
-msgstr "Error cargando wallet.dat \n"
-
-#: ../../../init.cpp:584
-msgid "Invalid -proxy address"
-msgstr "Direccion -proxy invalida"
-
-#: ../../../init.cpp:677
-msgid "Program has crashed and will terminate. "
-msgstr "El programa ha detectado un error y va a cerrarse. "
-
-#: ../../../main.cpp:1480
-#: ../../../main.cpp:1482
-msgid "Warning: Disk space is low "
-msgstr "Cuidado: Poco espacio en disco "
-
-#: ../../../main.cpp:3094
+#: ../../../src/net.cpp:1503
#, c-format
-msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
-msgstr "Error: Esta es una gran transaccion que requiere una comision de %s "
-
-#: ../../../main.cpp:3096
-msgid "Error: Transaction creation failed "
-msgstr "Error: La creacion de la transaccion fallo "
-
-#: ../../../main.cpp:3101
-#: ../../../ui.cpp:1776
-#: ../../../ui.cpp:1778
-#: ../../../ui.cpp:1919
-#: ../../../ui.cpp:2068
-msgid "Sending..."
-msgstr "Enviando..."
-
-#: ../../../main.cpp:3105
-msgid "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."
-msgstr "Error: La transaccion fue rechazada. Esto puede haber ocurrido si alguna de las monedas ya fue gastada, o si ha usado un copia de wallet.dat y las monedas fueron gastadas en la copia pero no han sido marcadas como gastadas aqui."
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "No es posible escuchar en el puerto %d en este computador. Probablemente el cliente Bitcoin ya se está ejecutando."
-#: ../../../main.cpp:3117
-msgid "Invalid amount"
-msgstr "Cantidad erronea"
-
-#: ../../../main.cpp:3119
-#: ../../../ui.cpp:1986
-#: ../../../ui.cpp:2053
-msgid "Insufficient funds"
-msgstr "Fondos insuficientes"
-
-#: ../../../main.cpp:3124
-msgid "Invalid bitcoin address"
-msgstr "Direccion Bitcoin invalida"
-
-#: ../../../ui.cpp:189
+#: ../../../src/ui.cpp:204
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
-msgstr "Esta transaccion supera el limite. Puede seguir enviandola con una comision de %s, que va a los nodos que procesan su transaccion y ayuda a mantener la red. ¿Quiere pagar la comision?"
+msgstr "Esta transacción supera el límite. Puede seguir enviandola con una comisión de %s, que va a los nodos que procesan su transacción y ayuda a mantener la red. ¿Quiere pagar la comisión?"
-#: ../../../ui.cpp:286
+#: ../../../src/ui.cpp:303
msgid "Status"
-msgstr "Status"
+msgstr "Estado"
-#: ../../../ui.cpp:287
+#: ../../../src/ui.cpp:304
msgid "Date"
msgstr "Fecha"
-#: ../../../ui.cpp:288
+#: ../../../src/ui.cpp:305
msgid "Description"
-msgstr "Descripcion"
+msgstr "Descripción"
-#: ../../../ui.cpp:289
+#: ../../../src/ui.cpp:306
msgid "Debit"
-msgstr "Debito"
+msgstr "Débito"
-#: ../../../ui.cpp:290
+#: ../../../src/ui.cpp:307
msgid "Credit"
-msgstr "Credito"
+msgstr "Crédito"
-#: ../../../ui.cpp:489
+#: ../../../src/ui.cpp:513
#, c-format
msgid "Open for %d blocks"
msgstr "Abrir para %d bloques"
-#: ../../../ui.cpp:491
+#: ../../../src/ui.cpp:515
#, c-format
msgid "Open until %s"
msgstr "Abrir hasta %s"
-#: ../../../ui.cpp:497
+#: ../../../src/ui.cpp:521
#, c-format
msgid "%d/offline?"
msgstr "%d/desconectado?"
-#: ../../../ui.cpp:499
+#: ../../../src/ui.cpp:523
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/no confirmado"
-#: ../../../ui.cpp:501
+#: ../../../src/ui.cpp:525
#, c-format
msgid "%d confirmations"
msgstr "%d confirmaciones"
-#: ../../../ui.cpp:584
+#: ../../../src/ui.cpp:610
msgid "Generated"
msgstr "Generado"
-#: ../../../ui.cpp:592
+#: ../../../src/ui.cpp:618
#, c-format
msgid "Generated (%s matures in %d more blocks)"
-msgstr "Generado (%s hechos en %d bloques)"
+msgstr "Generado (%s madura en %d bloques)"
-#: ../../../ui.cpp:596
+#: ../../../src/ui.cpp:622
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
-msgstr "Generado - Cuidado: Este bloque no se recibio de otros nodos y probablemente no sea aceptado!"
+msgstr "Generado - Cuidado: Este bloque no se recibió de otros nodos y probablemente no sea aceptado!"
-#: ../../../ui.cpp:600
+#: ../../../src/ui.cpp:626
msgid "Generated (not accepted)"
msgstr "Generado (no aceptado)"
-#: ../../../ui.cpp:610
+#: ../../../src/ui.cpp:636
msgid "From: "
msgstr "De: "
-#: ../../../ui.cpp:634
+#: ../../../src/ui.cpp:660
msgid "Received with: "
msgstr "Recibido con: "
-#: ../../../ui.cpp:676
+#: ../../../src/ui.cpp:706
msgid "Payment to yourself"
msgstr "Pago para usted mismo"
-#: ../../../ui.cpp:713
+#: ../../../src/ui.cpp:740
msgid "To: "
msgstr "Para: "
-#: ../../../ui.cpp:1009
+#: ../../../src/ui.cpp:1055
msgid " Generating"
msgstr " Generando"
-#: ../../../ui.cpp:1011
+#: ../../../src/ui.cpp:1057
msgid "(not connected)"
msgstr "(no conectado)"
-#: ../../../ui.cpp:1014
+#: ../../../src/ui.cpp:1060
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d conexiones %d bloques %d transacciones"
-#: ../../../ui.cpp:1128
-#: ../../../ui.cpp:2368
+#: ../../../src/ui.cpp:1165
+#: ../../../src/ui.cpp:2529
msgid "New Receiving Address"
-msgstr "Nueva direccion de recepcion"
+msgstr "Nueva dirección de recepción"
-#: ../../../ui.cpp:1129
-#: ../../../ui.cpp:2369
+#: ../../../src/ui.cpp:1166
+#: ../../../src/ui.cpp:2530
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
-"Es una buena idea usar una nueva direccion para cada pago que usted recibe.\n"
+"Debes usar una nueva dirección para cada pago que usted recibe.\n"
"\n"
"Etiqueta"
-#: ../../../ui.cpp:1198
+#: ../../../src/ui.cpp:1235
msgid "<b>Status:</b> "
-msgstr "<b>Status:</b> "
+msgstr "<b>Estado:</b> "
-#: ../../../ui.cpp:1203
+#: ../../../src/ui.cpp:1240
msgid ", has not been successfully broadcast yet"
-msgstr ", no ha sido emitido satisfactoriamente todavia"
+msgstr ", no ha sido emitido satisfactoriamente todavía"
-#: ../../../ui.cpp:1205
+#: ../../../src/ui.cpp:1242
#, c-format
msgid ", broadcast through %d node"
msgstr ", emitido mediante %d nodo"
-#: ../../../ui.cpp:1207
+#: ../../../src/ui.cpp:1244
#, c-format
msgid ", broadcast through %d nodes"
msgstr ", emitido mediante %d nodos"
-#: ../../../ui.cpp:1211
+#: ../../../src/ui.cpp:1248
msgid "<b>Date:</b> "
msgstr "<b>Fecha:</b> "
-#: ../../../ui.cpp:1219
+#: ../../../src/ui.cpp:1256
msgid "<b>Source:</b> Generated<br>"
msgstr "<b>Fuente:</b> Generado<br>"
-#: ../../../ui.cpp:1225
-#: ../../../ui.cpp:1243
+#: ../../../src/ui.cpp:1262
+#: ../../../src/ui.cpp:1280
msgid "<b>From:</b> "
msgstr "<b>De:</b> "
-#: ../../../ui.cpp:1243
+#: ../../../src/ui.cpp:1280
msgid "unknown"
msgstr "desconocido"
-#: ../../../ui.cpp:1244
-#: ../../../ui.cpp:1268
-#: ../../../ui.cpp:1327
+#: ../../../src/ui.cpp:1281
+#: ../../../src/ui.cpp:1305
+#: ../../../src/ui.cpp:1364
msgid "<b>To:</b> "
msgstr "<b>Para:</b> "
-#: ../../../ui.cpp:1247
+#: ../../../src/ui.cpp:1284
msgid " (yours, label: "
msgstr "(suya, etiqueta: "
-#: ../../../ui.cpp:1249
+#: ../../../src/ui.cpp:1286
msgid " (yours)"
msgstr "(suya)"
-#: ../../../ui.cpp:1286
-#: ../../../ui.cpp:1298
-#: ../../../ui.cpp:1361
+#: ../../../src/ui.cpp:1323
+#: ../../../src/ui.cpp:1335
+#: ../../../src/ui.cpp:1381
+#: ../../../src/ui.cpp:1398
msgid "<b>Credit:</b> "
-msgstr "<b>Credito:</b> "
+msgstr "<b>Crédito:</b> "
-#: ../../../ui.cpp:1288
+#: ../../../src/ui.cpp:1325
#, c-format
msgid "(%s matures in %d more blocks)"
-msgstr "(%s hechos en %d bloques)"
+msgstr "(%s madura en %d bloques)"
-#: ../../../ui.cpp:1290
+#: ../../../src/ui.cpp:1327
msgid "(not accepted)"
msgstr "(no aceptada)"
-#: ../../../ui.cpp:1335
-#: ../../../ui.cpp:1358
+#: ../../../src/ui.cpp:1372
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:1395
msgid "<b>Debit:</b> "
-msgstr "<b>Debito:</b> "
+msgstr "<b>Débito:</b> "
-#: ../../../ui.cpp:1349
+#: ../../../src/ui.cpp:1386
msgid "<b>Transaction fee:</b> "
-msgstr "<b>Comision transaccion:</b> "
+msgstr "<b>Comisión transacción:</b> "
-#: ../../../ui.cpp:1365
+#: ../../../src/ui.cpp:1402
msgid "<b>Net amount:</b> "
msgstr "<b>Cantidad de la red:</b> "
-#: ../../../ui.cpp:1372
+#: ../../../src/ui.cpp:1409
msgid "Message:"
msgstr "Mensaje:"
-#: ../../../ui.cpp:1375
+#: ../../../src/ui.cpp:1411
+msgid "Comment:"
+msgstr "Comentario:"
+
+#: ../../../src/ui.cpp:1414
msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
-msgstr "Las monedas generadas deben esperar 120 bloques antes de ser gastadas. Cuando usted genero este bloque, fue emitido a la red para ser agregado a la cadena de bloques. Si falla al incluirse en la cadena, cambiara a \"no aceptado\" y no se podra gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque apenas a unos segundos del suyo."
+msgstr "Las monedas generadas deben esperar 120 bloques antes de ser gastadas. Cuando usted generó este bloque, fue emitido a la red para ser agregado a la cadena de bloques. Si falla al incluirse en la cadena, cambiará a \"no aceptado\" y no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque apenas a unos segundos del suyo."
+
+#: ../../../src/ui.cpp:1594
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "No se puede escribir el fichero autostart/bitcoin.desktop"
-#: ../../../ui.cpp:1442
+#: ../../../src/ui.cpp:1630
msgid "Main"
msgstr "Principal"
-#: ../../../ui.cpp:1447
+#: ../../../src/ui.cpp:1638
msgid "&Start Bitcoin on window system startup"
-msgstr "&Arrancar Bitcoin al arrancar el sistema de ventanas"
+msgstr "&Arrancar Bitcoin al iniciar el sistema"
-#: ../../../ui.cpp:1454
+#: ../../../src/ui.cpp:1645
msgid "&Minimize on close"
msgstr "&Minimizar al cerrar"
-#: ../../../ui.cpp:1610
+#: ../../../src/ui.cpp:1787
#, c-format
-msgid "version %s%s BETA"
-msgstr "version %s%s BETA"
-
-#: ../../../ui.cpp:1696
-msgid "Will appear as \"From: Unknown\""
-msgstr "Aparecera como \"De: Desconocido\""
+msgid "version %s"
+msgstr "versión %s"
-#: ../../../ui.cpp:1696
-msgid "n/a"
-msgstr "Desconocido"
-
-#: ../../../ui.cpp:1696
-msgid "Unknown"
-msgstr "Desconocido"
-
-#: ../../../ui.cpp:1697
-msgid "Can't include a message when sending to a Bitcoin address"
-msgstr "No se ha podido incluir un mensaje mientras se enviaba la direccion Bitcoin"
-
-#: ../../../ui.cpp:1750
+#: ../../../src/ui.cpp:1899
msgid "Error in amount "
msgstr "Error en la cantidad "
-#: ../../../ui.cpp:1750
-#: ../../../ui.cpp:1755
-#: ../../../ui.cpp:1760
-#: ../../../ui.cpp:1786
-#: ../../../uibase.cpp:59
+#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:1944
+#: ../../../src/uibase.cpp:55
msgid "Send Coins"
msgstr "Enviar monedas"
-#: ../../../ui.cpp:1755
+#: ../../../src/ui.cpp:1904
msgid "Amount exceeds your balance "
-msgstr "La cantidad excede de su balance "
+msgstr "La cantidad excede su balance "
-#: ../../../ui.cpp:1760
+#: ../../../src/ui.cpp:1909
msgid "Total exceeds your balance when the "
msgstr "El total excede su balance cuando el "
-#: ../../../ui.cpp:1760
+#: ../../../src/ui.cpp:1909
msgid " transaction fee is included "
-msgstr " la comision de la transaccion esta incluida "
+msgstr " la comisión de la transaccion está incluida "
-#: ../../../ui.cpp:1776
+#: ../../../src/ui.cpp:1927
msgid "Payment sent "
msgstr "Pago enviado "
-#: ../../../ui.cpp:1786
+#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:1932
+#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2229
+#: ../../../src/main.cpp:3997
+msgid "Sending..."
+msgstr "Enviando..."
+
+#: ../../../src/ui.cpp:1944
msgid "Invalid address "
-msgstr "Direccion invalida "
+msgstr "Dirección inválida "
-#: ../../../ui.cpp:1840
+#: ../../../src/ui.cpp:1997
#, c-format
msgid "Sending %s to %s"
msgstr "Enviando %s a %s"
-#: ../../../ui.cpp:1913
-#: ../../../ui.cpp:1946
+#: ../../../src/ui.cpp:2070
+#: ../../../src/ui.cpp:2103
msgid "CANCELLED"
msgstr "CANCELADO"
-#: ../../../ui.cpp:1917
+#: ../../../src/ui.cpp:2074
msgid "Cancelled"
msgstr "Cancelado"
-#: ../../../ui.cpp:1919
+#: ../../../src/ui.cpp:2076
msgid "Transfer cancelled "
msgstr "Transferencia cancelada "
-#: ../../../ui.cpp:1972
+#: ../../../src/ui.cpp:2129
msgid "Error: "
msgstr "Error: "
-#: ../../../ui.cpp:1991
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2214
+#: ../../../src/main.cpp:4016
+msgid "Insufficient funds"
+msgstr "Fondos insuficientes"
+
+#: ../../../src/ui.cpp:2148
msgid "Connecting..."
msgstr "Conectando..."
-#: ../../../ui.cpp:1996
+#: ../../../src/ui.cpp:2153
msgid "Unable to connect"
msgstr "No es posible conectar"
-#: ../../../ui.cpp:2001
+#: ../../../src/ui.cpp:2158
msgid "Requesting public key..."
-msgstr "Pidiendo clave publica..."
+msgstr "Pidiendo clave pública..."
-#: ../../../ui.cpp:2013
+#: ../../../src/ui.cpp:2170
msgid "Received public key..."
-msgstr "Clave publica recibida..."
+msgstr "Clave pública recibida..."
-#: ../../../ui.cpp:2025
+#: ../../../src/ui.cpp:2184
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "El destinatario no está aceptando transacciones enviadas por direcciones IP"
+
+#: ../../../src/ui.cpp:2186
msgid "Transfer was not accepted"
msgstr "La transferencia no fue aceptada"
-#: ../../../ui.cpp:2034
+#: ../../../src/ui.cpp:2195
msgid "Invalid response received"
-msgstr "Respuesta invalida recibida"
+msgstr "Respuesta inválida recibida"
-#: ../../../ui.cpp:2049
+#: ../../../src/ui.cpp:2210
msgid "Creating transaction..."
-msgstr "Creando transaccion..."
+msgstr "Creando transacción..."
-#: ../../../ui.cpp:2061
+#: ../../../src/ui.cpp:2222
#, c-format
-msgid "This is an oversized transaction that requires a transaction fee of %s"
-msgstr "Esta es una gran transaccion que requiere una comision de %s"
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Esta transacción requiere de una comisión de al menos %s por su cantidad, complejidad o uso de fondos recibidos recientemente"
-#: ../../../ui.cpp:2063
+#: ../../../src/ui.cpp:2224
msgid "Transaction creation failed"
-msgstr "Fallo al crear la transaccion."
+msgstr "Fallo al crear la transacción."
-#: ../../../ui.cpp:2070
+#: ../../../src/ui.cpp:2231
msgid "Transaction aborted"
-msgstr "Transaccion abortada"
+msgstr "Transacción abortada"
-#: ../../../ui.cpp:2078
+#: ../../../src/ui.cpp:2239
msgid "Lost connection, transaction cancelled"
-msgstr "Conexion perdida, transacción cancelada"
+msgstr "Conexión perdida, transacción cancelada"
-#: ../../../ui.cpp:2094
+#: ../../../src/ui.cpp:2255
msgid "Sending payment..."
msgstr "Enviando pago..."
-#: ../../../ui.cpp:2100
+#: ../../../src/ui.cpp:2261
msgid "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."
-msgstr "La transaccion fue rechazada. Esto puede haber ocurrido si alguna de las monedas fue gastada, o si ha usado una copia de wallet.dat y las monedas fueron gastadas en la copia pero no fueron marcadas como gastadas aqui."
+msgstr "La transacción fue rechazada. Esto puede haber ocurrido si alguna de las monedas fue gastada, o si ha usado una copia de wallet.dat y las monedas fueron gastadas en la copia pero no fueron marcadas como gastadas aqui."
-#: ../../../ui.cpp:2109
+#: ../../../src/ui.cpp:2270
msgid "Waiting for confirmation..."
-msgstr "Esperando confirmacion..."
+msgstr "Esperando confirmación..."
-#: ../../../ui.cpp:2127
+#: ../../../src/ui.cpp:2288
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
"but the comment information will be blank."
msgstr ""
-"El pago fue enviado, pero el receptor no pudo verificarla.\n"
-"La transaccion es grabada y dara credito al receptor,\n"
-"pero la informacion quedara en blanco."
+"El pago fue enviado, pero el receptor no pudo verificarlo.\n"
+"La transacción se grabó y dará el crédito al receptor,\n"
+"pero la información en los comentarios quedará en blanco."
-#: ../../../ui.cpp:2136
+#: ../../../src/ui.cpp:2297
msgid "Payment was sent, but an invalid response was received"
-msgstr "El pago fue enviado, pero se recibio una respuesta invalida"
+msgstr "El pago fue enviado, pero se recibió una respuesta inválida"
-#: ../../../ui.cpp:2142
+#: ../../../src/ui.cpp:2303
msgid "Payment completed"
msgstr "Pago completado"
-#: ../../../ui.cpp:2173
-#: ../../../ui.cpp:2319
-#: ../../../ui.cpp:2356
+#: ../../../src/ui.cpp:2334
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
msgid "Name"
msgstr "Nombre"
-#: ../../../ui.cpp:2174
-#: ../../../ui.cpp:2319
-#: ../../../ui.cpp:2356
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
msgid "Address"
-msgstr "Direccion"
+msgstr "Dirección"
-#: ../../../ui.cpp:2176
-#: ../../../ui.cpp:2331
+#: ../../../src/ui.cpp:2337
+#: ../../../src/ui.cpp:2492
msgid "Label"
msgstr "Etiqueta"
-#: ../../../ui.cpp:2177
-#: ../../../uibase.cpp:902
+#: ../../../src/ui.cpp:2338
+#: ../../../src/uibase.cpp:837
msgid "Bitcoin Address"
-msgstr "Direccion Bitcoin"
+msgstr "Dirección Bitcoin"
-#: ../../../ui.cpp:2301
+#: ../../../src/ui.cpp:2462
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Esta es una de sus direcciones para recibir pagos y no puede incluirse en la libreta de direcciones. "
-#: ../../../ui.cpp:2319
-#: ../../../ui.cpp:2325
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2486
msgid "Edit Address"
-msgstr "Editar direccion"
+msgstr "Editar dirección"
-#: ../../../ui.cpp:2331
+#: ../../../src/ui.cpp:2492
msgid "Edit Address Label"
-msgstr "Editar etiqueta direccion"
+msgstr "Editar etiqueta dirección"
-#: ../../../ui.cpp:2356
-#: ../../../ui.cpp:2362
+#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2523
msgid "Add Address"
-msgstr "Agregar direccion"
+msgstr "Agregar dirección"
-#: ../../../ui.cpp:2438
+#: ../../../src/ui.cpp:2600
msgid "Bitcoin"
msgstr "Bitcoin"
-#: ../../../ui.cpp:2440
+#: ../../../src/ui.cpp:2602
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Generando"
-#: ../../../ui.cpp:2442
+#: ../../../src/ui.cpp:2604
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (no conectado)"
-#: ../../../ui.cpp:2519
+#: ../../../src/ui.cpp:2683
msgid "&Open Bitcoin"
msgstr "&Abrir Bitcoin"
-#: ../../../ui.cpp:2520
+#: ../../../src/ui.cpp:2684
+msgid "&Send Bitcoins"
+msgstr "&Enviar Bitcoin"
+
+#: ../../../src/ui.cpp:2685
msgid "O&ptions..."
msgstr "O&pciones"
-#: ../../../ui.cpp:2521
-#: ../../../uibase.cpp:32
-msgid "&Generate Coins"
-msgstr "&Generar monedas"
-
-#: ../../../ui.cpp:2524
-#: ../../../uibase.cpp:25
+#: ../../../src/ui.cpp:2688
+#: ../../../src/uibase.cpp:25
msgid "E&xit"
msgstr "S&alir"
-#: ../../../uibase.cpp:28
+#: ../../../src/ui.cpp:2904
+msgid "Program has crashed and will terminate. "
+msgstr "El programa ha detectado un error y va a cerrarse. "
+
+#: ../../../src/main.cpp:1866
+msgid "Warning: Disk space is low "
+msgstr "Cuidado: Poco espacio en disco "
+
+#: ../../../src/main.cpp:3990
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Error: Esta transacción requiere de una comisión de al menos %s por su cantidad, complejidad o uso de fondos recibidos recientemente "
+
+#: ../../../src/main.cpp:3992
+msgid "Error: Transaction creation failed "
+msgstr "Error: La creación de la transacción falló "
+
+#: ../../../src/main.cpp:4001
+msgid "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."
+msgstr "Error: La transacción fue rechazada. Esto puede haber ocurrido si alguna de las monedas ya fue gastada, o si ha usado un copia de wallet.dat y las monedas fueron gastadas en la copia pero no han sido marcadas como gastadas aqui."
+
+#: ../../../src/main.cpp:4014
+msgid "Invalid amount"
+msgstr "Cantidad erronea"
+
+#: ../../../src/main.cpp:4021
+msgid "Invalid bitcoin address"
+msgstr "Dirección Bitcoin inválida"
+
+#: ../../../src/rpc.cpp:1802
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid "To use the %s option"
+msgstr "Para usar la opción %s"
+
+#: ../../../src/rpc.cpp:1806
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Precaución: %s, debes especificar rpcpassword=<password>\n"
+"en el archivo de configuración: %s\n"
+"Si el archivo no existe, debes crearlo con permisos de lectura al autor solamente.\n"
+
+#: ../../../src/rpc.cpp:1974
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Debes especificar rpcpassword=<password> en el archivo de configuración:\n"
+"%s\n"
+"Si el archivo no existe, debes crearlo con permisos de lectura al autor solamente."
+
+#: ../../../src/util.cpp:866
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Precaución: Por favor revisa que la fecha y hora de tu computador son correctas. Si tu reloj está mal, Bitcoin no funcionará correctamente."
+
+#: ../../../src/util.cpp:899
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
msgid "&File"
msgstr "&Archivo"
-#: ../../../uibase.cpp:36
+#: ../../../src/uibase.cpp:32
msgid "&Your Receiving Addresses..."
-msgstr "&Tus direcciones de recepcion..."
+msgstr "&Tus direcciones de recepción..."
-#: ../../../uibase.cpp:40
+#: ../../../src/uibase.cpp:36
msgid "&Options..."
msgstr "&Opciones..."
-#: ../../../uibase.cpp:43
+#: ../../../src/uibase.cpp:39
msgid "&Settings"
-msgstr "&Configuracion"
+msgstr "&Configuración"
-#: ../../../uibase.cpp:47
+#: ../../../src/uibase.cpp:43
msgid "&About..."
msgstr "&Acerca de..."
-#: ../../../uibase.cpp:50
+#: ../../../src/uibase.cpp:46
msgid "&Help"
msgstr "&Ayuda"
-#: ../../../uibase.cpp:60
+#: ../../../src/uibase.cpp:56
msgid "Address Book"
msgstr "Libreta de direcciones"
-#: ../../../uibase.cpp:75
+#: ../../../src/uibase.cpp:69
msgid "Your Bitcoin Address:"
-msgstr "Su direccion Bitcoin:"
+msgstr "Su dirección Bitcoin:"
-#: ../../../uibase.cpp:82
+#: ../../../src/uibase.cpp:76
msgid " &New... "
msgstr " &Nuevo... "
-#: ../../../uibase.cpp:85
-#: ../../../uibase.cpp:845
-#: ../../../uibase.cpp:948
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
msgid " &Copy to Clipboard "
msgstr " &Copiar al portapapeles "
-#: ../../../uibase.cpp:99
+#: ../../../src/uibase.cpp:93
msgid "Balance:"
msgstr "Balance:"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " All"
msgstr " Todo"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " Sent"
msgstr " Enviado"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " Received"
msgstr " Recibido"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " In Progress"
msgstr " En progreso"
-#: ../../../uibase.cpp:136
+#: ../../../src/uibase.cpp:130
msgid "All Transactions"
msgstr "Todas las transacciones"
-#: ../../../uibase.cpp:147
+#: ../../../src/uibase.cpp:141
msgid "Sent/Received"
msgstr "Enviado/Recibido"
-#: ../../../uibase.cpp:158
+#: ../../../src/uibase.cpp:152
msgid "Sent"
msgstr "Enviado"
-#: ../../../uibase.cpp:169
+#: ../../../src/uibase.cpp:163
msgid "Received"
msgstr "Recibido"
-#: ../../../uibase.cpp:312
-#: ../../../uibase.cpp:473
-#: ../../../uibase.cpp:574
-#: ../../../uibase.cpp:787
-#: ../../../uibase.cpp:848
-#: ../../../uibase.cpp:957
-#: ../../../uibase.cpp:1046
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
msgid "OK"
msgstr "OK"
-#: ../../../uibase.cpp:355
-msgid "Optional transaction fee you give to the nodes that process your transactions."
-msgstr "Comision opcional que se da a los nodos que procesan sus transacciones"
-
-#: ../../../uibase.cpp:364
-msgid "Transaction fee:"
-msgstr "Comision de la transaccion:"
-
-#: ../../../uibase.cpp:380
-msgid "&Limit coin generation to"
-msgstr "&Limitar la generacion de monedas a"
-
-#: ../../../uibase.cpp:387
-msgid "processors"
-msgstr "procesadores"
-
-#: ../../../uibase.cpp:393
+#: ../../../src/uibase.cpp:345
msgid "&Start Bitcoin on system startup"
-msgstr "&Arrancar Bitcoin al arrancar el sistema"
+msgstr "&Arrancar Bitcoin al iniciar el sistema"
-#: ../../../uibase.cpp:397
+#: ../../../src/uibase.cpp:348
msgid "&Minimize to the tray instead of the taskbar"
msgstr "&Minimizar a la bandeja en vez de a la barra de tareas"
-#: ../../../uibase.cpp:401
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Mapear el puerto usando &UPnP"
+
+#: ../../../src/uibase.cpp:354
msgid "M&inimize to the tray on close"
msgstr "M&inimizar a la bandeja al cerrar"
-#: ../../../uibase.cpp:408
+#: ../../../src/uibase.cpp:360
msgid "&Connect through socks4 proxy: "
msgstr "&Conectar usando un proxy socks4: "
-#: ../../../uibase.cpp:420
+#: ../../../src/uibase.cpp:371
msgid "Proxy &IP:"
msgstr "Proxy &IP:"
-#: ../../../uibase.cpp:428
+#: ../../../src/uibase.cpp:379
msgid " &Port:"
msgstr " &Puerto:"
-#: ../../../uibase.cpp:450
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Comisión opcional a las transacciones por KB que ayuda a asegurar que tus transacciones son procesadas rápidamente. La mayoría de las transacciones son de 1KB. Se recomienda una comisión de 0.01."
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Comisión de la transacción:"
+
+#: ../../../src/uibase.cpp:420
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
-#: ../../../uibase.cpp:454
+#: ../../../src/uibase.cpp:424
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
-#: ../../../uibase.cpp:476
-#: ../../../uibase.cpp:729
-#: ../../../uibase.cpp:792
-#: ../../../uibase.cpp:851
-#: ../../../uibase.cpp:960
-#: ../../../uibase.cpp:1049
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
msgid "Cancel"
msgstr "Cancelar"
-#: ../../../uibase.cpp:479
+#: ../../../src/uibase.cpp:449
msgid "&Apply"
msgstr "&Aplicar"
-#: ../../../uibase.cpp:540
+#: ../../../src/uibase.cpp:508
msgid "Bitcoin "
msgstr "Bitcoin "
-#: ../../../uibase.cpp:546
+#: ../../../src/uibase.cpp:514
msgid "version"
-msgstr "version"
+msgstr "versión"
-#: ../../../uibase.cpp:557
+#: ../../../src/uibase.cpp:525
msgid ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -744,50 +698,42 @@ msgstr ""
"license.txt o http://www.opensource.org/licenses/mit-license.php.\n"
"\n"
"Este producto incluye software desarrollado por OpenSSL Project para su uso en el\n"
-"OpenSSL Toolkit (http://www.openssl.org/) y software criptografico escrito por \n"
+"OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por \n"
"Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard."
-#: ../../../uibase.cpp:613
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
-msgstr "Ponga una direccion Bitcoin (ejemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) o una direccion IP (ejemplo: 123.45.6.7)"
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Ponga una dirección Bitcoin (ejemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-#: ../../../uibase.cpp:627
+#: ../../../src/uibase.cpp:595
msgid "Pay &To:"
msgstr "Pagar &A:"
-#: ../../../uibase.cpp:642
+#: ../../../src/uibase.cpp:610
msgid "&Paste"
msgstr "&Pegar"
-#: ../../../uibase.cpp:645
+#: ../../../src/uibase.cpp:613
msgid " Address &Book..."
msgstr " Libreta &Direcciones..."
-#: ../../../uibase.cpp:652
+#: ../../../src/uibase.cpp:620
msgid "&Amount:"
msgstr "&Cantidad:"
-#: ../../../uibase.cpp:662
+#: ../../../src/uibase.cpp:630
msgid "T&ransfer:"
msgstr "T&ransferir:"
-#: ../../../uibase.cpp:668
+#: ../../../src/uibase.cpp:636
msgid " Standard"
-msgstr " Estandar"
-
-#: ../../../uibase.cpp:690
-msgid "&From:"
-msgstr "&De:"
-
-#: ../../../uibase.cpp:707
-msgid "&Message:"
-msgstr "&Mensaje:"
+msgstr " Estándar"
-#: ../../../uibase.cpp:724
+#: ../../../src/uibase.cpp:663
msgid "&Send"
msgstr "&Enviar"
-#: ../../../uibase.cpp:776
+#: ../../../src/uibase.cpp:711
msgid ""
"\n"
"\n"
@@ -797,52 +743,225 @@ msgstr ""
"\n"
"Conenctando..."
-#: ../../../uibase.cpp:826
+#: ../../../src/uibase.cpp:761
msgid "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. The highlighted address is displayed in the main window."
-msgstr "Estas son sus direcciones Bitcoin para recibir pagos. Puede darle una diferente a cada emisor para saber quien le esta pagando. La direccion resaltada se muestra en la ventana principal."
+msgstr "Estas son tus direcciones Bitcoin para recibir pagos. Puedes darle una diferente a cada emisor para saber quien te está pagando. La dirección resaltada se muestra en la ventana principal."
-#: ../../../uibase.cpp:839
-#: ../../../uibase.cpp:951
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
msgid "&Edit..."
msgstr "&Editar..."
-#: ../../../uibase.cpp:842
-#: ../../../uibase.cpp:954
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
msgid " &New Address... "
-msgstr " &Nueva direccion... "
+msgstr " &Nueva dirección... "
-#: ../../../uibase.cpp:914
+#: ../../../src/uibase.cpp:849
msgid "Sending"
msgstr "Enviando"
-#: ../../../uibase.cpp:922
+#: ../../../src/uibase.cpp:857
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
-msgstr "Estas son sus direcciones Bitcoin para recibir pagos. Puede darle una diferente a cada emisor para saber quien le esta pagando. La direccion resaltada se muestra en la ventana principal."
+msgstr "Estas son tus direcciones Bitcoin para recibir pagos. Puedes darle una diferente a cada emisor para saber quien te está pagando. La dirección resaltada se muestra en la ventana principal."
-#: ../../../uibase.cpp:935
+#: ../../../src/uibase.cpp:870
msgid "Receiving"
msgstr "Recibiendo"
-#: ../../../uibase.cpp:945
+#: ../../../src/uibase.cpp:880
msgid "&Delete"
msgstr "&Borrar"
-#: ../../../uibase.h:149
+#: ../../../src/init.cpp:142
+msgid "Bitcoin version"
+msgstr "versión Bitcoin"
+
+#: ../../../src/init.cpp:143
+msgid "Usage:"
+msgstr "Uso:"
+
+#: ../../../src/init.cpp:145
+msgid "Send command to -server or bitcoind\n"
+msgstr "Enviar comando a bitcoin corriendo con -server o a bitcoind\n"
+
+#: ../../../src/init.cpp:146
+msgid "List commands\n"
+msgstr "Lista de comandos\n"
+
+#: ../../../src/init.cpp:147
+msgid "Get help for a command\n"
+msgstr "Recibir ayuda para un comando\n"
+
+#: ../../../src/init.cpp:148
+msgid "Options:\n"
+msgstr "Opciones:\n"
+
+#: ../../../src/init.cpp:149
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Especificar archivo de configuración (predeterminado: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:150
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Especificar archivo pid (predeterminado: bitcoin.pid)\n"
+
+#: ../../../src/init.cpp:151
+msgid "Generate coins\n"
+msgstr "Generar monedas\n"
+
+#: ../../../src/init.cpp:152
+msgid "Don't generate coins\n"
+msgstr "No generar monedas\n"
+
+#: ../../../src/init.cpp:153
+msgid "Start minimized\n"
+msgstr "Arrancar minimizado\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify data directory\n"
+msgstr "Especificar directorio para los datos\n"
+
+#: ../../../src/init.cpp:155
+msgid "Connect through socks4 proxy\n"
+msgstr "Conectar mediante proxy socks4\n"
+
+#: ../../../src/init.cpp:156
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Permitir búsqueda DNS para addnode y connect\n"
+
+#: ../../../src/init.cpp:157
+msgid "Add a node to connect to\n"
+msgstr "Agregar un nodo para conectarse\n"
+
+#: ../../../src/init.cpp:158
+msgid "Connect only to the specified node\n"
+msgstr "Conectar solo al nodo especificado\n"
+
+#: ../../../src/init.cpp:159
+msgid "Don't accept connections from outside\n"
+msgstr "No aceptar conexiones desde el exterior\n"
+
+#: ../../../src/init.cpp:162
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "No intentar usar UPnP para mapear el puerto de entrada\n"
+
+#: ../../../src/init.cpp:164
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Intentar usar UPnP para mapear el puerto de escucha.\n"
+
+#: ../../../src/init.cpp:167
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Comisión por KB para agregar a las transacciones que envias\n"
+
+#: ../../../src/init.cpp:169
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Aceptar comandos por línea de comandos y JSON-RPC\n"
+
+#: ../../../src/init.cpp:172
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Correr en el fondo como demonio y aceptar comandos\n"
+
+#: ../../../src/init.cpp:174
+msgid "Use the test network\n"
+msgstr "Usar la red de pruebas\n"
+
+#: ../../../src/init.cpp:175
+msgid "Username for JSON-RPC connections\n"
+msgstr "Usuario para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:176
+msgid "Password for JSON-RPC connections\n"
+msgstr "Contraseña para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:177
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Escuchar conexiones JSON-RPC en el puerto <puerto> (predeterminado: 8332)\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Permitir conexiones JSON-RPC desde la dirección IP especificada\n"
+
+#: ../../../src/init.cpp:179
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Enviar comando al nodo ejecutándose en <ip> (predeterminado: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:180
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Ajustar el tamaño de la llave (key) de la piscina (pool) a <n> (predeterminado: 100)\n"
+
+#: ../../../src/init.cpp:181
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Re-escanear la cadena de bloques para transacciones perdidas de la billetera\n"
+
+#: ../../../src/init.cpp:185
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Usar OpenSSL (https) para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:187
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Archivo de certificado del servidor (Predeterminado: server.cert)\n"
+
+#: ../../../src/init.cpp:188
+msgid "Server private key (default: server.pem)\n"
+msgstr "Clave privada del servidor (Predeterminado: server.pem)\n"
+
+#: ../../../src/init.cpp:189
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Cifrados aceptados (Predeterminado: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:193
+msgid "This help message\n"
+msgstr "Este mensaje de ayuda\n"
+
+#: ../../../src/init.cpp:330
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "No se puede obtener el bloqueo en el directorio de datos %s. Probablemente el cliente de Bitcoin ya se está ejecutando."
+
+#: ../../../src/init.cpp:356
+msgid "Error loading addr.dat \n"
+msgstr "Error cargando addr.dat \n"
+
+#: ../../../src/init.cpp:362
+msgid "Error loading blkindex.dat \n"
+msgstr "Error cargando blkindex.dat \n"
+
+#: ../../../src/init.cpp:369
+msgid "Error loading wallet.dat \n"
+msgstr "Error cargando wallet.dat \n"
+
+#: ../../../src/init.cpp:449
+msgid "Invalid -proxy address"
+msgstr "Dirección proxy - inválida"
+
+#: ../../../src/init.cpp:472
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Cantidad inválida para -paytxfee=<cantidad>"
+
+#: ../../../src/init.cpp:476
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Precaución: -paytxfee está configurado muy alto. Esta es la comisión que pagarás si envias una transacción."
+
+#: ../../../src/uibase.h:147
msgid "Transaction Details"
-msgstr "Detalles de la transaccion"
+msgstr "Detalles de la transacción"
-#: ../../../uibase.h:202
+#: ../../../src/uibase.h:199
msgid "Options"
msgstr "Opciones"
-#: ../../../uibase.h:230
+#: ../../../src/uibase.h:228
msgid "About Bitcoin"
msgstr "Acerca de Bitcoin"
-#: ../../../uibase.h:340
+#: ../../../src/uibase.h:337
msgid "Your Bitcoin Addresses"
msgstr "Sus direcciones Bitcoin"
-
-#~ msgid "Usage: bitcoin [options]"
-#~ msgstr "Uso: bitcoin [opciones]"
-
diff --git a/locale/fr/LC_MESSAGES/bitcoin.po b/locale/fr/LC_MESSAGES/bitcoin.po
index b173364c09..a714e01026 100644
--- a/locale/fr/LC_MESSAGES/bitcoin.po
+++ b/locale/fr/LC_MESSAGES/bitcoin.po
@@ -559,11 +559,6 @@ msgstr "&Ouvrir Bitcoin"
msgid "O&ptions..."
msgstr "O&ptions..."
-#: ../../../ui.cpp:2521
-#: ../../../uibase.cpp:32
-msgid "&Generate Coins"
-msgstr "&Générer des pièces"
-
#: ../../../ui.cpp:2524
#: ../../../uibase.cpp:25
msgid "E&xit"
diff --git a/locale/it/LC_MESSAGES/bitcoin.mo b/locale/it/LC_MESSAGES/bitcoin.mo
index 9347018037..12386bc87e 100644
--- a/locale/it/LC_MESSAGES/bitcoin.mo
+++ b/locale/it/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/it/LC_MESSAGES/bitcoin.po b/locale/it/LC_MESSAGES/bitcoin.po
index cf13239a1b..c041b1e3a8 100644
--- a/locale/it/LC_MESSAGES/bitcoin.po
+++ b/locale/it/LC_MESSAGES/bitcoin.po
@@ -2,10 +2,11 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-26 22:02-0000\n"
-"PO-Revision-Date: 2010-05-27 13:01+0100\n"
-"Last-Translator: Franco Cimatti <hostfat@gmail.com>\n"
+"POT-Creation-Date: 2011-05-15 18:22+0100\n"
+"PO-Revision-Date: 2011-05-26 09:46+0100\n"
+"Last-Translator: Joozero <hostfat@gmail.com>\n"
"Language-Team: \n"
+"Language: Italian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -13,690 +14,672 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
-#: ../../../init.cpp:342
-msgid "Usage: bitcoin [options]"
-msgstr "Uso: bitcoin [options]"
-
-#: ../../../init.cpp:343
-msgid "Options:\n"
-msgstr "Opzioni:\n"
-
-#: ../../../init.cpp:344
-msgid "Generate coins\n"
-msgstr "Genera monete\n"
-
-#: ../../../init.cpp:345
-msgid "Don't generate coins\n"
-msgstr "Non generare monete\n"
-
-#: ../../../init.cpp:346
-msgid "Start minimized\n"
-msgstr "Avvia minimizzato\n"
-
-#: ../../../init.cpp:347
-msgid "Specify data directory\n"
-msgstr "Indica la cartella per i dati\n"
-
-#: ../../../init.cpp:348
-msgid "Connect through socks4 proxy\n"
-msgstr "Connetti attraverso proxy socks4\n"
-
-#: ../../../init.cpp:349
-msgid "Add a node to connect to\n"
-msgstr "Aggiungi un nodo a cui connetterti\n"
-
-#: ../../../init.cpp:350
-msgid "Connect only to the specified node\n"
-msgstr "Impossibile connettersi al nodo specificato\n"
-
-#: ../../../init.cpp:351
-msgid "This help message\n"
-msgstr "Questo messaggio di aiuto\n"
-
-#: ../../../init.cpp:455
-msgid "Error loading addr.dat \n"
-msgstr "Errore nel caricare addr.dat \n"
-
-#: ../../../init.cpp:461
-msgid "Error loading blkindex.dat \n"
-msgstr "Errore nel caricare blkindex.dat \n"
-
-#: ../../../init.cpp:468
-msgid "Error loading wallet.dat \n"
-msgstr "Errore nel caricare wallet.dat \n"
-
-#: ../../../init.cpp:536
-msgid "Invalid -proxy address"
-msgstr "Indirizzo proxy non valido"
-
-#: ../../../init.cpp:629
-msgid "Program has crashed and will terminate. "
-msgstr "Il programma è crashato e sarà terminato. "
-
-#: ../../../main.cpp:1465
-msgid "Warning: Disk space is low "
-msgstr "Attenzione: c'è poco spazio sul disco "
-
-#: ../../../main.cpp:2994
+#: ../../../src/net.cpp:1499
#, c-format
-msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
-msgstr "Errore: Questa è un operazione fuoriscala che richiede un sovrapprezzo di %s "
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Impossibile utilizzare la porta %d su questo computer. Bitcoin probabilmente e' gia' in esecuzione"
-#: ../../../main.cpp:2996
-msgid "Error: Transaction creation failed "
-msgstr "Errore: La creazione del trasferimento è fallito "
-
-#: ../../../main.cpp:3001
-#: ../../../ui.cpp:1761
-#: ../../../ui.cpp:1763
-#: ../../../ui.cpp:1904
-#: ../../../ui.cpp:2053
-msgid "Sending..."
-msgstr "Inviando..."
-
-#: ../../../main.cpp:3005
-msgid "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."
-msgstr "Errore: Il trasferimento è stato respinto. Questo può accadere se alcune delle monete nel tuo portafoglio erano già state spese, o anche se hai usato una copia di wallet.dat e le monete erano già state spese nella copia originale ma non segnate in quest'ultima."
-
-#: ../../../main.cpp:3017
-msgid "Invalid amount"
-msgstr "Quantità non valida"
-
-#: ../../../main.cpp:3019
-#: ../../../ui.cpp:1971
-#: ../../../ui.cpp:2038
-msgid "Insufficient funds"
-msgstr "Fondi insufficenti"
-
-#: ../../../main.cpp:3024
-msgid "Invalid bitcoin address"
-msgstr "Indirizzo bitcoin non valido"
-
-#: ../../../ui.cpp:189
+#: ../../../src/ui.cpp:202
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
-msgstr "Questo trasferimento è oltre le dimensioni massime. Puoi comunque inviarlo per un costo aggiuntivo di %s, che andrà ai nodi che effettueranno il processo della tua operazione e che supportano il network. Vuoi pagare il costo aggiuntivo?"
+msgstr "Questo trasferimento supera le dimensioni massime. Puoi comunque inviarlo per un costo aggiuntivo di %s, che andrà ai nodi che effettueranno il processo della tua operazione e che supportano il network. Vuoi pagare il costo aggiuntivo?"
-#: ../../../ui.cpp:285
+#: ../../../src/ui.cpp:301
msgid "Status"
msgstr "Stato"
-#: ../../../ui.cpp:286
+#: ../../../src/ui.cpp:302
msgid "Date"
msgstr "Data"
-#: ../../../ui.cpp:287
+#: ../../../src/ui.cpp:303
msgid "Description"
msgstr "Descrizione"
-#: ../../../ui.cpp:288
+#: ../../../src/ui.cpp:304
msgid "Debit"
msgstr "Debito"
-#: ../../../ui.cpp:289
+#: ../../../src/ui.cpp:305
msgid "Credit"
msgstr "Credito"
-#: ../../../ui.cpp:489
+#: ../../../src/ui.cpp:511
#, c-format
msgid "Open for %d blocks"
msgstr "Aperto per %d blocchi"
-#: ../../../ui.cpp:491
+#: ../../../src/ui.cpp:513
#, c-format
msgid "Open until %s"
msgstr "Aperto fino a %s"
-#: ../../../ui.cpp:497
+#: ../../../src/ui.cpp:519
#, c-format
msgid "%d/offline?"
-msgstr "%d/fuorilinea?"
+msgstr "%d/disconnesso?"
-#: ../../../ui.cpp:499
+#: ../../../src/ui.cpp:521
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/non confermato"
-#: ../../../ui.cpp:501
+#: ../../../src/ui.cpp:523
#, c-format
msgid "%d confirmations"
msgstr "%d conferme"
-#: ../../../ui.cpp:584
+#: ../../../src/ui.cpp:608
msgid "Generated"
msgstr "Generato"
-#: ../../../ui.cpp:592
+#: ../../../src/ui.cpp:616
#, c-format
msgid "Generated (%s matures in %d more blocks)"
-msgstr "Generate (%s matureranno in %d altri blocchi)"
+msgstr "Generato (%s matureranno in %d altri blocchi)"
-#: ../../../ui.cpp:596
+#: ../../../src/ui.cpp:620
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
msgstr "Generato - Attenzione: Questo blocco non è stato ricevuto da nessun altro nodo e probabilmente non sarà accettato!"
-#: ../../../ui.cpp:600
+#: ../../../src/ui.cpp:624
msgid "Generated (not accepted)"
msgstr "Generato (non accettato)"
-#: ../../../ui.cpp:610
+#: ../../../src/ui.cpp:634
msgid "From: "
msgstr "Da: "
-#: ../../../ui.cpp:634
+#: ../../../src/ui.cpp:658
msgid "Received with: "
msgstr "Ricevuto con: "
-#: ../../../ui.cpp:676
+#: ../../../src/ui.cpp:704
msgid "Payment to yourself"
msgstr "Pagamento a te stesso"
-#: ../../../ui.cpp:713
+#: ../../../src/ui.cpp:738
msgid "To: "
msgstr "A: "
-#: ../../../ui.cpp:1009
+#: ../../../src/ui.cpp:1053
msgid " Generating"
msgstr " Generando"
-#: ../../../ui.cpp:1011
+#: ../../../src/ui.cpp:1055
msgid "(not connected)"
msgstr "(non connesso)"
-#: ../../../ui.cpp:1014
+#: ../../../src/ui.cpp:1058
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d connessioni %d blocchi %d trasferimenti"
-#: ../../../ui.cpp:1123
-#: ../../../ui.cpp:2351
+#: ../../../src/ui.cpp:1163
+#: ../../../src/ui.cpp:2527
msgid "New Receiving Address"
-msgstr "Nuovo indirizzo ricevente"
+msgstr "Nuovo indirizzo di ricezione"
-#: ../../../ui.cpp:1124
-#: ../../../ui.cpp:2352
+#: ../../../src/ui.cpp:1164
+#: ../../../src/ui.cpp:2528
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
-"E' una buona abitudine usare un nuovo indirizzo per ogni pagamento che ricevuto.\n"
+"Si dovrebbe usare un nuovo indirizzo per ogni pagamento che ricevi.\n"
"\n"
"Label"
-#: ../../../ui.cpp:1193
+#: ../../../src/ui.cpp:1233
msgid "<b>Status:</b> "
msgstr "<b>Stato:</b> "
-#: ../../../ui.cpp:1198
+#: ../../../src/ui.cpp:1238
msgid ", has not been successfully broadcast yet"
-msgstr ", non è ancora stato diffuso correttamente"
+msgstr ", non è ancora stato trasmesso correttamente"
-#: ../../../ui.cpp:1200
+#: ../../../src/ui.cpp:1240
#, c-format
msgid ", broadcast through %d node"
-msgstr ", diffusione attraverso %d nodo"
+msgstr ", trasmissione attraverso %d nodo"
-#: ../../../ui.cpp:1202
+#: ../../../src/ui.cpp:1242
#, c-format
msgid ", broadcast through %d nodes"
-msgstr ", diffusione attraverso %d nodi"
+msgstr ", trasmissione attraverso %d nodi"
-#: ../../../ui.cpp:1206
+#: ../../../src/ui.cpp:1246
msgid "<b>Date:</b> "
msgstr "<b>Data:</b> "
-#: ../../../ui.cpp:1214
+#: ../../../src/ui.cpp:1254
msgid "<b>Source:</b> Generated<br>"
msgstr "<b>Sorgente:</b> Generato<br>"
-#: ../../../ui.cpp:1220
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1260
+#: ../../../src/ui.cpp:1278
msgid "<b>From:</b> "
msgstr "<b>Da:</b> "
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1278
msgid "unknown"
-msgstr "sconoscuto"
+msgstr "sconosciuto"
-#: ../../../ui.cpp:1239
-#: ../../../ui.cpp:1263
-#: ../../../ui.cpp:1322
+#: ../../../src/ui.cpp:1279
+#: ../../../src/ui.cpp:1303
+#: ../../../src/ui.cpp:1362
msgid "<b>To:</b> "
msgstr "<b>A:</b> "
-#: ../../../ui.cpp:1242
+#: ../../../src/ui.cpp:1282
msgid " (yours, label: "
msgstr " (vostro, label: "
-#: ../../../ui.cpp:1244
+#: ../../../src/ui.cpp:1284
msgid " (yours)"
msgstr " (vostro)"
-#: ../../../ui.cpp:1281
-#: ../../../ui.cpp:1293
-#: ../../../ui.cpp:1356
+#: ../../../src/ui.cpp:1321
+#: ../../../src/ui.cpp:1333
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:1396
msgid "<b>Credit:</b> "
msgstr "<b>Credito:</b> "
-#: ../../../ui.cpp:1283
+#: ../../../src/ui.cpp:1323
#, c-format
msgid "(%s matures in %d more blocks)"
msgstr "(%s matureranno in %d altri blocchi)"
-#: ../../../ui.cpp:1285
+#: ../../../src/ui.cpp:1325
msgid "(not accepted)"
msgstr "(non accettato)"
-#: ../../../ui.cpp:1330
-#: ../../../ui.cpp:1353
+#: ../../../src/ui.cpp:1370
+#: ../../../src/ui.cpp:1378
+#: ../../../src/ui.cpp:1393
msgid "<b>Debit:</b> "
msgstr "<b>Debito:</b> "
-#: ../../../ui.cpp:1344
+#: ../../../src/ui.cpp:1384
msgid "<b>Transaction fee:</b> "
-msgstr "<b>Trasferimento costo:</b> "
+msgstr "<b>Costo del trasferimento :</b> "
-#: ../../../ui.cpp:1360
+#: ../../../src/ui.cpp:1400
msgid "<b>Net amount:</b> "
msgstr "<b>Quantità del network:</b> "
-#: ../../../ui.cpp:1367
+#: ../../../src/ui.cpp:1407
msgid "Message:"
msgstr "Messaggio:"
-#: ../../../ui.cpp:1370
+#: ../../../src/ui.cpp:1409
+msgid "Comment:"
+msgstr "Commento:"
+
+#: ../../../src/ui.cpp:1412
msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
msgstr "Le monete generate devono aspettare 120 blocchi prima di poter essere spese. Quando hai generato questo blocco, è stato diffuso sul network per essere aggiunto alla catena dei blocchi. Se fallirà l'entrata nella catena, cambierà in \"non accettato\" e non spendibile. Questo può capitare se un altro nodo genera un blocco pochi secondi prima del tuo."
-#: ../../../ui.cpp:1437
+#: ../../../src/ui.cpp:1592
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Impossibile creare il file autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1628
msgid "Main"
msgstr "Principale"
-#: ../../../ui.cpp:1442
+#: ../../../src/ui.cpp:1636
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Avvia Bitcoin all'avvio del sistema"
+
+#: ../../../src/ui.cpp:1643
msgid "&Minimize on close"
msgstr "&Minimizza se chiuso"
-#: ../../../ui.cpp:1595
+#: ../../../src/ui.cpp:1785
#, c-format
-msgid "version %s%s BETA"
-msgstr "versione %s%s BETA"
-
-#: ../../../ui.cpp:1681
-msgid "Will appear as \"From: Unknown\""
-msgstr "Apparirà come \"Da: Sconosciuto\""
-
-#: ../../../ui.cpp:1681
-msgid "n/a"
-msgstr "Sconosciuto"
+msgid "version %s"
+msgstr "versione %s"
-#: ../../../ui.cpp:1681
-msgid "Unknown"
-msgstr "Sconosciuto"
-
-#: ../../../ui.cpp:1682
-msgid "Can't include a message when sending to a Bitcoin address"
-msgstr "Non si può includere un messaggio quando si invia attraverso l'indirizzo Bitcoin"
-
-#: ../../../ui.cpp:1735
+#: ../../../src/ui.cpp:1897
msgid "Error in amount "
msgstr "Errore nell'ammontare "
-#: ../../../ui.cpp:1735
-#: ../../../ui.cpp:1740
-#: ../../../ui.cpp:1745
-#: ../../../ui.cpp:1771
-#: ../../../uibase.cpp:61
+#: ../../../src/ui.cpp:1897
+#: ../../../src/ui.cpp:1902
+#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:1942
+#: ../../../src/uibase.cpp:55
msgid "Send Coins"
msgstr "Invia monete"
-#: ../../../ui.cpp:1740
+#: ../../../src/ui.cpp:1902
msgid "Amount exceeds your balance "
msgstr "L'ammontare è andato oltre i tuoi capitali "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:1907
msgid "Total exceeds your balance when the "
-msgstr "Il totale va oltre i tuoi capitali quando il "
+msgstr "Il totale supera il tuo bilancio quando il "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:1907
msgid " transaction fee is included "
-msgstr " il costo trasferimento è incluso "
+msgstr " il costo del trasferimento è incluso "
-#: ../../../ui.cpp:1761
+#: ../../../src/ui.cpp:1925
msgid "Payment sent "
msgstr "Pagamento inviato "
-#: ../../../ui.cpp:1771
+#: ../../../src/ui.cpp:1925
+#: ../../../src/ui.cpp:1930
+#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2227
+#: ../../../src/main.cpp:3999
+msgid "Sending..."
+msgstr "Invio in corso..."
+
+#: ../../../src/ui.cpp:1942
msgid "Invalid address "
msgstr "Indirizzo non valido "
-#: ../../../ui.cpp:1825
+#: ../../../src/ui.cpp:1995
#, c-format
msgid "Sending %s to %s"
msgstr "Inviando %s a %s"
-#: ../../../ui.cpp:1898
-#: ../../../ui.cpp:1931
+#: ../../../src/ui.cpp:2068
+#: ../../../src/ui.cpp:2101
msgid "CANCELLED"
msgstr "CANCELLATO"
-#: ../../../ui.cpp:1902
+#: ../../../src/ui.cpp:2072
msgid "Cancelled"
msgstr "Cancellato"
-#: ../../../ui.cpp:1904
+#: ../../../src/ui.cpp:2074
msgid "Transfer cancelled "
msgstr "Operazione cancellata "
-#: ../../../ui.cpp:1957
+#: ../../../src/ui.cpp:2127
msgid "Error: "
msgstr "Errore: "
-#: ../../../ui.cpp:1976
+#: ../../../src/ui.cpp:2141
+#: ../../../src/ui.cpp:2212
+#: ../../../src/main.cpp:4018
+msgid "Insufficient funds"
+msgstr "Fondi insufficenti"
+
+#: ../../../src/ui.cpp:2146
msgid "Connecting..."
msgstr "Connessione in corso..."
-#: ../../../ui.cpp:1981
+#: ../../../src/ui.cpp:2151
msgid "Unable to connect"
msgstr "Impossibile connettersi"
-#: ../../../ui.cpp:1986
+#: ../../../src/ui.cpp:2156
msgid "Requesting public key..."
msgstr "Richiesta chiave pubblica..."
-#: ../../../ui.cpp:1998
+#: ../../../src/ui.cpp:2168
msgid "Received public key..."
msgstr "Ricezione chiave pubblica..."
-#: ../../../ui.cpp:2010
+#: ../../../src/ui.cpp:2182
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Il destinatario non accetta transazioni effettuate tramite questo IP"
+
+#: ../../../src/ui.cpp:2184
msgid "Transfer was not accepted"
msgstr "Trasferimento non accettato"
-#: ../../../ui.cpp:2019
+#: ../../../src/ui.cpp:2193
msgid "Invalid response received"
msgstr "Risposta non valida ricevuta"
-#: ../../../ui.cpp:2034
+#: ../../../src/ui.cpp:2208
msgid "Creating transaction..."
-msgstr "Creazione trasferimento..."
+msgstr "Creo transazione..."
-#: ../../../ui.cpp:2046
+#: ../../../src/ui.cpp:2220
#, c-format
-msgid "This is an oversized transaction that requires a transaction fee of %s"
-msgstr "Questo è un trasferimento fuoriscala che richiede un costo aggiuntivo di %s"
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Questa transazione richiede un costo di transazione di almeno %s a causa della sua quantità, complessità, o per l'uso di fondi recentemente ricevuti"
-#: ../../../ui.cpp:2048
+#: ../../../src/ui.cpp:2222
msgid "Transaction creation failed"
msgstr "Creazione trasferimento fallita"
-#: ../../../ui.cpp:2055
+#: ../../../src/ui.cpp:2229
msgid "Transaction aborted"
msgstr "Trasferimento bloccato"
-#: ../../../ui.cpp:2063
+#: ../../../src/ui.cpp:2237
msgid "Lost connection, transaction cancelled"
msgstr "Connessione persa, trasferimento cancellato"
-#: ../../../ui.cpp:2079
+#: ../../../src/ui.cpp:2253
msgid "Sending payment..."
-msgstr "Inviando pagamento..."
+msgstr "Invio del pagamento..."
-#: ../../../ui.cpp:2085
+#: ../../../src/ui.cpp:2259
msgid "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."
msgstr "Il trasferimento è stato respinto. Questo può accadere se alcune delle monete nel tuo portafoglio erano già state spese, o anche se hai usato una copia di wallet.dat e le monete erano già state spese nella copia originale ma non segnate in quest'ultima."
-#: ../../../ui.cpp:2092
+#: ../../../src/ui.cpp:2268
msgid "Waiting for confirmation..."
msgstr "In attesa di conferma..."
-#: ../../../ui.cpp:2110
+#: ../../../src/ui.cpp:2286
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
"but the comment information will be blank."
msgstr ""
-"Il pagamento è inviato, ma il ricevente non è stato in grado di verificarlo.\n"
-"Il trasferimento è registrato e costerà sarà accreditato al ricevente,\n"
-"ma il commento verrà mostrato come vuoto."
+"Il pagamento è stato inviato, ma il destinatario non è stato in grado di verificarlo.\n"
+"Il trasferimento è registrato e sarà accreditato al destinatario,\n"
+"ma il commento informativo verrà mostrato come vuoto."
-#: ../../../ui.cpp:2119
+#: ../../../src/ui.cpp:2295
msgid "Payment was sent, but an invalid response was received"
msgstr "Il pagamento è stato inviato, ma è arrivata un risposta invalida"
-#: ../../../ui.cpp:2125
+#: ../../../src/ui.cpp:2301
msgid "Payment completed"
msgstr "Pagamento completato"
-#: ../../../ui.cpp:2156
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2332
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Name"
msgstr "Nome"
-#: ../../../ui.cpp:2157
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2333
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Address"
msgstr "Indirizzo"
-#: ../../../ui.cpp:2159
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2490
msgid "Label"
msgstr "Label"
-#: ../../../ui.cpp:2160
-#: ../../../uibase.cpp:908
+#: ../../../src/ui.cpp:2336
+#: ../../../src/uibase.cpp:837
msgid "Bitcoin Address"
msgstr "Indirizzo Bitcoin"
-#: ../../../ui.cpp:2284
+#: ../../../src/ui.cpp:2460
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Questo qui è uno dei tuoi indirizzi personali per ricevere pagamenti e non può essere inserito nella rubrica indirizzi. "
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2308
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2484
msgid "Edit Address"
msgstr "Modifica indirizzo"
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2490
msgid "Edit Address Label"
msgstr "Modifica spazio indirizzo"
-#: ../../../ui.cpp:2339
-#: ../../../ui.cpp:2345
+#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2521
msgid "Add Address"
msgstr "Aggiungi indirizzo"
-#: ../../../ui.cpp:2421
+#: ../../../src/ui.cpp:2598
msgid "Bitcoin"
msgstr "Bitcoin"
-#: ../../../ui.cpp:2423
+#: ../../../src/ui.cpp:2600
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Generando"
-#: ../../../ui.cpp:2425
+#: ../../../src/ui.cpp:2602
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (non connesso)"
-#: ../../../ui.cpp:2500
+#: ../../../src/ui.cpp:2681
msgid "&Open Bitcoin"
msgstr "&Apri Bitcoin"
-#: ../../../ui.cpp:2501
-msgid "O&ptions..."
-msgstr "O&pzioni..."
+#: ../../../src/ui.cpp:2682
+msgid "&Send Bitcoins"
+msgstr "&Apri Bitcoin"
-#: ../../../ui.cpp:2502
-#: ../../../uibase.cpp:34
-msgid "&Generate Coins"
-msgstr "&Genera monete"
+#: ../../../src/ui.cpp:2683
+msgid "O&ptions..."
+msgstr "&Opzioni..."
-#: ../../../ui.cpp:2505
-#: ../../../uibase.cpp:27
+#: ../../../src/ui.cpp:2686
+#: ../../../src/uibase.cpp:25
msgid "E&xit"
-msgstr "E&sci"
+msgstr "&Esci"
+
+#: ../../../src/ui.cpp:2902
+msgid "Program has crashed and will terminate. "
+msgstr "Il programma è crashato e sarà terminato. "
+
+#: ../../../src/main.cpp:1868
+msgid "Warning: Disk space is low "
+msgstr "Attenzione: c'è poco spazio sul disco "
+
+#: ../../../src/main.cpp:3992
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Errore: Questa transazione richiede un costo di transazione di almeno %s a causa della sua quantità, complessità, o per l'uso di fondi recentemente ricevuti"
+
+#: ../../../src/main.cpp:3994
+msgid "Error: Transaction creation failed "
+msgstr "Errore: Creazione del trasferimento fallito "
+
+#: ../../../src/main.cpp:4003
+msgid "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."
+msgstr "Errore: Il trasferimento è stato respinto. Questo può accadere se alcune delle monete nel tuo portafoglio erano già state spese, o anche se hai usato una copia di wallet.dat e le monete erano già state spese nella copia originale ma non segnate in quest'ultima."
+
+#: ../../../src/main.cpp:4016
+msgid "Invalid amount"
+msgstr "Quantità non valida"
+
+#: ../../../src/main.cpp:4023
+msgid "Invalid bitcoin address"
+msgstr "Indirizzo bitcoin non valido"
-#: ../../../uibase.cpp:30
+#: ../../../src/rpc.cpp:1800
+#: ../../../src/rpc.cpp:1802
+#, c-format
+msgid "To use the %s option"
+msgstr "Usare l'opzione %s"
+
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Attenzione: %s, devi impostare rpcpassword=<password>\n"
+"nel file di configurazione: %s\n"
+"Se questo file non esiste, puoi crearlo come un file di sola lettura.\n"
+
+#: ../../../src/rpc.cpp:1972
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Devi settare rpcpassword=<password> nel file di configurazione:\n"
+"%s\n"
+"Se questo file non esiste, puoi crearlo come un file di sola lettura"
+
+#: ../../../src/util.cpp:865
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Attenzione: Controlla che data/ora del tuo computer siano corrette. Se il tuo orologio è sbagliato bitcoin non funzionerà correttamente"
+
+#: ../../../src/util.cpp:898
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
msgid "&File"
msgstr "&File"
-#: ../../../uibase.cpp:38
+#: ../../../src/uibase.cpp:32
msgid "&Your Receiving Addresses..."
msgstr "&Il tuo indirizzo di ricezione..."
-#: ../../../uibase.cpp:42
+#: ../../../src/uibase.cpp:36
msgid "&Options..."
msgstr "&Opzioni..."
-#: ../../../uibase.cpp:45
+#: ../../../src/uibase.cpp:39
msgid "&Settings"
msgstr "I&mpostazioni"
-#: ../../../uibase.cpp:49
+#: ../../../src/uibase.cpp:43
msgid "&About..."
msgstr "&Info..."
-#: ../../../uibase.cpp:52
+#: ../../../src/uibase.cpp:46
msgid "&Help"
msgstr "&Aiuto"
-#: ../../../uibase.cpp:62
+#: ../../../src/uibase.cpp:56
msgid "Address Book"
msgstr "Rubrica indirizzi"
-#: ../../../uibase.cpp:77
+#: ../../../src/uibase.cpp:69
msgid "Your Bitcoin Address:"
msgstr "Il tuo indirizzo Bitcoin:"
-#: ../../../uibase.cpp:84
+#: ../../../src/uibase.cpp:76
msgid " &New... "
msgstr " &Nuovo... "
-#: ../../../uibase.cpp:87
-#: ../../../uibase.cpp:851
-#: ../../../uibase.cpp:954
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
msgid " &Copy to Clipboard "
msgstr " &Copia nella Clipboard "
-#: ../../../uibase.cpp:102
+#: ../../../src/uibase.cpp:93
msgid "Balance:"
-msgstr "Capitali:"
+msgstr "Bilancio:"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " All"
msgstr " Tutte"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " Sent"
msgstr " Inviato"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " Received"
msgstr " Ricevuto"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " In Progress"
msgstr " In lavorazione"
-#: ../../../uibase.cpp:142
+#: ../../../src/uibase.cpp:130
msgid "All Transactions"
-msgstr "Tutte le operazioni"
+msgstr "Tutte le transazioni"
-#: ../../../uibase.cpp:153
+#: ../../../src/uibase.cpp:141
msgid "Sent/Received"
msgstr "Inviato/Ricevuto"
-#: ../../../uibase.cpp:164
+#: ../../../src/uibase.cpp:152
msgid "Sent"
msgstr "Inviato"
-#: ../../../uibase.cpp:175
+#: ../../../src/uibase.cpp:163
msgid "Received"
msgstr "Ricevuto"
-#: ../../../uibase.cpp:318
-#: ../../../uibase.cpp:479
-#: ../../../uibase.cpp:580
-#: ../../../uibase.cpp:793
-#: ../../../uibase.cpp:854
-#: ../../../uibase.cpp:963
-#: ../../../uibase.cpp:1052
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
msgid "OK"
msgstr "OK"
-#: ../../../uibase.cpp:361
-msgid "Optional transaction fee you give to the nodes that process your transactions."
-msgstr "Costo aggiuntivo opzionale che tu dai ai nodi che realizzano i tuoi trasferimenti"
-
-#: ../../../uibase.cpp:370
-msgid "Transaction fee:"
-msgstr "Costo trasferimento:"
-
-#: ../../../uibase.cpp:386
-msgid "&Limit coin generation to"
-msgstr "&Limita la generazione moneta a"
-
-#: ../../../uibase.cpp:393
-msgid "processors"
-msgstr "processori"
-
-#: ../../../uibase.cpp:399
+#: ../../../src/uibase.cpp:345
msgid "&Start Bitcoin on system startup"
-msgstr "A&vvia Bitcoin all'avvio del sistema"
+msgstr "&Avvia Bitcoin all'avvio del sistema"
-#: ../../../uibase.cpp:403
+#: ../../../src/uibase.cpp:348
msgid "&Minimize to the tray instead of the taskbar"
msgstr "&Minimizza nella tray invece che nella barra"
-#: ../../../uibase.cpp:407
-msgid "M&inimize to the tray on close"
-msgstr "M&inimizza nella tray alla chiusura"
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Imposta le porte del firewall utilizzando &UPnP"
+
+#: ../../../src/uibase.cpp:354
+msgid "&Minimize to the tray on close"
+msgstr "&Minimizza nella tray alla chiusura"
-#: ../../../uibase.cpp:414
+#: ../../../src/uibase.cpp:360
msgid "&Connect through socks4 proxy: "
-msgstr "%Connesso attraverso proxy socks4: "
+msgstr "&Connesso attraverso proxy socks4: "
-#: ../../../uibase.cpp:426
+#: ../../../src/uibase.cpp:371
msgid "Proxy &IP:"
msgstr "Proxy &IP:"
-#: ../../../uibase.cpp:434
+#: ../../../src/uibase.cpp:379
msgid " &Port:"
msgstr " &Porta:"
-#: ../../../uibase.cpp:456
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Tassa di transazione per ogni KB opzionale che consente di assicurarsi che le transazioni siano trattate con rapidità. La maggior parte delle operazioni sono 1KB. Quota 0,01 raccomandata."
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Costo trasferimento:"
+
+#: ../../../src/uibase.cpp:420
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
-#: ../../../uibase.cpp:460
+#: ../../../src/uibase.cpp:424
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
-#: ../../../uibase.cpp:482
-#: ../../../uibase.cpp:735
-#: ../../../uibase.cpp:798
-#: ../../../uibase.cpp:857
-#: ../../../uibase.cpp:966
-#: ../../../uibase.cpp:1055
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
msgid "Cancel"
msgstr "Cancella"
-#: ../../../uibase.cpp:485
+#: ../../../src/uibase.cpp:449
msgid "&Apply"
msgstr "&Accetta"
-#: ../../../uibase.cpp:546
+#: ../../../src/uibase.cpp:508
msgid "Bitcoin "
msgstr "Bitcoin "
-#: ../../../uibase.cpp:552
+#: ../../../src/uibase.cpp:514
msgid "version"
msgstr "versione"
-#: ../../../uibase.cpp:563
+#: ../../../src/uibase.cpp:525
msgid ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -718,47 +701,39 @@ msgstr ""
"l'uso del (http://www.openssl.org/) e il software criptografico scritto\n"
"da Eric Young (eay@cryptsoft.com) e UPnP software scritto da Thomas Bernard."
-#: ../../../uibase.cpp:619
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
-msgstr "Inserisci un indirizzo Bitcoin (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) o un indirizzo IP (e.g. 123.45.6.7)"
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Inserisci un indirizzo Bitcoin (es. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-#: ../../../uibase.cpp:633
+#: ../../../src/uibase.cpp:595
msgid "Pay &To:"
-msgstr "Paga %a:"
+msgstr "Paga &a:"
-#: ../../../uibase.cpp:648
+#: ../../../src/uibase.cpp:610
msgid "&Paste"
msgstr "&Incolla"
-#: ../../../uibase.cpp:651
+#: ../../../src/uibase.cpp:613
msgid " Address &Book..."
msgstr " &Rubrica degli indirizzi..."
-#: ../../../uibase.cpp:658
+#: ../../../src/uibase.cpp:620
msgid "&Amount:"
msgstr "&Quantità"
-#: ../../../uibase.cpp:668
-msgid "T&ransfer:"
-msgstr "T&rasferimento:"
+#: ../../../src/uibase.cpp:630
+msgid "&Transfer:"
+msgstr "&Trasferimento:"
-#: ../../../uibase.cpp:674
+#: ../../../src/uibase.cpp:636
msgid " Standard"
msgstr " Standard"
-#: ../../../uibase.cpp:696
-msgid "&From:"
-msgstr "&Proveniente da:"
-
-#: ../../../uibase.cpp:713
-msgid "&Message:"
-msgstr "&Messaggio:"
-
-#: ../../../uibase.cpp:730
+#: ../../../src/uibase.cpp:663
msgid "&Send"
msgstr "&Invia"
-#: ../../../uibase.cpp:782
+#: ../../../src/uibase.cpp:711
msgid ""
"\n"
"\n"
@@ -768,48 +743,225 @@ msgstr ""
"\n"
"Connessione in corso..."
-#: ../../../uibase.cpp:832
+#: ../../../src/uibase.cpp:761
msgid "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. The highlighted address is displayed in the main window."
msgstr "Questi sono i tuoi indirizzi Bitcoin per ricevere pagamenti. Potrai darne uno diverso ad ognuno per cosi tenere traccia di chi ti sta pagando. L'indirizzo selezionato sarà quello mostrato nella finestra principale."
-#: ../../../uibase.cpp:845
-#: ../../../uibase.cpp:957
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
msgid "&Edit..."
msgstr "&Cambia..."
-#: ../../../uibase.cpp:848
-#: ../../../uibase.cpp:960
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
msgid " &New Address... "
msgstr " &Nuovo indirizzo... "
-#: ../../../uibase.cpp:920
+#: ../../../src/uibase.cpp:849
msgid "Sending"
-msgstr "Inviando"
+msgstr "Invio in corso.."
-#: ../../../uibase.cpp:928
+#: ../../../src/uibase.cpp:857
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
msgstr "Questi sono i tuoi indirizzi Bitcoin per ricevere pagamenti. Potrai darne uno diverso ad ognuno per cosi tenere traccia di chi ti sta pagando. L'indirizzo selezionato sarà quello mostrato nella finestra principale."
-#: ../../../uibase.cpp:941
+#: ../../../src/uibase.cpp:870
msgid "Receiving"
msgstr "Ricevendo"
-#: ../../../uibase.cpp:951
+#: ../../../src/uibase.cpp:880
msgid "&Delete"
msgstr "&Cancella"
-#: ../../../uibase.h:150
+#: ../../../src/init.cpp:147
+msgid "Bitcoin version"
+msgstr "Versione Bitcoin "
+
+#: ../../../src/init.cpp:148
+msgid "Usage:"
+msgstr "Uso:"
+
+#: ../../../src/init.cpp:150
+msgid "Send command to -server or bitcoind\n"
+msgstr "Invia comando a -server o a bitcoin\n"
+
+#: ../../../src/init.cpp:151
+msgid "List commands\n"
+msgstr "Lista comandi\n"
+
+#: ../../../src/init.cpp:152
+msgid "Get help for a command\n"
+msgstr "Chiedi aiuto per i comandi\n"
+
+#: ../../../src/init.cpp:153
+msgid "Options:\n"
+msgstr "Opzioni:\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Specifica il file di configurazione (normalmente e': bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:155
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Specifica il fil pid (normalmente: bitcoin.pid)\n"
+
+#: ../../../src/init.cpp:156
+msgid "Generate coins\n"
+msgstr "Genera monete\n"
+
+#: ../../../src/init.cpp:157
+msgid "Don't generate coins\n"
+msgstr "Non generare monete\n"
+
+#: ../../../src/init.cpp:158
+msgid "Start minimized\n"
+msgstr "Avvia minimizzato\n"
+
+#: ../../../src/init.cpp:159
+msgid "Specify data directory\n"
+msgstr "Indica la cartella per i dati\n"
+
+#: ../../../src/init.cpp:160
+msgid "Connect through socks4 proxy\n"
+msgstr "Connetti attraverso proxy socks4\n"
+
+#: ../../../src/init.cpp:161
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Permetti DNS lookups per aggiungere un nodo e collegarsi\n"
+
+#: ../../../src/init.cpp:162
+msgid "Add a node to connect to\n"
+msgstr "Aggiungi un nodoper la connessione a\n"
+
+#: ../../../src/init.cpp:163
+msgid "Connect only to the specified node\n"
+msgstr "Collegati solo al nodo specificato\n"
+
+#: ../../../src/init.cpp:164
+msgid "Don't accept connections from outside\n"
+msgstr "Non accettare connessioni dall'esterno\n"
+
+#: ../../../src/init.cpp:167
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Non provare a usare UPnP per mappare le porte in ascolto\n"
+
+#: ../../../src/init.cpp:169
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Prova ad usare l' UPnP per mappare la porte in ascolto\n"
+
+#: ../../../src/init.cpp:172
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Tassa per KB da aggiungere alle operazioni di invio\n"
+
+#: ../../../src/init.cpp:174
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Accetta linea di comando e i comando JSON-RPC\n"
+
+#: ../../../src/init.cpp:177
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Avvia in background come processo e accetta i comandi\n"
+
+#: ../../../src/init.cpp:179
+msgid "Use the test network\n"
+msgstr "Usa il network test\n"
+
+#: ../../../src/init.cpp:180
+msgid "Username for JSON-RPC connections\n"
+msgstr "Username per le connessioni JSON-RPC\n"
+
+#: ../../../src/init.cpp:181
+msgid "Password for JSON-RPC connections\n"
+msgstr "Password per le connessioni JSON-RPC\n"
+
+#: ../../../src/init.cpp:182
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "In ascolta per connessioni JSON-RPC sulla porta <port> (default: 8332)\n"
+
+#: ../../../src/init.cpp:183
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Permetti connessioni JSON-RPC da un indirizzo IP specifico\n"
+
+#: ../../../src/init.cpp:184
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Invia comandi al nodo in esecuzione su <ip> (default: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:185
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Imposta la dimensione della key pool a <n> (default: 100)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Ricontrolla il blocco della catena transazioni del portafoglio mancate\n"
+
+#: ../../../src/init.cpp:190
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"opzioni SSL: (Consulta Bitcoin Wiki per le istruzioni di configurazione dell' SSL)\n"
+
+#: ../../../src/init.cpp:191
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Usa OpenSSL (https) per connessioni JSON-RPC\n"
+
+#: ../../../src/init.cpp:192
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "File del certificato del server (default: server.cert)\n"
+
+#: ../../../src/init.cpp:193
+msgid "Server private key (default: server.pem)\n"
+msgstr "Chiave del server privata ((default: server.pem)\n"
+
+#: ../../../src/init.cpp:194
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Cifrari accettati (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:198
+msgid "This help message\n"
+msgstr "Questo messaggio di aiuto\n"
+
+#: ../../../src/init.cpp:335
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Impossibile ottenere un blocco sulla directory %s. Bitcoin e' probabilmente gia' in esecuzione"
+
+#: ../../../src/init.cpp:361
+msgid "Error loading addr.dat \n"
+msgstr "Errore nel caricamento addr.dat \n"
+
+#: ../../../src/init.cpp:367
+msgid "Error loading blkindex.dat \n"
+msgstr "Errore nel caricamento blkindex.dat \n"
+
+#: ../../../src/init.cpp:374
+msgid "Error loading wallet.dat \n"
+msgstr "Errore nel caricamento wallet.dat \n"
+
+#: ../../../src/init.cpp:454
+msgid "Invalid -proxy address"
+msgstr "Indirizzo proxy non valido"
+
+#: ../../../src/init.cpp:477
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Quantita' non valida per -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:481
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Attenzione: -paytxfee e' molto alta. Questo e' la tassa che pagherai se invii la transazione"
+
+#: ../../../src/uibase.h:147
msgid "Transaction Details"
-msgstr "Dettagli operazione"
+msgstr "Dettagli transazione"
-#: ../../../uibase.h:203
+#: ../../../src/uibase.h:199
msgid "Options"
msgstr "Opzioni"
-#: ../../../uibase.h:231
+#: ../../../src/uibase.h:228
msgid "About Bitcoin"
msgstr "Info Bitcoin"
-#: ../../../uibase.h:341
+#: ../../../src/uibase.h:337
msgid "Your Bitcoin Addresses"
msgstr "Il tuo indirizzo Bitcoin"
diff --git a/locale/lt/LC_MESSAGES/bitcoin.mo b/locale/lt/LC_MESSAGES/bitcoin.mo
new file mode 100644
index 0000000000..bba16a857f
--- /dev/null
+++ b/locale/lt/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/lt/LC_MESSAGES/bitcoin.po b/locale/lt/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..b0decb26cb
--- /dev/null
+++ b/locale/lt/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,971 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-05-17 14:07+0100\n"
+"PO-Revision-Date: 2011-05-17 14:09+0100\n"
+"Last-Translator: Anonymous <anon@none>\n"
+"Language-Team: \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/net.cpp:1503
+#, c-format
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Neįmanoma prisijungti prie šio kompiuterio porto %d. Bitcoin programa tikriausiai jau yra paleista"
+
+#: ../../../src/ui.cpp:204
+#, c-format
+msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
+msgstr "Šis pervedimas viršija dydžio limitą. Jūs galite siūsti šią suma sumokėję %s mokestį, kuris bus skirtas nodams už persiuntimą ir padėti tinklui. Ar sutinkate pridėti ši mokestį?"
+
+#: ../../../src/ui.cpp:303
+msgid "Status"
+msgstr "Būklė"
+
+#: ../../../src/ui.cpp:304
+msgid "Date"
+msgstr "Data"
+
+#: ../../../src/ui.cpp:305
+msgid "Description"
+msgstr "Apibūdinimas"
+
+#: ../../../src/ui.cpp:306
+msgid "Debit"
+msgstr "Debetas"
+
+#: ../../../src/ui.cpp:307
+msgid "Credit"
+msgstr "Kreditas"
+
+#: ../../../src/ui.cpp:513
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Atidaryta %d blokams"
+
+#: ../../../src/ui.cpp:515
+#, c-format
+msgid "Open until %s"
+msgstr "Atidaryta iki %s"
+
+#: ../../../src/ui.cpp:521
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/neprisijunges?"
+
+#: ../../../src/ui.cpp:523
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/ nepatvirtinta"
+
+#: ../../../src/ui.cpp:525
+#, c-format
+msgid "%d confirmations"
+msgstr "%d patvirtinta"
+
+#: ../../../src/ui.cpp:610
+msgid "Generated"
+msgstr "Sugeneruota"
+
+#: ../../../src/ui.cpp:618
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Sugeneruota (%s bus galima naudoti už %d blokų)"
+
+#: ../../../src/ui.cpp:622
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "Sugeneruota - Perspėjimas: Šio bloko negavo kiti nodai ir jis tikriausiai nebus priimtas!"
+
+#: ../../../src/ui.cpp:626
+msgid "Generated (not accepted)"
+msgstr "Sugeneruota (nepriimta)"
+
+#: ../../../src/ui.cpp:636
+msgid "From: "
+msgstr "Nuo: "
+
+#: ../../../src/ui.cpp:660
+msgid "Received with: "
+msgstr "Priimta su: "
+
+#: ../../../src/ui.cpp:706
+msgid "Payment to yourself"
+msgstr "Pervedimas sau"
+
+#: ../../../src/ui.cpp:740
+msgid "To: "
+msgstr "Kam: "
+
+#: ../../../src/ui.cpp:1055
+msgid " Generating"
+msgstr " Generuojama"
+
+#: ../../../src/ui.cpp:1057
+msgid "(not connected)"
+msgstr "(neprijungta)"
+
+#: ../../../src/ui.cpp:1060
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d Jungtys %d Blokai %d pervedimai"
+
+#: ../../../src/ui.cpp:1165
+#: ../../../src/ui.cpp:2529
+msgid "New Receiving Address"
+msgstr "Naujas priėmimo adresas"
+
+#: ../../../src/ui.cpp:1166
+#: ../../../src/ui.cpp:2530
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Naudokite naują adresas kiekvienam pervedimui.\n"
+"\n"
+"Pavadinimas"
+
+#: ../../../src/ui.cpp:1235
+msgid "<b>Status:</b> "
+msgstr "<b>Būklė:</b> "
+
+#: ../../../src/ui.cpp:1240
+msgid ", has not been successfully broadcast yet"
+msgstr ", dar nėra paskelbta"
+
+#: ../../../src/ui.cpp:1242
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", paskelbta per %d nodą"
+
+#: ../../../src/ui.cpp:1244
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", paskelbta per %d nodus"
+
+#: ../../../src/ui.cpp:1248
+msgid "<b>Date:</b> "
+msgstr "<b>Data:</b> "
+
+#: ../../../src/ui.cpp:1256
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Iš:</b> Sugeneruota<br>"
+
+#: ../../../src/ui.cpp:1262
+#: ../../../src/ui.cpp:1280
+msgid "<b>From:</b> "
+msgstr "<b>Nuo:</b> "
+
+#: ../../../src/ui.cpp:1280
+msgid "unknown"
+msgstr "nežinomas"
+
+#: ../../../src/ui.cpp:1281
+#: ../../../src/ui.cpp:1305
+#: ../../../src/ui.cpp:1364
+msgid "<b>To:</b> "
+msgstr "<b>Kam:</b> "
+
+#: ../../../src/ui.cpp:1284
+msgid " (yours, label: "
+msgstr " (jūsų, pavadinimas: "
+
+#: ../../../src/ui.cpp:1286
+msgid " (yours)"
+msgstr " (jūsų)"
+
+#: ../../../src/ui.cpp:1323
+#: ../../../src/ui.cpp:1335
+#: ../../../src/ui.cpp:1381
+#: ../../../src/ui.cpp:1398
+msgid "<b>Credit:</b> "
+msgstr "<b>Kreditas:</b> "
+
+#: ../../../src/ui.cpp:1325
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s bus galima naudoti už %d blokų)"
+
+#: ../../../src/ui.cpp:1327
+msgid "(not accepted)"
+msgstr "(nepriimta)"
+
+#: ../../../src/ui.cpp:1372
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:1395
+msgid "<b>Debit:</b> "
+msgstr "<b>Debetas:</b> "
+
+#: ../../../src/ui.cpp:1386
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Pervedimo mokestis:</b> "
+
+#: ../../../src/ui.cpp:1402
+msgid "<b>Net amount:</b> "
+msgstr "<b>Neto suma:</b> "
+
+#: ../../../src/ui.cpp:1409
+msgid "Message:"
+msgstr "Žinutė:"
+
+#: ../../../src/ui.cpp:1411
+msgid "Comment:"
+msgstr "Komentaras:"
+
+#: ../../../src/ui.cpp:1414
+msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
+msgstr "Turite palaukti 120 blokų, kol galėsite išleisti sugeneruotas monetas. Kai sugeneravotė šį blokai, jis buvo paskelbtas tinklui ir bus pridėtas į blokų grandinę. Jei šio bloko tinklas nepriims i grandinė, jis pasikeis į \"nepriimtas\" ir negali būti išleidžiamas. Tai gali kartais nutikti jei kitas nodas sugeneravo bloką keliom sekundėm anksčiau."
+
+#: ../../../src/ui.cpp:1594
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Nepavyksta įrašyti į autostart/bitcoin.desktop failą"
+
+#: ../../../src/ui.cpp:1630
+msgid "Main"
+msgstr "Pagrindinis"
+
+#: ../../../src/ui.cpp:1638
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Paleisti Bitcoin kai pasileižia operacinė sistema"
+
+#: ../../../src/ui.cpp:1645
+msgid "&Minimize on close"
+msgstr "&Sumažinti kai uždaroma"
+
+#: ../../../src/ui.cpp:1787
+#, c-format
+msgid "version %s"
+msgstr "versija %s"
+
+#: ../../../src/ui.cpp:1899
+msgid "Error in amount "
+msgstr "Klaidinga suma"
+
+#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:1944
+#: ../../../src/uibase.cpp:55
+msgid "Send Coins"
+msgstr "Siūsti monetas"
+
+#: ../../../src/ui.cpp:1904
+msgid "Amount exceeds your balance "
+msgstr "Suma viršija jūsų balasą"
+
+#: ../../../src/ui.cpp:1909
+msgid "Total exceeds your balance when the "
+msgstr "Bendra suma viršija jūsu balansą kai"
+
+#: ../../../src/ui.cpp:1909
+msgid " transaction fee is included "
+msgstr "pervedimo suma įskaičiuota"
+
+#: ../../../src/ui.cpp:1927
+msgid "Payment sent "
+msgstr "Mokestis išsiųstas"
+
+#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:1932
+#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2229
+#: ../../../src/main.cpp:3997
+msgid "Sending..."
+msgstr "Siunčia..."
+
+#: ../../../src/ui.cpp:1944
+msgid "Invalid address "
+msgstr "Klaidingas adresas"
+
+#: ../../../src/ui.cpp:1997
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Siunčia %s į %s"
+
+#: ../../../src/ui.cpp:2070
+#: ../../../src/ui.cpp:2103
+msgid "CANCELLED"
+msgstr "NUTRAUKTA"
+
+#: ../../../src/ui.cpp:2074
+msgid "Cancelled"
+msgstr "Nutraukta"
+
+#: ../../../src/ui.cpp:2076
+msgid "Transfer cancelled "
+msgstr "Siuntimas nutrauktas"
+
+#: ../../../src/ui.cpp:2129
+msgid "Error: "
+msgstr "Klaida:"
+
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2214
+#: ../../../src/main.cpp:4016
+msgid "Insufficient funds"
+msgstr "Nepakankamai monetų"
+
+#: ../../../src/ui.cpp:2148
+msgid "Connecting..."
+msgstr "Jungiasi..."
+
+#: ../../../src/ui.cpp:2153
+msgid "Unable to connect"
+msgstr "Negali prisijungti"
+
+#: ../../../src/ui.cpp:2158
+msgid "Requesting public key..."
+msgstr "Prašo \"viešojo rakto\"(public key)..."
+
+#: ../../../src/ui.cpp:2170
+msgid "Received public key..."
+msgstr "Gautas \"viešasis raktas\"(public key)..."
+
+#: ../../../src/ui.cpp:2184
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Gavėjas nepriima pervedimų siunčiamų iš IP adresų"
+
+#: ../../../src/ui.cpp:2186
+msgid "Transfer was not accepted"
+msgstr "Persiuntimas nepriimtas"
+
+#: ../../../src/ui.cpp:2195
+msgid "Invalid response received"
+msgstr "Gautas klaidingas atsakymas"
+
+#: ../../../src/ui.cpp:2210
+msgid "Creating transaction..."
+msgstr "Kuriamas pervedimas..."
+
+#: ../../../src/ui.cpp:2222
+#, c-format
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Šis pervedimas reikalauja %s mokesčio dėl jo sumos, sudėtingumo arba dėl to, kad šie pinigai buvo neseniai gauti"
+
+#: ../../../src/ui.cpp:2224
+msgid "Transaction creation failed"
+msgstr "Pervedimo sukurti nepavyko"
+
+#: ../../../src/ui.cpp:2231
+msgid "Transaction aborted"
+msgstr "Pervedimas nutrauktas"
+
+#: ../../../src/ui.cpp:2239
+msgid "Lost connection, transaction cancelled"
+msgstr "Prarastas ryšys, pervedimas nutrauktas"
+
+#: ../../../src/ui.cpp:2255
+msgid "Sending payment..."
+msgstr "Monetos siunčiamos..."
+
+#: ../../../src/ui.cpp:2261
+msgid "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."
+msgstr "Pervedimas buvo atmestas. Tai galėjo atsitikti jei dalis jūsų monetų jau buvo išleista. Pvz.: Jei nodojote kopija wallet.dat kitame kliente ir monetos buvo išleistos ten, bet nepažymėtos kaip išleistos čia."
+
+#: ../../../src/ui.cpp:2270
+msgid "Waiting for confirmation..."
+msgstr "Laukia patvirtinimo..."
+
+#: ../../../src/ui.cpp:2288
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"Pervedimas išsiūstas, bet gavėjas negalėjo jo patvirtinti.\n"
+"Pervedimas įrašytas ir suma bus kredituojama gavėjui,\n"
+"bet komentaro informacija nebus rodoma."
+
+#: ../../../src/ui.cpp:2297
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Pervedimas išsiūstas, bet klaidingas atsakymas gautas"
+
+#: ../../../src/ui.cpp:2303
+msgid "Payment completed"
+msgstr "Pervedimas pavyko"
+
+#: ../../../src/ui.cpp:2334
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
+msgid "Name"
+msgstr "Vardas"
+
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
+msgid "Address"
+msgstr "Adresas"
+
+#: ../../../src/ui.cpp:2337
+#: ../../../src/ui.cpp:2492
+msgid "Label"
+msgstr "Pavadinimas"
+
+#: ../../../src/ui.cpp:2338
+#: ../../../src/uibase.cpp:837
+msgid "Bitcoin Address"
+msgstr "Bitcoin Adresas"
+
+#: ../../../src/ui.cpp:2462
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
+msgstr "Tai vienas iš jūsų adresų priimti pervedimams ir negali būti įvestas i adresų knygą"
+
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2486
+msgid "Edit Address"
+msgstr "Pakeisti Adresą"
+
+#: ../../../src/ui.cpp:2492
+msgid "Edit Address Label"
+msgstr "Pakeisti adreso pavadinimą"
+
+#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2523
+msgid "Add Address"
+msgstr "Pridėti adresą"
+
+#: ../../../src/ui.cpp:2600
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../src/ui.cpp:2602
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - Generuoja"
+
+#: ../../../src/ui.cpp:2604
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (neprijungta)"
+
+#: ../../../src/ui.cpp:2683
+msgid "&Open Bitcoin"
+msgstr "&Atidaryti Bitcoin"
+
+#: ../../../src/ui.cpp:2684
+#, fuzzy
+msgid "&Send Bitcoins"
+msgstr "&Atidaryti Bitcoin"
+
+#: ../../../src/ui.cpp:2685
+msgid "O&ptions..."
+msgstr "P&arametrai..."
+
+#: ../../../src/ui.cpp:2688
+#: ../../../src/uibase.cpp:25
+msgid "E&xit"
+msgstr "&Išeiti"
+
+#: ../../../src/ui.cpp:2904
+msgid "Program has crashed and will terminate. "
+msgstr "Programa neveikia ir bus uždaryta"
+
+#: ../../../src/main.cpp:1866
+msgid "Warning: Disk space is low "
+msgstr "Perspėjimas: Diske trūksta vietos"
+
+#: ../../../src/main.cpp:3990
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Klaida: Šis pervedimas reikalauja %s mokesčio dėl jo sumos, sudėtingumo arba dėl to, kad šie pinigai buvo neseniai gauti "
+
+#: ../../../src/main.cpp:3992
+msgid "Error: Transaction creation failed "
+msgstr "Klaida: Pervedimo sukurti nepavyko "
+
+#: ../../../src/main.cpp:4001
+msgid "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."
+msgstr "Klaida: Pervedimas nepavyko. Tai galėjo atsitikti jei dalis jūsų monetų jau buvo išleista. Pvz.: Jei nodojote kopija wallet.dat kitame kliente ir monetos buvo išleistos ten, bet nepažymėtos kaip išleistos čia."
+
+#: ../../../src/main.cpp:4014
+msgid "Invalid amount"
+msgstr "Neteisinga suma"
+
+#: ../../../src/main.cpp:4021
+msgid "Invalid bitcoin address"
+msgstr "Klaidingas bitcoin adresas"
+
+#: ../../../src/rpc.cpp:1802
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid "To use the %s option"
+msgstr "Kad naudoti %s parametrą"
+
+#: ../../../src/rpc.cpp:1806
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Perspėjimas: %s, jūs privalote nustatyti rpcpassword=<slaptažodis>\n"
+"Konfiguracijos faile: %s\n"
+"Jei failas neegzistuoja, sukurkite jį su owner-readable-only failo teisėmis.\n"
+
+#: ../../../src/rpc.cpp:1974
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Jūs privalote nustatyti rpcpassword=<slaptažodis> Konfiguracijos faile:\n"
+"%s\n"
+"Jei failas neegzistuoja, sukurkite jį su owner-readable-only failo teisėm."
+
+#: ../../../src/util.cpp:866
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Perspėjimas: Prašome patikrinti kompiuterio laiką ir datą. Jei laikas neteisingai nustatytas, Bitcoin neveiks."
+
+#: ../../../src/util.cpp:899
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "&Byla"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "&Jūsų priimantys adresai..."
+
+#: ../../../src/uibase.cpp:36
+msgid "&Options..."
+msgstr "&Parametrai"
+
+#: ../../../src/uibase.cpp:39
+msgid "&Settings"
+msgstr "N&ustatymai"
+
+#: ../../../src/uibase.cpp:43
+msgid "&About..."
+msgstr "&О Apie..."
+
+#: ../../../src/uibase.cpp:46
+msgid "&Help"
+msgstr "&Pagalba"
+
+#: ../../../src/uibase.cpp:56
+msgid "Address Book"
+msgstr "Adresų knyga"
+
+#: ../../../src/uibase.cpp:69
+msgid "Your Bitcoin Address:"
+msgstr "Jūsų Bitcoin Adresas:"
+
+#: ../../../src/uibase.cpp:76
+msgid " &New... "
+msgstr " &Naujas... "
+
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
+msgid " &Copy to Clipboard "
+msgstr "&Kopijuoti"
+
+#: ../../../src/uibase.cpp:93
+msgid "Balance:"
+msgstr "Balansas:"
+
+#: ../../../src/uibase.cpp:109
+msgid " All"
+msgstr "Visi"
+
+#: ../../../src/uibase.cpp:109
+msgid " Sent"
+msgstr "Išsiūsta"
+
+#: ../../../src/uibase.cpp:109
+msgid " Received"
+msgstr "Priimta"
+
+#: ../../../src/uibase.cpp:109
+msgid " In Progress"
+msgstr "Progrese"
+
+#: ../../../src/uibase.cpp:130
+msgid "All Transactions"
+msgstr "Visi pervedimai"
+
+#: ../../../src/uibase.cpp:141
+msgid "Sent/Received"
+msgstr "Išsiųsti/Priimti"
+
+#: ../../../src/uibase.cpp:152
+msgid "Sent"
+msgstr "Išsiūsti"
+
+#: ../../../src/uibase.cpp:163
+msgid "Received"
+msgstr "Priimti"
+
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
+msgid "OK"
+msgstr "Gerai"
+
+#: ../../../src/uibase.cpp:345
+msgid "&Start Bitcoin on system startup"
+msgstr "&Paleisti Bitcoin kai pasileidžia operacinė sistema"
+
+#: ../../../src/uibase.cpp:348
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Sumažinti į \"tray\" vietoj \"taskbar\""
+
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Peradresuoti porta naudojant &UPnP"
+
+#: ../../../src/uibase.cpp:354
+msgid "M&inimize to the tray on close"
+msgstr "Su&mažinti į \"tray\" kai uždaroma"
+
+#: ../../../src/uibase.cpp:360
+msgid "&Connect through socks4 proxy: "
+msgstr "&Prisijungti per socks4 proksį: "
+
+#: ../../../src/uibase.cpp:371
+msgid "Proxy &IP:"
+msgstr "P&roksio IP:"
+
+#: ../../../src/uibase.cpp:379
+msgid " &Port:"
+msgstr " &Portas"
+
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Pasirintinis pervedimo mokestis per KB, kuris padeda jį ivykdyti greičiau. Dauguma pervedimų yra 1KB. Rekomencuojamas mokestis 0.01."
+
+#: ../../../src/uibase.cpp:399
+#, fuzzy
+msgid "Pay transaction fee:"
+msgstr "Pervedimo mokestis:"
+
+#: ../../../src/uibase.cpp:420
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../src/uibase.cpp:424
+msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
+msgstr ""
+
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
+msgid "Cancel"
+msgstr "Nutraukti"
+
+#: ../../../src/uibase.cpp:449
+msgid "&Apply"
+msgstr "&Nustatyti"
+
+#: ../../../src/uibase.cpp:508
+msgid "Bitcoin "
+msgstr "Bitcoin "
+
+#: ../../../src/uibase.cpp:514
+msgid "version"
+msgstr "versija"
+
+#: ../../../src/uibase.cpp:525
+#, fuzzy
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"Autorinė teisė (c) 2009-2010 Bitcoin Developers\n"
+"\n"
+"Ši programa yra eksperimentinė.\n"
+"\n"
+"Išleista ir teisės saugomos pagal MIT/X11 programų licenziją, kuri detaliau aprašyra faile \n"
+"license.txt ir http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Šis produktas turi programą iš OpenSSL projekto, kuri naudojamas \n"
+"OpenSSL Toolkit (http://www.openssl.org/), kriptografinę programą parašyta \n"
+"Eric Young (eay@cryptsoft.com) ir UPnP programą parašyta Thomas Bernard."
+
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Įveskite Bitcoin adresą (pvz.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:595
+msgid "Pay &To:"
+msgstr "&Kam:"
+
+#: ../../../src/uibase.cpp:610
+msgid "&Paste"
+msgstr "&Įrašyti"
+
+#: ../../../src/uibase.cpp:613
+msgid " Address &Book..."
+msgstr " &Adresų knyga..."
+
+#: ../../../src/uibase.cpp:620
+msgid "&Amount:"
+msgstr "S&uma:"
+
+#: ../../../src/uibase.cpp:630
+msgid "T&ransfer:"
+msgstr "&Pervedimas:"
+
+#: ../../../src/uibase.cpp:636
+msgid " Standard"
+msgstr "Standartinis"
+
+#: ../../../src/uibase.cpp:663
+msgid "&Send"
+msgstr "&Siūsti"
+
+#: ../../../src/uibase.cpp:711
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Jungiasi..."
+
+#: ../../../src/uibase.cpp:761
+msgid "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. The highlighted address is displayed in the main window."
+msgstr "Tai yra jūsų Bitcoin adresai priimti pervedimus. Galite duoti skirtinga adresa kiekvienam siuntėjui, kad žinotumėte kas jums moka. Pažymėtas adresas bus rodomas pagrindiniame lange."
+
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
+msgid "&Edit..."
+msgstr "&Pakeisti..."
+
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
+msgid " &New Address... "
+msgstr " &Naujas Adresas... "
+
+#: ../../../src/uibase.cpp:849
+msgid "Sending"
+msgstr "Siunčiama"
+
+#: ../../../src/uibase.cpp:857
+msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
+msgstr "Tai yra jūsų Bitcoin adresai priimti pervedimus. Galite duoti skirtinga adresa kiekvienam siuntėjui, kad žinotumėte kas jums moka. Pažymėtas adresas bus rodomas pagrindiniame lange."
+
+#: ../../../src/uibase.cpp:870
+msgid "Receiving"
+msgstr "Priėmimo"
+
+#: ../../../src/uibase.cpp:880
+msgid "&Delete"
+msgstr "&Ištrinti"
+
+#: ../../../src/init.cpp:142
+msgid "Bitcoin version"
+msgstr "Bitcoin version"
+
+#: ../../../src/init.cpp:143
+msgid "Usage:"
+msgstr "Komandų vartojimas:"
+
+#: ../../../src/init.cpp:145
+msgid "Send command to -server or bitcoind\n"
+msgstr "Siūsti komandą i -server arba bitcoind\n"
+
+#: ../../../src/init.cpp:146
+msgid "List commands\n"
+msgstr "Parodyti visas komandas\n"
+
+#: ../../../src/init.cpp:147
+msgid "Get help for a command\n"
+msgstr "Komandos paaiškinimas\n"
+
+#: ../../../src/init.cpp:148
+msgid "Options:\n"
+msgstr "Parametrai\n"
+
+#: ../../../src/init.cpp:149
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Nurodyti konfiguracijos failą (pagal nutylėjimą: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:150
+#, fuzzy
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Nurodyti konfiguracijos failą (pagal nutylėjimą: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:151
+msgid "Generate coins\n"
+msgstr "Generuoti monetas\n"
+
+#: ../../../src/init.cpp:152
+msgid "Don't generate coins\n"
+msgstr "Negeneruoti monetų\n"
+
+#: ../../../src/init.cpp:153
+msgid "Start minimized\n"
+msgstr "Paleisti minimizuotą klientą\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify data directory\n"
+msgstr "Nurodyti duomenų direktoriją\n"
+
+#: ../../../src/init.cpp:155
+msgid "Connect through socks4 proxy\n"
+msgstr "Prisijungti per socks4 proksį\n"
+
+#: ../../../src/init.cpp:156
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Leisti DNS lookups addnode ir connect komandoms\n"
+
+#: ../../../src/init.cpp:157
+msgid "Add a node to connect to\n"
+msgstr "Pridėti nodą prie kurio bus jungiamasi\n"
+
+#: ../../../src/init.cpp:158
+msgid "Connect only to the specified node\n"
+msgstr "Prisijungti tik prie šio nodo\n"
+
+#: ../../../src/init.cpp:159
+msgid "Don't accept connections from outside\n"
+msgstr "Neleisti prisijungti iš išorės\n"
+
+#: ../../../src/init.cpp:162
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Nenaudoti UPnP klausančio porto peradresavimui\n"
+
+#: ../../../src/init.cpp:164
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Pamėginti naudoti UPnP klausančio porto peradresavimui\n"
+
+#: ../../../src/init.cpp:167
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Mokestis per KB pridedamas prie siunčiamo pervedimo\n"
+
+#: ../../../src/init.cpp:169
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Priimti komandas iš terminalo ir JSON-RPC\n"
+
+#: ../../../src/init.cpp:172
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Paleisti daemon\n"
+
+#: ../../../src/init.cpp:174
+msgid "Use the test network\n"
+msgstr "Naudoti bandomajį tinklą\n"
+
+#: ../../../src/init.cpp:175
+msgid "Username for JSON-RPC connections\n"
+msgstr "Naudotojo vardas JSON-RPC prisijungimui\n"
+
+#: ../../../src/init.cpp:176
+msgid "Password for JSON-RPC connections\n"
+msgstr "Slaptažodis JSON-RPC prisijungimui\n"
+
+#: ../../../src/init.cpp:177
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Klausyti JSON-RPC prisijungimų ant <port> (pagal nutylėjimą: 8332)\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Leisti JSON-RPC prisijungimą iš tam tikrų IP adresų\n"
+
+#: ../../../src/init.cpp:179
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Siūsti komandas į nodą kuris yra <ip> (pagal nutylėjimą: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:180
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Nustatyti kiek raktų skaičių <n> (pagal nutylėjimą: 100)\n"
+
+#: ../../../src/init.cpp:181
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Perskanuoti blokų grandinę dėl trūkstamų pervedimų\n"
+
+#: ../../../src/init.cpp:185
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL parametrai: (aplankykite Bitcoin Wiki dėl SSL nustatymų)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Naudoti OpenSSL (https) JSON-RPC prisijungimui\n"
+
+#: ../../../src/init.cpp:187
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Serverio sertifikato failas (pagal nutylėjimą: server.cert)\n"
+
+#: ../../../src/init.cpp:188
+msgid "Server private key (default: server.pem)\n"
+msgstr "Serverio privatus raktas (pagal nutylėjimą: server.pem)\n"
+
+#: ../../../src/init.cpp:189
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Priimtinas šifras (pagal nutylėjimą: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:193
+msgid "This help message\n"
+msgstr "Ši pagalbos žinutė\n"
+
+#: ../../../src/init.cpp:330
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Neranda duomenų directorijos %s. Bitcoin programa tikriausiai jau paleista."
+
+#: ../../../src/init.cpp:356
+msgid "Error loading addr.dat \n"
+msgstr "Klaida nuskaitant addr.dat \n"
+
+#: ../../../src/init.cpp:362
+msgid "Error loading blkindex.dat \n"
+msgstr "Klaida nuskaitant blkindex.dat \n"
+
+#: ../../../src/init.cpp:369
+msgid "Error loading wallet.dat \n"
+msgstr "Klaida nuskaitant wallet.dat \n"
+
+#: ../../../src/init.cpp:449
+msgid "Invalid -proxy address"
+msgstr "Klaidingas -proxy adresas"
+
+#: ../../../src/init.cpp:472
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Klaidinga suma -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:476
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Perspėjimas: -paytxfee yra nustatyta labai aukšta suma. Ši suma bus nuskaičiuota kaip mokestis darant pervedimą"
+
+#: ../../../src/uibase.h:147
+msgid "Transaction Details"
+msgstr "Pervedimų detalės"
+
+#: ../../../src/uibase.h:199
+msgid "Options"
+msgstr "Parametrai"
+
+#: ../../../src/uibase.h:228
+msgid "About Bitcoin"
+msgstr "Apie Bitcoin"
+
+#: ../../../src/uibase.h:337
+msgid "Your Bitcoin Addresses"
+msgstr "Jūsų Bitcoin Adresas"
diff --git a/locale/nl/LC_MESSAGES/bitcoin.mo b/locale/nl/LC_MESSAGES/bitcoin.mo
index 11a547e411..c5ae8489fb 100644
--- a/locale/nl/LC_MESSAGES/bitcoin.mo
+++ b/locale/nl/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/nl/LC_MESSAGES/bitcoin.po b/locale/nl/LC_MESSAGES/bitcoin.po
index 2e30388dba..986a1e5d98 100644
--- a/locale/nl/LC_MESSAGES/bitcoin.po
+++ b/locale/nl/LC_MESSAGES/bitcoin.po
@@ -2,10 +2,11 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-26 22:02-0000\n"
-"PO-Revision-Date: 2010-05-27 19:27+0100\n"
-"Last-Translator: Xunie\n"
+"POT-Creation-Date: 2011-05-15 18:23+0100\n"
+"PO-Revision-Date: 2011-05-15 18:23+0100\n"
+"Last-Translator: Pieter Wuille <sipa@ulyssis.org>\n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -13,444 +14,365 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
-#: ../../../init.cpp:342
-msgid "Usage: bitcoin [options]"
-msgstr "Commandoregel: bitcoin [opties]"
-
-#: ../../../init.cpp:343
-msgid "Options:\n"
-msgstr "Opties:\n"
-
-#: ../../../init.cpp:344
-msgid "Generate coins\n"
-msgstr "Genereer coins\n"
-
-#: ../../../init.cpp:345
-msgid "Don't generate coins\n"
-msgstr "Genereer geen coins\n"
-
-#: ../../../init.cpp:346
-msgid "Start minimized\n"
-msgstr "Geminimaliseerd starten\n"
-
-#: ../../../init.cpp:347
-msgid "Specify data directory\n"
-msgstr "Stel datamap in\n"
-
-#: ../../../init.cpp:348
-msgid "Connect through socks4 proxy\n"
-msgstr "Verbind via socks4 proxy\n"
-
-#: ../../../init.cpp:349
-msgid "Add a node to connect to\n"
-msgstr "Voeg een node toe om mee te verbinden\n"
-
-#: ../../../init.cpp:350
-msgid "Connect only to the specified node\n"
-msgstr "Verbind alleen met deze node\n"
-
-#: ../../../init.cpp:351
-msgid "This help message\n"
-msgstr "Dit helpbericht\n"
-
-#: ../../../init.cpp:455
-msgid "Error loading addr.dat \n"
-msgstr "Fout bij laden van bestand addr.dat \n"
-
-#: ../../../init.cpp:461
-msgid "Error loading blkindex.dat \n"
-msgstr "Fout bij laden van bestand blkindex.dat \n"
-
-#: ../../../init.cpp:468
-msgid "Error loading wallet.dat \n"
-msgstr "Fout bij laden van bestand wallet.dat \n"
-
-#: ../../../init.cpp:536
-msgid "Invalid -proxy address"
-msgstr "Foutief -proxy adres"
-
-#: ../../../init.cpp:629
-msgid "Program has crashed and will terminate. "
-msgstr "Het programma is gecrasht en wordt afgesloten. "
-
-#: ../../../main.cpp:1465
-msgid "Warning: Disk space is low "
-msgstr "Waarschuwing: Weinig schijfruimte over "
-
-#: ../../../main.cpp:2994
+#: ../../../src/net.cpp:1499
#, c-format
-msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
-msgstr "Fout: Dit is een te grote transactie, die een fooi vereist van %s "
-
-#: ../../../main.cpp:2996
-msgid "Error: Transaction creation failed "
-msgstr "Fout: Aanmaken van transactie mislukt "
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Kan niet binden met poort %d op deze computer. Bitcoin draait vermoedelijk reeds."
-#: ../../../main.cpp:3001
-#: ../../../ui.cpp:1761
-#: ../../../ui.cpp:1763
-#: ../../../ui.cpp:1904
-#: ../../../ui.cpp:2053
-msgid "Sending..."
-msgstr "Versturen..."
-
-#: ../../../main.cpp:3005
-msgid "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."
-msgstr "Fout: De transactie is afgekeurd. Dit kan gebeuren als bepaalde coins in je Portefeuille al zijn uitgegeven. Dit kan veroorzaakt worden doordat je een kopie van wallet.dat gebruikt hebt en enkel daar je uitgave geregistreerd is."
-
-#: ../../../main.cpp:3017
-msgid "Invalid amount"
-msgstr "Foutieve hoeveelheid"
-
-#: ../../../main.cpp:3019
-#: ../../../ui.cpp:1971
-#: ../../../ui.cpp:2038
-msgid "Insufficient funds"
-msgstr "Onvoldoende saldo"
-
-#: ../../../main.cpp:3024
-msgid "Invalid bitcoin address"
-msgstr "Foutief bitcoin-adres"
-
-#: ../../../ui.cpp:189
+#: ../../../src/ui.cpp:202
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
msgstr "Deze transactie overschrijdt de limiet. Om de transactie alsnog te verwerken kun je een fooi betalen van %s. Deze zal betaald worden aan de node die uw transactie verwerkt. Wil je doorgaan en deze fooi betalen?"
-#: ../../../ui.cpp:285
+#: ../../../src/ui.cpp:301
msgid "Status"
msgstr "Status"
-#: ../../../ui.cpp:286
+#: ../../../src/ui.cpp:302
msgid "Date"
msgstr "Datum"
-#: ../../../ui.cpp:287
+#: ../../../src/ui.cpp:303
msgid "Description"
msgstr "Beschrijving"
-#: ../../../ui.cpp:288
+#: ../../../src/ui.cpp:304
msgid "Debit"
msgstr "Debet"
-#: ../../../ui.cpp:289
+#: ../../../src/ui.cpp:305
msgid "Credit"
msgstr "Credit"
-#: ../../../ui.cpp:489
+#: ../../../src/ui.cpp:511
#, c-format
msgid "Open for %d blocks"
msgstr "Open gedurende %d blokken"
-#: ../../../ui.cpp:491
+#: ../../../src/ui.cpp:513
#, c-format
msgid "Open until %s"
msgstr "Open tot %s"
-#: ../../../ui.cpp:497
+#: ../../../src/ui.cpp:519
#, c-format
msgid "%d/offline?"
msgstr "%d/offline?"
-#: ../../../ui.cpp:499
+#: ../../../src/ui.cpp:521
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/niet bevestigd"
-#: ../../../ui.cpp:501
+#: ../../../src/ui.cpp:523
#, c-format
msgid "%d confirmations"
msgstr "%d bevestigingen"
-#: ../../../ui.cpp:584
+#: ../../../src/ui.cpp:608
msgid "Generated"
msgstr "Gegenereerd"
-#: ../../../ui.cpp:592
+#: ../../../src/ui.cpp:616
#, c-format
msgid "Generated (%s matures in %d more blocks)"
msgstr "Gegenereerd (%s wordt volwassen over %d blokken)"
-#: ../../../ui.cpp:596
+#: ../../../src/ui.cpp:620
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
msgstr "Gegenereerd - Waarschuwing: Dit blok is niet ontvangen door andere nodes en zal waarschijnlijk niet geaccepteerd worden!"
-#: ../../../ui.cpp:600
+#: ../../../src/ui.cpp:624
msgid "Generated (not accepted)"
msgstr "Gegenereerd (niet geaccepteerd)"
-#: ../../../ui.cpp:610
+#: ../../../src/ui.cpp:634
msgid "From: "
msgstr "Van: "
-#: ../../../ui.cpp:634
+#: ../../../src/ui.cpp:658
msgid "Received with: "
msgstr "Ontvangen op: "
-#: ../../../ui.cpp:676
+#: ../../../src/ui.cpp:704
msgid "Payment to yourself"
-msgstr "Betaling naar uzelf"
+msgstr "Betaling aan uzelf"
-#: ../../../ui.cpp:713
+#: ../../../src/ui.cpp:738
msgid "To: "
msgstr "Naar: "
-#: ../../../ui.cpp:1009
+#: ../../../src/ui.cpp:1053
msgid " Generating"
msgstr " Genereren..."
-#: ../../../ui.cpp:1011
+#: ../../../src/ui.cpp:1055
msgid "(not connected)"
msgstr "(niet verbonden)"
-#: ../../../ui.cpp:1014
+#: ../../../src/ui.cpp:1058
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d verbindingen %d blokken %d transacties"
-#: ../../../ui.cpp:1123
-#: ../../../ui.cpp:2351
+#: ../../../src/ui.cpp:1163
+#: ../../../src/ui.cpp:2527
msgid "New Receiving Address"
msgstr "Nieuw Ontvangstadres"
-#: ../../../ui.cpp:1124
-#: ../../../ui.cpp:2352
+#: ../../../src/ui.cpp:1164
+#: ../../../src/ui.cpp:2528
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
-"Het is een goede gewoonte om voor iedere betaling die je ontvangt een nieuw adres aan te maken.\n"
+"Het is een goede gewoonte om voor iedere betaling die je ontvangt een nieuw adres te gebruiken.\n"
"\n"
"Label"
-#: ../../../ui.cpp:1193
+#: ../../../src/ui.cpp:1233
msgid "<b>Status:</b> "
msgstr "<b>Status:</b> "
-#: ../../../ui.cpp:1198
+#: ../../../src/ui.cpp:1238
msgid ", has not been successfully broadcast yet"
msgstr ", is nog niet succesvol verstuurd naar het netwerk"
-#: ../../../ui.cpp:1200
+#: ../../../src/ui.cpp:1240
#, c-format
msgid ", broadcast through %d node"
msgstr ", verstuurd via %d node"
-#: ../../../ui.cpp:1202
+#: ../../../src/ui.cpp:1242
#, c-format
msgid ", broadcast through %d nodes"
msgstr ", verstuurd via %d nodes"
-#: ../../../ui.cpp:1206
+#: ../../../src/ui.cpp:1246
msgid "<b>Date:</b> "
msgstr "<b>Datum:</b> "
-#: ../../../ui.cpp:1214
+#: ../../../src/ui.cpp:1254
msgid "<b>Source:</b> Generated<br>"
msgstr "<b>Bron:</b> Gegenereerd<br>"
-#: ../../../ui.cpp:1220
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1260
+#: ../../../src/ui.cpp:1278
msgid "<b>From:</b> "
msgstr "<b>Van:</b> "
-#: ../../../ui.cpp:1238
+#: ../../../src/ui.cpp:1278
msgid "unknown"
msgstr "onbekend"
-#: ../../../ui.cpp:1239
-#: ../../../ui.cpp:1263
-#: ../../../ui.cpp:1322
+#: ../../../src/ui.cpp:1279
+#: ../../../src/ui.cpp:1303
+#: ../../../src/ui.cpp:1362
msgid "<b>To:</b> "
msgstr "<b>Naar:</b> "
-#: ../../../ui.cpp:1242
+#: ../../../src/ui.cpp:1282
msgid " (yours, label: "
msgstr " (van jou, label: "
-#: ../../../ui.cpp:1244
-#, fuzzy
+#: ../../../src/ui.cpp:1284
msgid " (yours)"
msgstr " (van jou)"
-#: ../../../ui.cpp:1281
-#: ../../../ui.cpp:1293
-#: ../../../ui.cpp:1356
+#: ../../../src/ui.cpp:1321
+#: ../../../src/ui.cpp:1333
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:1396
msgid "<b>Credit:</b> "
msgstr "<b>Credit:</b>"
-#: ../../../ui.cpp:1283
+#: ../../../src/ui.cpp:1323
#, c-format
msgid "(%s matures in %d more blocks)"
msgstr "(%s wordt volwassen over %d blokken)"
-#: ../../../ui.cpp:1285
+#: ../../../src/ui.cpp:1325
msgid "(not accepted)"
msgstr "(niet geaccepteerd)"
-#: ../../../ui.cpp:1330
-#: ../../../ui.cpp:1353
+#: ../../../src/ui.cpp:1370
+#: ../../../src/ui.cpp:1378
+#: ../../../src/ui.cpp:1393
msgid "<b>Debit:</b> "
msgstr "<b>Debet:</b>"
-#: ../../../ui.cpp:1344
+#: ../../../src/ui.cpp:1384
msgid "<b>Transaction fee:</b> "
msgstr "<b>Transactiefooi:</b> "
-#: ../../../ui.cpp:1360
+#: ../../../src/ui.cpp:1400
msgid "<b>Net amount:</b> "
msgstr "<b>Nettobedrag:</b> "
-#: ../../../ui.cpp:1367
+#: ../../../src/ui.cpp:1407
msgid "Message:"
msgstr "Mededeling:"
-#: ../../../ui.cpp:1370
+#: ../../../src/ui.cpp:1409
+msgid "Comment:"
+msgstr "Commentaar:"
+
+#: ../../../src/ui.cpp:1412
msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
msgstr "Gegenereerde coins mogen pas na een wachttijd van 120 blokken uitgegeven worden. Op het moment dat dit blok gegenereerd werd, is het naar het netwerk verzonden om aan de blokkenreeks toegevoegd te worden. Als het niet succesvol in de blokkenreeks opgenomen kan worden verandert de status in \"niet geaccepteerd\" en kan het niet uitegegeven worden. Dit kan soms gebeuren als een andere node op ongeveer hetzelfde moment een blok genereert."
-#: ../../../ui.cpp:1437
+#: ../../../src/ui.cpp:1592
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Kan niet schrijven naar het bestand autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1628
msgid "Main"
msgstr "Algemeen"
-#: ../../../ui.cpp:1442
+#: ../../../src/ui.cpp:1636
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Start Bitcoin wanneer het systeem opstart"
+
+#: ../../../src/ui.cpp:1643
msgid "&Minimize on close"
msgstr "&Minimaliseer bij sluiten van het venster"
-#: ../../../ui.cpp:1595
+#: ../../../src/ui.cpp:1785
#, c-format
-msgid "version %s%s BETA"
-msgstr "versie %s%s BETA"
-
-#: ../../../ui.cpp:1681
-msgid "Will appear as \"From: Unknown\""
-msgstr "Wordt weergegeven als \"Van: Onbekend\""
-
-#: ../../../ui.cpp:1681
-msgid "n/a"
-msgstr "Onbekend"
+msgid "version %s"
+msgstr "versie %s"
-#: ../../../ui.cpp:1681
-msgid "Unknown"
-msgstr "Onbekend"
-
-#: ../../../ui.cpp:1682
-msgid "Can't include a message when sending to a Bitcoin address"
-msgstr "Kan geen mededeling bijvoegen bij gebruik van bitcoin-adressen"
-
-#: ../../../ui.cpp:1735
+#: ../../../src/ui.cpp:1897
msgid "Error in amount "
msgstr "Fout in hoeveelheid "
-#: ../../../ui.cpp:1735
-#: ../../../ui.cpp:1740
-#: ../../../ui.cpp:1745
-#: ../../../ui.cpp:1771
-#: ../../../uibase.cpp:61
+#: ../../../src/ui.cpp:1897
+#: ../../../src/ui.cpp:1902
+#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:1942
+#: ../../../src/uibase.cpp:55
msgid "Send Coins"
msgstr "Verstuur coins"
-#: ../../../ui.cpp:1740
+#: ../../../src/ui.cpp:1902
msgid "Amount exceeds your balance "
msgstr "Hoeveelheid overschrijdt uw huidige balans "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:1907
msgid "Total exceeds your balance when the "
msgstr "Totaal overschrijdt uw huidige balans wanneer de "
-#: ../../../ui.cpp:1745
+#: ../../../src/ui.cpp:1907
msgid " transaction fee is included "
msgstr " transactiefooi is meegerekend "
-#: ../../../ui.cpp:1761
+#: ../../../src/ui.cpp:1925
msgid "Payment sent "
msgstr "Betaling verzonden "
-#: ../../../ui.cpp:1771
+#: ../../../src/ui.cpp:1925
+#: ../../../src/ui.cpp:1930
+#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2227
+#: ../../../src/main.cpp:3999
+msgid "Sending..."
+msgstr "Versturen..."
+
+#: ../../../src/ui.cpp:1942
msgid "Invalid address "
msgstr "Foutief adres "
-#: ../../../ui.cpp:1825
+#: ../../../src/ui.cpp:1995
#, c-format
msgid "Sending %s to %s"
msgstr "%s versturen naar %s"
-#: ../../../ui.cpp:1898
-#: ../../../ui.cpp:1931
+#: ../../../src/ui.cpp:2068
+#: ../../../src/ui.cpp:2101
msgid "CANCELLED"
msgstr "GEANNULEERD"
-#: ../../../ui.cpp:1902
+#: ../../../src/ui.cpp:2072
msgid "Cancelled"
msgstr "Geannuleerd"
-#: ../../../ui.cpp:1904
+#: ../../../src/ui.cpp:2074
msgid "Transfer cancelled "
msgstr "Transactie geannuleerd "
-#: ../../../ui.cpp:1957
+#: ../../../src/ui.cpp:2127
msgid "Error: "
msgstr "Fout: "
-#: ../../../ui.cpp:1976
+#: ../../../src/ui.cpp:2141
+#: ../../../src/ui.cpp:2212
+#: ../../../src/main.cpp:4018
+msgid "Insufficient funds"
+msgstr "Onvoldoende saldo"
+
+#: ../../../src/ui.cpp:2146
msgid "Connecting..."
msgstr "Verbinden..."
-#: ../../../ui.cpp:1981
+#: ../../../src/ui.cpp:2151
msgid "Unable to connect"
msgstr "Kan niet verbinden"
-#: ../../../ui.cpp:1986
+#: ../../../src/ui.cpp:2156
msgid "Requesting public key..."
msgstr "Aanvragen van publieke sleutel..."
-#: ../../../ui.cpp:1998
+#: ../../../src/ui.cpp:2168
msgid "Received public key..."
msgstr "Publieke sleutel ontvangen..."
-#: ../../../ui.cpp:2010
+#: ../../../src/ui.cpp:2182
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Ontvanger aanvaardt geen transacties via IP adres"
+
+#: ../../../src/ui.cpp:2184
msgid "Transfer was not accepted"
msgstr "Transactie niet geaccepteerd"
-#: ../../../ui.cpp:2019
+#: ../../../src/ui.cpp:2193
msgid "Invalid response received"
msgstr "Foutief antwoord ontvangen"
-#: ../../../ui.cpp:2034
+#: ../../../src/ui.cpp:2208
msgid "Creating transaction..."
msgstr "Transactie aanmaken..."
-#: ../../../ui.cpp:2046
+#: ../../../src/ui.cpp:2220
#, c-format
-msgid "This is an oversized transaction that requires a transaction fee of %s"
-msgstr "Fout: Dit is een te grote transactie, die een fooi vereist van %s"
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Deze transactie vergt een fooi van ten minste %s omwille van zijn bedrag, complexiteit, of gebruik van recent ontvangen fonden"
-#: ../../../ui.cpp:2048
+#: ../../../src/ui.cpp:2222
msgid "Transaction creation failed"
msgstr "Aanmaken van transactie mislukt"
-#: ../../../ui.cpp:2055
+#: ../../../src/ui.cpp:2229
msgid "Transaction aborted"
msgstr "Transactie geannuleerd"
-#: ../../../ui.cpp:2063
+#: ../../../src/ui.cpp:2237
msgid "Lost connection, transaction cancelled"
msgstr "Verbinding verloren, transactie geannuleerd"
-#: ../../../ui.cpp:2079
+#: ../../../src/ui.cpp:2253
msgid "Sending payment..."
msgstr "Betaling versturen..."
-#: ../../../ui.cpp:2085
+#: ../../../src/ui.cpp:2259
msgid "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."
msgstr "Fout: De transactie is afgekeurd. Dit kan gebeuren als bepaalde coins in je Portefeuille al zijn uitgegeven. Dit kan veroorzaakt worden doordat je een kopie van wallet.dat gebruikt hebt en enkel daar je uitgave geregistreerd is."
-#: ../../../ui.cpp:2092
+#: ../../../src/ui.cpp:2268
msgid "Waiting for confirmation..."
msgstr "Wachten op bevestiging..."
-#: ../../../ui.cpp:2110
+#: ../../../src/ui.cpp:2286
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
@@ -460,244 +382,305 @@ msgstr ""
"De transactie is opgenomen en wordt uitbetaald aan de ontvanger,\n"
"maar het mededelings-veld blijft blanco."
-#: ../../../ui.cpp:2119
+#: ../../../src/ui.cpp:2295
msgid "Payment was sent, but an invalid response was received"
msgstr "Betaling is verstuurd, maar een foutief antword is ontvangen."
-#: ../../../ui.cpp:2125
+#: ../../../src/ui.cpp:2301
msgid "Payment completed"
msgstr "Betaling voltooid"
-#: ../../../ui.cpp:2156
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2332
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Name"
msgstr "Naam"
-#: ../../../ui.cpp:2157
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2339
+#: ../../../src/ui.cpp:2333
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Address"
msgstr "Adres"
-#: ../../../ui.cpp:2159
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2490
msgid "Label"
msgstr "Label"
-#: ../../../ui.cpp:2160
-#: ../../../uibase.cpp:908
+#: ../../../src/ui.cpp:2336
+#: ../../../src/uibase.cpp:837
msgid "Bitcoin Address"
msgstr "Bitcoin-adres"
-#: ../../../ui.cpp:2284
+#: ../../../src/ui.cpp:2460
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Dit is een van uw eigen adressen voor het ontvangen van betalingen, en kan niet worden toegevoegd aan uw adresboek. "
-#: ../../../ui.cpp:2302
-#: ../../../ui.cpp:2308
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2484
msgid "Edit Address"
msgstr "Bewerk adres"
-#: ../../../ui.cpp:2314
+#: ../../../src/ui.cpp:2490
msgid "Edit Address Label"
msgstr "Bewerk adreslabel"
-#: ../../../ui.cpp:2339
-#: ../../../ui.cpp:2345
+#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2521
msgid "Add Address"
msgstr "Adres toevoegen"
-#: ../../../ui.cpp:2421
+#: ../../../src/ui.cpp:2598
msgid "Bitcoin"
msgstr "Bitcoin"
-#: ../../../ui.cpp:2423
+#: ../../../src/ui.cpp:2600
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Genereren..."
-#: ../../../ui.cpp:2425
+#: ../../../src/ui.cpp:2602
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (niet verbonden)"
-#: ../../../ui.cpp:2500
+#: ../../../src/ui.cpp:2681
msgid "&Open Bitcoin"
msgstr "&Open Bitcoin"
-#: ../../../ui.cpp:2501
+#: ../../../src/ui.cpp:2682
+msgid "&Send Bitcoins"
+msgstr "&Verstuur Bitcoins"
+
+#: ../../../src/ui.cpp:2683
msgid "O&ptions..."
msgstr "O&pties"
-#: ../../../ui.cpp:2502
-#: ../../../uibase.cpp:34
-msgid "&Generate Coins"
-msgstr "&Genereer coins"
-
-#: ../../../ui.cpp:2505
-#: ../../../uibase.cpp:27
+#: ../../../src/ui.cpp:2686
+#: ../../../src/uibase.cpp:25
msgid "E&xit"
msgstr "A&fsluiten"
-#: ../../../uibase.cpp:30
+#: ../../../src/ui.cpp:2902
+msgid "Program has crashed and will terminate. "
+msgstr "Het programma is gecrasht en wordt afgesloten. "
+
+#: ../../../src/main.cpp:1868
+msgid "Warning: Disk space is low "
+msgstr "Waarschuwing: Weinig schijfruimte over "
+
+#: ../../../src/main.cpp:3992
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Fout: Deze transactie vergt een fooi van ten minste %s omwille van zijn bedrag, complexiteit, of gebruik van recent ontvangen fonden "
+
+#: ../../../src/main.cpp:3994
+msgid "Error: Transaction creation failed "
+msgstr "Fout: Aanmaken van transactie mislukt "
+
+#: ../../../src/main.cpp:4003
+msgid "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."
+msgstr "Fout: De transactie is afgekeurd. Dit kan gebeuren als bepaalde coins in je Portefeuille al zijn uitgegeven. Dit kan veroorzaakt worden doordat je een kopie van wallet.dat gebruikt hebt en enkel daar je uitgave geregistreerd is."
+
+#: ../../../src/main.cpp:4016
+msgid "Invalid amount"
+msgstr "Foutieve hoeveelheid"
+
+#: ../../../src/main.cpp:4023
+msgid "Invalid bitcoin address"
+msgstr "Foutief bitcoin-adres"
+
+#: ../../../src/rpc.cpp:1800
+#: ../../../src/rpc.cpp:1802
+#, c-format
+msgid "To use the %s option"
+msgstr "Om de %s optie te gebruiken"
+
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Waarschuwing: %s, rpcpassword=<password> moet ingesteld zijn\n"
+"in het configuratie bestand: %s\n"
+"Als het bestand nog niet bestaat, maak het dan aan met enkel-leesbaar-door-eigenaar rechten.\n"
+
+
+#: ../../../src/rpc.cpp:1972
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"rpcpassword=<password> moet ingesteld in het configuratie bestand:\n"
+"%s\n"
+"Als het bestand nog niet bestaat, maak het dan aan met enkel-leesbaar-door-eigenaar rechten."
+
+#: ../../../src/util.cpp:865
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Waarschuwing: Controleer of uw computers datum en tijd correct ingesteld zijn. Als uw klok fout staat zal Bitcoin niet correct werken."
+
+#: ../../../src/util.cpp:898
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
msgid "&File"
msgstr "&Bestand"
-#: ../../../uibase.cpp:38
+#: ../../../src/uibase.cpp:32
msgid "&Your Receiving Addresses..."
msgstr "&Uw ontvangstadressen..."
-#: ../../../uibase.cpp:42
+#: ../../../src/uibase.cpp:36
msgid "&Options..."
msgstr "&Opties..."
-#: ../../../uibase.cpp:45
+#: ../../../src/uibase.cpp:39
msgid "&Settings"
msgstr "&Eigenschappen"
-#: ../../../uibase.cpp:49
+#: ../../../src/uibase.cpp:43
msgid "&About..."
msgstr "&Over..."
-#: ../../../uibase.cpp:52
+#: ../../../src/uibase.cpp:46
msgid "&Help"
msgstr "&Help"
-#: ../../../uibase.cpp:62
+#: ../../../src/uibase.cpp:56
msgid "Address Book"
msgstr "Adresboek"
-#: ../../../uibase.cpp:77
+#: ../../../src/uibase.cpp:69
msgid "Your Bitcoin Address:"
msgstr "Uw bitcoin-adres:"
-#: ../../../uibase.cpp:84
+#: ../../../src/uibase.cpp:76
msgid " &New... "
msgstr " &Nieuw... "
-#: ../../../uibase.cpp:87
-#: ../../../uibase.cpp:851
-#: ../../../uibase.cpp:954
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
msgid " &Copy to Clipboard "
msgstr " &Kopieer naar plakbord "
-#: ../../../uibase.cpp:102
+#: ../../../src/uibase.cpp:93
msgid "Balance:"
msgstr "Balans:"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " All"
msgstr " Alles"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " Sent"
msgstr " Verstuurd"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " Received"
msgstr " Ontvangen"
-#: ../../../uibase.cpp:121
+#: ../../../src/uibase.cpp:109
msgid " In Progress"
msgstr " Wordt verwerkt"
-#: ../../../uibase.cpp:142
+#: ../../../src/uibase.cpp:130
msgid "All Transactions"
msgstr "Alle transacties"
-#: ../../../uibase.cpp:153
+#: ../../../src/uibase.cpp:141
msgid "Sent/Received"
msgstr "Verstuurd/Ontvangen"
-#: ../../../uibase.cpp:164
+#: ../../../src/uibase.cpp:152
msgid "Sent"
msgstr "Verstuurd"
-#: ../../../uibase.cpp:175
+#: ../../../src/uibase.cpp:163
msgid "Received"
msgstr "Ontvangen"
-#: ../../../uibase.cpp:318
-#: ../../../uibase.cpp:479
-#: ../../../uibase.cpp:580
-#: ../../../uibase.cpp:793
-#: ../../../uibase.cpp:854
-#: ../../../uibase.cpp:963
-#: ../../../uibase.cpp:1052
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
msgid "OK"
msgstr "OK"
-#: ../../../uibase.cpp:361
-msgid "Optional transaction fee you give to the nodes that process your transactions."
-msgstr "Optionele transactiefooi die u geeft aan de nodes die uw transacties verwerken."
-
-#: ../../../uibase.cpp:370
-msgid "Transaction fee:"
-msgstr "Transactiefooi:"
-
-#: ../../../uibase.cpp:386
-msgid "&Limit coin generation to"
-msgstr "&Limiteer coin-generatie tot"
-
-#: ../../../uibase.cpp:393
-msgid "processors"
-msgstr "processors"
-
-#: ../../../uibase.cpp:399
+#: ../../../src/uibase.cpp:345
msgid "&Start Bitcoin on system startup"
msgstr "&Start Bitcoin wanneer het systeem opstart"
-#: ../../../uibase.cpp:403
+#: ../../../src/uibase.cpp:348
msgid "&Minimize to the tray instead of the taskbar"
msgstr "&Minimaliseer tot systeemvak in plaats van de taakbalk"
-#: ../../../uibase.cpp:407
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Portmapping via &UPnP"
+
+#: ../../../src/uibase.cpp:354
msgid "M&inimize to the tray on close"
msgstr "M&inimaliseer tot taakbalk bij sluiten"
-#: ../../../uibase.cpp:414
+#: ../../../src/uibase.cpp:360
msgid "&Connect through socks4 proxy: "
msgstr "&Verbind via socks4 proxy: "
-#: ../../../uibase.cpp:426
+#: ../../../src/uibase.cpp:371
msgid "Proxy &IP:"
msgstr "Proxy &IP:"
-#: ../../../uibase.cpp:434
+#: ../../../src/uibase.cpp:379
msgid " &Port:"
msgstr " &Poort:"
-#: ../../../uibase.cpp:456
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Optionele transactiefooi per KB die helpt ervoor zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1KB. Fooi 0.01 is aangeraden."
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Transactiefooi:"
+
+#: ../../../src/uibase.cpp:420
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
-#: ../../../uibase.cpp:460
+#: ../../../src/uibase.cpp:424
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
-#: ../../../uibase.cpp:482
-#: ../../../uibase.cpp:735
-#: ../../../uibase.cpp:798
-#: ../../../uibase.cpp:857
-#: ../../../uibase.cpp:966
-#: ../../../uibase.cpp:1055
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
msgid "Cancel"
msgstr "Annuleren"
-#: ../../../uibase.cpp:485
+#: ../../../src/uibase.cpp:449
msgid "&Apply"
msgstr "&Toepassen"
-#: ../../../uibase.cpp:546
+#: ../../../src/uibase.cpp:508
msgid "Bitcoin "
msgstr "Bitcoin "
-#: ../../../uibase.cpp:552
+#: ../../../src/uibase.cpp:514
msgid "version"
msgstr "versie"
-#: ../../../uibase.cpp:563
+#: ../../../src/uibase.cpp:525
msgid ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -720,47 +703,39 @@ msgstr ""
"software geschreven door Eric Young (eay@cryptsoft.com)) en UPnP software geschreven\n"
"door Thomas Bernard."
-#: ../../../uibase.cpp:619
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
-msgstr "Voer een bitcoin-adres (bijvoorbeeld: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) of IP-adres (bijvoorbeeld: 123.45.6.7) in."
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Voer een bitcoin-adres (bijvoorbeeld: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-#: ../../../uibase.cpp:633
+#: ../../../src/uibase.cpp:595
msgid "Pay &To:"
msgstr "Betaal &aan:"
-#: ../../../uibase.cpp:648
+#: ../../../src/uibase.cpp:610
msgid "&Paste"
msgstr "&Plakken"
-#: ../../../uibase.cpp:651
+#: ../../../src/uibase.cpp:613
msgid " Address &Book..."
msgstr " Adres&boek..."
-#: ../../../uibase.cpp:658
+#: ../../../src/uibase.cpp:620
msgid "&Amount:"
msgstr "&Hoeveelheid:"
-#: ../../../uibase.cpp:668
+#: ../../../src/uibase.cpp:630
msgid "T&ransfer:"
msgstr "O&verdracht:"
-#: ../../../uibase.cpp:674
+#: ../../../src/uibase.cpp:636
msgid " Standard"
msgstr " Standaard"
-#: ../../../uibase.cpp:696
-msgid "&From:"
-msgstr "&Van:"
-
-#: ../../../uibase.cpp:713
-msgid "&Message:"
-msgstr "&Mededeling:"
-
-#: ../../../uibase.cpp:730
+#: ../../../src/uibase.cpp:663
msgid "&Send"
msgstr "&Versturen"
-#: ../../../uibase.cpp:782
+#: ../../../src/uibase.cpp:711
msgid ""
"\n"
"\n"
@@ -770,48 +745,229 @@ msgstr ""
"\n"
"Verbinden..."
-#: ../../../uibase.cpp:832
+#: ../../../src/uibase.cpp:761
msgid "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. The highlighted address is displayed in the main window."
msgstr "Dit zijn je bitcoin-adressen voor het ontvangen van betalingen. Het is een goed idee iedere afzender een ander adres te geven zodat je bij kunt houden wie je een betaling stuurt. Het geselecteerde adres is zichtbaar in het hoofdscherm."
-#: ../../../uibase.cpp:845
-#: ../../../uibase.cpp:957
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
msgid "&Edit..."
msgstr "&Bewerken..."
-#: ../../../uibase.cpp:848
-#: ../../../uibase.cpp:960
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
msgid " &New Address... "
msgstr " &Nieuw adres... "
-#: ../../../uibase.cpp:920
+#: ../../../src/uibase.cpp:849
msgid "Sending"
msgstr "Versturen..."
-#: ../../../uibase.cpp:928
+#: ../../../src/uibase.cpp:857
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
msgstr "Dit zijn je bitcoin-adressen voor het ontvangen van betalingen. Het is een goed idee iedere afzender een ander adres te geven zodat je bij kunt houden wie je een betaling stuurt. Het geselecteerde adres is zichtbaar in het hoofdscherm."
-#: ../../../uibase.cpp:941
+#: ../../../src/uibase.cpp:870
msgid "Receiving"
msgstr "Ontvangen..."
-#: ../../../uibase.cpp:951
+#: ../../../src/uibase.cpp:880
msgid "&Delete"
msgstr "&Verwijderen"
-#: ../../../uibase.h:150
+#: ../../../src/init.cpp:147
+msgid "Bitcoin version"
+msgstr "Bitcoin "
+
+#: ../../../src/init.cpp:148
+msgid "Usage:"
+msgstr "Mededeling:"
+
+#: ../../../src/init.cpp:150
+msgid "Send command to -server or bitcoind\n"
+msgstr "Zend commando naar -server of bitcoind\n"
+
+#: ../../../src/init.cpp:151
+msgid "List commands\n"
+msgstr "List van commando's\n"
+
+#: ../../../src/init.cpp:152
+msgid "Get help for a command\n"
+msgstr "Toon hulp voor een commando\n"
+
+#: ../../../src/init.cpp:153
+msgid "Options:\n"
+msgstr "Opties:\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Specifieer configuratiebestand (standaard: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:155
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Specifieer pid-bestand (standaard: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:156
+msgid "Generate coins\n"
+msgstr "Genereer coins\n"
+
+#: ../../../src/init.cpp:157
+msgid "Don't generate coins\n"
+msgstr "Genereer geen coins\n"
+
+#: ../../../src/init.cpp:158
+msgid "Start minimized\n"
+msgstr "Geminimaliseerd starten\n"
+
+#: ../../../src/init.cpp:159
+msgid "Specify data directory\n"
+msgstr "Stel datamap in\n"
+
+#: ../../../src/init.cpp:161
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Gelieve de time-out tijd te specifieren (in milliseconden)\n"
+
+#: ../../../src/init.cpp:160
+msgid "Connect through socks4 proxy\n"
+msgstr "Verbind via socks4 proxy\n"
+
+#: ../../../src/init.cpp:161
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Sta DNS-opzoeking toe voor addnode en connect\n"
+
+#: ../../../src/init.cpp:162
+msgid "Add a node to connect to\n"
+msgstr "Voeg een node toe om mee te verbinden\n"
+
+#: ../../../src/init.cpp:163
+msgid "Connect only to the specified node\n"
+msgstr "Verbind alleen met deze node\n"
+
+#: ../../../src/init.cpp:164
+msgid "Don't accept connections from outside\n"
+msgstr "Sta geen verbindingen van buitenaf toe\n"
+
+#: ../../../src/init.cpp:167
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Probeer geen UPnP te gebruiken om de poort waarop geluisterd wordt te mappen\n"
+
+#: ../../../src/init.cpp:169
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Probeer UPnP te gebruiken om de poort waarop geluisterd wordt te mappen\n"
+
+#: ../../../src/init.cpp:172
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Fooi per KB om aan transacties die gezonden worden toe te voegen\n"
+
+#: ../../../src/init.cpp:174
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Aanvaard commandolijn en JSON-RPC commando's\n"
+
+#: ../../../src/init.cpp:177
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Draai in de achtergrond als daemon en aanvaard commando's\n"
+
+#: ../../../src/init.cpp:179
+msgid "Use the test network\n"
+msgstr "Gebruik het test-netwerk\n"
+
+#: ../../../src/init.cpp:180
+msgid "Username for JSON-RPC connections\n"
+msgstr "Gebruikersnaam voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:181
+msgid "Password for JSON-RPC connections\n"
+msgstr "Wachtwoord voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:182
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Luister voor JSON-RPC verbindingen op <poort> (standaard: 8332)\n"
+
+#: ../../../src/init.cpp:183
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Enkel JSON-RPC verbindingen van opgegeven IP adres toestaan\n"
+
+#: ../../../src/init.cpp:184
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Zend commando's naar proces dat op <ip> draait (standaard: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:185
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Stel sleutelpoelgrootte in op <n> (standaard: 100)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Doorzoek de blokken database voor ontbrekende portefeuille-transacties\n"
+
+#: ../../../src/init.cpp:190
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL opties: (zie de Bitcoin wiki voor SSL instructies)\n"
+
+#: ../../../src/init.cpp:191
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Gebruik OpenSSL (https) voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:192
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Certificaat-bestand voor server (standaard: server.cert)\n"
+
+#: ../../../src/init.cpp:193
+msgid "Server private key (default: server.pem)\n"
+msgstr "Geheime sleutel voor server (standaard: server.pem)\n"
+
+#: ../../../src/init.cpp:194
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Aanvaardbare ciphers (standaard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:198
+msgid "This help message\n"
+msgstr "Dit helpbericht\n"
+
+#: ../../../src/init.cpp:335
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Kan geen lock op de gegevensdirectory %s verkrijgen. Bitcoin draait vermoedelijk reeds."
+
+#: ../../../src/init.cpp:361
+msgid "Error loading addr.dat \n"
+msgstr "Fout bij laden van bestand addr.dat \n"
+
+#: ../../../src/init.cpp:367
+msgid "Error loading blkindex.dat \n"
+msgstr "Fout bij laden van bestand blkindex.dat \n"
+
+#: ../../../src/init.cpp:374
+msgid "Error loading wallet.dat \n"
+msgstr "Fout bij laden van bestand wallet.dat \n"
+
+#: ../../../src/init.cpp:454
+msgid "Invalid -proxy address"
+msgstr "Foutief -proxy adres"
+
+#: ../../../src/init.cpp:477
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Ongeldig bedrag voor -paytxfee=<bedrag>"
+
+#: ../../../src/init.cpp:481
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Waarschuwing: -paytxfee is zeer hoog ingesteld. Dit is de fooi die betaald wordt bij het zenden van een transactie."
+
+#: ../../../src/uibase.h:147
msgid "Transaction Details"
msgstr "Transactiedetails"
-#: ../../../uibase.h:203
+#: ../../../src/uibase.h:199
msgid "Options"
msgstr "Opties"
-#: ../../../uibase.h:231
+#: ../../../src/uibase.h:228
msgid "About Bitcoin"
msgstr "Over Bitcoin"
-#: ../../../uibase.h:341
+#: ../../../src/uibase.h:337
msgid "Your Bitcoin Addresses"
msgstr "Uw bitcoin-adressen"
diff --git a/locale/pl/LC_MESSAGES/bitcoin.po b/locale/pl/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..7c177b82de
--- /dev/null
+++ b/locale/pl/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,1082 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Bitcoin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-07-14 18:55+0100\n"
+"PO-Revision-Date: \n"
+"Last-Translator: Dawid Spiechowicz <spiechu@gmail.com>\n"
+"Language-Team: Spiechu <spiechu@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: \n"
+"X-Poedit-Language: Polish\n"
+"X-Poedit-Country: POLAND\n"
+"X-Poedit-SourceCharset: utf-8\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/net.cpp:1615
+#, c-format
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Nie można powiązać z portem %d tego komputera. Prawdopodobnie program Bitcoin jest już uruchomiony."
+
+#: ../../../src/init.cpp:162
+msgid "Bitcoin version"
+msgstr "Wersja Bitcoin"
+
+#: ../../../src/init.cpp:163
+msgid "Usage:"
+msgstr "Użycie:"
+
+#: ../../../src/init.cpp:165
+msgid "Send command to -server or bitcoind\n"
+msgstr "Wyślij polecenie do -server lub bitcoind\n"
+
+#: ../../../src/init.cpp:166
+msgid "List commands\n"
+msgstr "Wyświetl komendy\n"
+
+#: ../../../src/init.cpp:167
+msgid "Get help for a command\n"
+msgstr "Wyświetl pomoc dla komendy\n"
+
+#: ../../../src/init.cpp:168
+msgid "Options:\n"
+msgstr "Opcje:\n"
+
+#: ../../../src/init.cpp:169
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Określ plik konfiguracyjny (domyślnie: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Wybierz plik pid (domyślnie: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:171
+msgid "Generate coins\n"
+msgstr "Generuj monety\n"
+
+#: ../../../src/init.cpp:172
+msgid "Don't generate coins\n"
+msgstr "Nie generuj monet\n"
+
+#: ../../../src/init.cpp:173
+msgid "Start minimized\n"
+msgstr "Uruchom zminimalizowany\n"
+
+#: ../../../src/init.cpp:174
+msgid "Specify data directory\n"
+msgstr "Wybierz katalog z danymi\n"
+
+#: ../../../src/init.cpp:175
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Ustaw czas upływu połączenia (w milisekundach)\n"
+
+#: ../../../src/init.cpp:176
+msgid "Connect through socks4 proxy\n"
+msgstr "Połącz przez socks4 proxy\n"
+
+#: ../../../src/init.cpp:177
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Umożliwiaj wyszukiwanie DNS dla dodania węzła i połączenia\n"
+
+#: ../../../src/init.cpp:178
+msgid "Add a node to connect to\n"
+msgstr "Dodaj węzeł do którego połączyć\n"
+
+#: ../../../src/init.cpp:179
+msgid "Connect only to the specified node\n"
+msgstr "Łącz tylko z wybranym węzłem\n"
+
+#: ../../../src/init.cpp:180
+msgid "Don't accept connections from outside\n"
+msgstr "Nie akceptuj połączeń z zewnątrz\n"
+
+#: ../../../src/init.cpp:183
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Nie próbuj użyć UPnP dla mapowania portu nasłuchu\n"
+
+#: ../../../src/init.cpp:185
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Próbuj użyć UPnP dla mapowania portu nasłuchu\n"
+
+#: ../../../src/init.cpp:188
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Prowizja na KB dodawana do transakcji, które wysyłasz\n"
+
+#: ../../../src/init.cpp:190
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Akceptuj polecenia linii poleceń i JSON-RPC\n"
+
+#: ../../../src/init.cpp:193
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Uruchom w tle (daemon) i akceptuj komendy\n"
+
+#: ../../../src/init.cpp:195
+msgid "Use the test network\n"
+msgstr "Użyj sieci testowej\n"
+
+#: ../../../src/init.cpp:196
+msgid "Username for JSON-RPC connections\n"
+msgstr "Nazwa użytkownika dla połączeń JSON-RPC\n"
+
+#: ../../../src/init.cpp:197
+msgid "Password for JSON-RPC connections\n"
+msgstr "Hasło dla połączeń JSON-RPC\n"
+
+#: ../../../src/init.cpp:198
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Nasłuch dla połączeń JSON-RPC na porcie <port> (domyślnie: 8332)\n"
+
+#: ../../../src/init.cpp:199
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Zezwól na połączenia JSON-RPC z adresu IP\n"
+
+#: ../../../src/init.cpp:200
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Wysyłaj polecenia do węzła działającego na <ip> (domyślnie: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:201
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Ustaw pulę kluczy na <n> (domyślnie: 100)\n"
+
+#: ../../../src/init.cpp:202
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Przeszukaj łańcuch bloków w poszukiwaniu zaginionych transakcji\n"
+
+#: ../../../src/init.cpp:206
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"Opcje SSL: (zobacz instrukcje na Bitcoin Wiki dla ustawień SSL)\n"
+
+#: ../../../src/init.cpp:207
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Użyj OpenSSL (https) dla połączeń JSON-RPC\n"
+
+#: ../../../src/init.cpp:208
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Plik certyfikacji serwera (domyślnie: server.cert)\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server private key (default: server.pem)\n"
+msgstr "Klucz prywatny serwera (domyślnie: server.pem)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Akceptowalne szyfry (domyślnie: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:214
+msgid "This help message\n"
+msgstr "Ta wiadomość pomocy\n"
+
+#: ../../../src/init.cpp:351
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Nie można korzystać z katalogu %s z danymi. Bitcoin prawdopodobnie już jest uruchomiony."
+
+#: ../../../src/init.cpp:377
+msgid "Error loading addr.dat \n"
+msgstr "Błąd ładowania addr.dat \n"
+
+#: ../../../src/init.cpp:383
+msgid "Error loading blkindex.dat \n"
+msgstr "Błąd ładowania blkindex.dat \n"
+
+#: ../../../src/init.cpp:394
+msgid "Error loading wallet.dat: Wallet corrupted \n"
+msgstr "Błąd ładowania wallet.dat: Portfel uszkodzony \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin \n"
+msgstr "Błąd ładowania wallet.dat: Portfel wymaga nowszej wersji Bitcoin \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat \n"
+msgstr "Błąd ładowania wallet.dat \n"
+
+#: ../../../src/init.cpp:488
+msgid "Invalid -proxy address"
+msgstr "Niewłaściwy adres -proxy"
+
+#: ../../../src/init.cpp:513
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Nieprawidłowa kwota w -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:517
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Ostrzeżenie: ustawienie -paytxfee jest bardzo wysokie. To jest prowizja transakcji, którą zapłacisz jeżeli wyślesz transakcję."
+
+#: ../../../src/rpc.cpp:2100
+#: ../../../src/rpc.cpp:2102
+#, c-format
+msgid "To use the %s option"
+msgstr "Użycie opcji %s"
+
+#: ../../../src/rpc.cpp:2104
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Ostrzeżenie: %s, musisz ustawić rpcpassword=<password>\n"
+"w pliku konfiguracyjnym: %s\n"
+"Jeżeli plik nie istnieje, utwórz go z uprawnieniami tylko do odczytu dla właściciela.\n"
+
+#: ../../../src/rpc.cpp:2277
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Musisz ustawić rpcpassword=<password> w pliku konfiguracyjnym:\n"
+"%s\n"
+"Jeżeli plik nie istnieje, utwórz go z uprawnieniami tylko do odczytu dla właściciela."
+
+#: ../../../src/util.cpp:869
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Ostrzeżenie: Sprawdź czy ustawienia daty i czasu komputera są prawidłowe. Jeżeli zegar jest źle ustawiony, Bitcoin nie będzie poprawnie działał."
+
+#: ../../../src/util.cpp:903
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/ui.cpp:216
+#, c-format
+msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
+msgstr "Ta transakcja jest poza limitem wielkości. W dalszym ciągu możesz wysłać ją z prowizją %s, która dotrze do węzłów przetwarzających twoją transakcję i pomoże utrzymać sieć. Chcesz zapłacić prowizję?"
+
+#: ../../../src/ui.cpp:259
+#: ../../../src/ui.cpp:1246
+msgid "Enter the current passphrase to the wallet."
+msgstr "Wpisz obecne hasło do portfela."
+
+#: ../../../src/ui.cpp:260
+#: ../../../src/ui.cpp:1182
+#: ../../../src/ui.cpp:1199
+#: ../../../src/ui.cpp:1247
+#: ../../../src/ui.cpp:1273
+#: ../../../src/ui.cpp:1293
+msgid "Passphrase"
+msgstr "Hasło"
+
+#: ../../../src/ui.cpp:266
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Proszę dostarczyć hasło do odszyfrowania portfela."
+
+#: ../../../src/ui.cpp:274
+#: ../../../src/ui.cpp:1258
+#: ../../../src/ui.cpp:1315
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "Wpisane hasło do odszyfrowania portfela jest nieprawidłowe."
+
+#: ../../../src/ui.cpp:351
+msgid "Status"
+msgstr "Status"
+
+#: ../../../src/ui.cpp:352
+msgid "Date"
+msgstr "Data"
+
+#: ../../../src/ui.cpp:353
+msgid "Description"
+msgstr "Opis"
+
+#: ../../../src/ui.cpp:354
+msgid "Debit"
+msgstr "Obciążenie"
+
+#: ../../../src/ui.cpp:355
+msgid "Credit"
+msgstr "Suma"
+
+#: ../../../src/ui.cpp:566
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Otwórz na %d bloków"
+
+#: ../../../src/ui.cpp:568
+#, c-format
+msgid "Open until %s"
+msgstr "Otwarte dopóki %s"
+
+#: ../../../src/ui.cpp:574
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/offline?"
+
+#: ../../../src/ui.cpp:576
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/niepotwierdzono"
+
+#: ../../../src/ui.cpp:578
+#, c-format
+msgid "%d confirmations"
+msgstr "%d potwierdzeń"
+
+#: ../../../src/ui.cpp:663
+msgid "Generated"
+msgstr "Wygenerowano"
+
+#: ../../../src/ui.cpp:671
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Wygenerowano (%s dojrzałych w %d więcej bloków)"
+
+#: ../../../src/ui.cpp:675
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "Wygenerowano - Ostrzeżenie: Ten blok nie został otrzymany przez żaden inny węzeł i prawdopodobnie nie zostanie zaakceptowany!"
+
+#: ../../../src/ui.cpp:679
+msgid "Generated (not accepted)"
+msgstr "Wygenerowano (nie zaakceptowano)"
+
+#: ../../../src/ui.cpp:689
+msgid "From: "
+msgstr "Od:"
+
+#: ../../../src/ui.cpp:713
+msgid "Received with: "
+msgstr "Otrzymano z:"
+
+#: ../../../src/ui.cpp:759
+msgid "Payment to yourself"
+msgstr "Płatność dla siebie samego"
+
+#: ../../../src/ui.cpp:793
+msgid "To: "
+msgstr "Do:"
+
+#: ../../../src/ui.cpp:1108
+msgid " Generating"
+msgstr " Generowanie"
+
+#: ../../../src/ui.cpp:1110
+msgid "(not connected)"
+msgstr "(nie połączony)"
+
+#: ../../../src/ui.cpp:1113
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d połączeń %d bloków %d transakcji"
+
+#: ../../../src/ui.cpp:1170
+msgid "Wallet already encrypted."
+msgstr "Portfel już zaszyfrowany."
+
+#: ../../../src/ui.cpp:1181
+msgid ""
+"Enter the new passphrase to the wallet.\n"
+"Please use a passphrase of 10 or more random characters, or eight or more words."
+msgstr ""
+"Wpisz nowe hasło dla portfela.\n"
+"Proszę użyć hasła składającego się z 10 lub więcej losowych znaków albo ośmiu lub więcej słów."
+
+#: ../../../src/ui.cpp:1188
+#: ../../../src/ui.cpp:1281
+msgid "Error: The supplied passphrase was too short."
+msgstr "Błąd: Dostarczone hasło jest za krótkie."
+
+#: ../../../src/ui.cpp:1192
+msgid ""
+"WARNING: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR BITCOINS!\n"
+"Are you sure you wish to encrypt your wallet?"
+msgstr ""
+"OSTRZEŻENIE: Jeżeli zaszyfrujesz swój portfel i zgubisz hasło, STRACISZ WSZYSTKIE SWOJE BITCOINY!\n"
+"Czy jesteś pewny, że chcesz zaszyfrować swój portfel?"
+
+#: ../../../src/ui.cpp:1198
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Proszę powtórzyć nowe hasło do portfela."
+
+#: ../../../src/ui.cpp:1207
+#: ../../../src/ui.cpp:1303
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Błąd: dostarczone hasła się nie zgadzają."
+
+#: ../../../src/ui.cpp:1217
+msgid "Wallet encryption failed."
+msgstr "Szyfrowanie portfela nie powiodło się."
+
+#: ../../../src/ui.cpp:1224
+msgid ""
+"Wallet Encrypted.\n"
+"Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer."
+msgstr ""
+"Portfel zaszyfrowany.\n"
+"Pamiętaj, że zaszyfrowanie portfela nie chroni w pełni twoich bitcoinów przed kradzieżą przeprowadzoną przez złośliwe oprogramowanie infekujące twój komputer."
+
+#: ../../../src/ui.cpp:1235
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Portfel jest niezaszyfrowany, proszę najpierw zaszyfrować."
+
+#: ../../../src/ui.cpp:1272
+msgid "Enter the new passphrase for the wallet."
+msgstr "Wprowadź nowe hasło dla portfela."
+
+#: ../../../src/ui.cpp:1292
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Powtórnie wprowadź nowe hasło dla portfela."
+
+#: ../../../src/ui.cpp:1324
+msgid "Wallet Passphrase Changed."
+msgstr "Hasło dla portfela zostało zmienione."
+
+#: ../../../src/ui.cpp:1381
+#: ../../../src/ui.cpp:2816
+msgid "New Receiving Address"
+msgstr "Nowy Adres Odbiorczy"
+
+#: ../../../src/ui.cpp:1382
+#: ../../../src/ui.cpp:2817
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Powinieneś użyć nowego adresu dla każdej płatności, którą otrzymasz.\n"
+"\n"
+"Etykieta"
+
+#: ../../../src/ui.cpp:1466
+msgid "<b>Status:</b> "
+msgstr "<b>Status:</b>"
+
+#: ../../../src/ui.cpp:1471
+msgid ", has not been successfully broadcast yet"
+msgstr ", nie został jeszcze prawidłowo rozgłoszony"
+
+#: ../../../src/ui.cpp:1473
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", rozgłasza przez %d węzeł"
+
+#: ../../../src/ui.cpp:1475
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", rozgłasza przez %d węzłów"
+
+#: ../../../src/ui.cpp:1479
+msgid "<b>Date:</b> "
+msgstr "<b>Data:</b>"
+
+#: ../../../src/ui.cpp:1487
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Źródło:</b> Wygenerowano<br>"
+
+#: ../../../src/ui.cpp:1493
+#: ../../../src/ui.cpp:1511
+msgid "<b>From:</b> "
+msgstr "<b>Od:</b>"
+
+#: ../../../src/ui.cpp:1511
+msgid "unknown"
+msgstr "nieznany"
+
+#: ../../../src/ui.cpp:1512
+#: ../../../src/ui.cpp:1536
+#: ../../../src/ui.cpp:1595
+msgid "<b>To:</b> "
+msgstr "<b>Do:</b>"
+
+#: ../../../src/ui.cpp:1515
+msgid " (yours, label: "
+msgstr " (twoja, etykieta: "
+
+#: ../../../src/ui.cpp:1517
+msgid " (yours)"
+msgstr " (twoja)"
+
+#: ../../../src/ui.cpp:1554
+#: ../../../src/ui.cpp:1566
+#: ../../../src/ui.cpp:1612
+#: ../../../src/ui.cpp:1629
+msgid "<b>Credit:</b> "
+msgstr "<b>Suma:</b>"
+
+#: ../../../src/ui.cpp:1556
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s dojrzałych w %d więcej bloków)"
+
+#: ../../../src/ui.cpp:1558
+msgid "(not accepted)"
+msgstr "(nie zaakceptowano)"
+
+#: ../../../src/ui.cpp:1603
+#: ../../../src/ui.cpp:1611
+#: ../../../src/ui.cpp:1626
+msgid "<b>Debit:</b> "
+msgstr "<b>Obciążenie:</b>"
+
+#: ../../../src/ui.cpp:1617
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Prowizja transakcji:</b>"
+
+#: ../../../src/ui.cpp:1633
+msgid "<b>Net amount:</b> "
+msgstr "<b>Kwota netto:</b>"
+
+#: ../../../src/ui.cpp:1640
+msgid "Message:"
+msgstr "Wiadomość:"
+
+#: ../../../src/ui.cpp:1642
+msgid "Comment:"
+msgstr "Komentarz:"
+
+#: ../../../src/ui.cpp:1645
+msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
+msgstr "Wygenerowane monety muszą poczekać 120 bloków zanim mogą zostać wydane. Gdy wygenerowałeś ten blok, został rozgłoszony do sieci z przeznaczeniem do dodania do łańcucha bloków. Jeżeli nie uda się dodać bloku do łańcucha, zostanie oznaczony jako \"nie zaakceptowany\" i nie będzie mógł zostać wydany. Sporadycznie dzieje się tak jeżeli inny węzeł wygeneruje blok nie dalej niż kilka sekund od ciebie."
+
+#: ../../../src/ui.cpp:1825
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Nie mogę zapisać pliku autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1861
+msgid "Main"
+msgstr "Główne"
+
+#: ../../../src/ui.cpp:1871
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Uruchom Bitcoin przy starcie systemu"
+
+#: ../../../src/ui.cpp:1878
+msgid "&Minimize on close"
+msgstr "&Minimalizuj przy zamknięciu"
+
+#: ../../../src/ui.cpp:2020
+#, c-format
+msgid "version %s"
+msgstr "wersja %s"
+
+#: ../../../src/ui.cpp:2143
+msgid "Error in amount "
+msgstr "Nieprawidłowa kwota"
+
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2202
+#: ../../../src/uibase.cpp:61
+msgid "Send Coins"
+msgstr "Wyślij Monety"
+
+#: ../../../src/ui.cpp:2148
+msgid "Amount exceeds your balance "
+msgstr "Kwota przekracza twój stan konta"
+
+#: ../../../src/ui.cpp:2153
+msgid "Total exceeds your balance when the "
+msgstr "Przekroczenie twojego stanu konta gdy"
+
+#: ../../../src/ui.cpp:2153
+msgid " transaction fee is included "
+msgstr " prowizja jest wliczona"
+
+#: ../../../src/ui.cpp:2176
+msgid "Payment sent "
+msgstr "Wysłano płatność"
+
+#: ../../../src/ui.cpp:2176
+#: ../../../src/ui.cpp:2185
+#: ../../../src/ui.cpp:2336
+#: ../../../src/ui.cpp:2500
+#: ../../../src/wallet.cpp:1097
+msgid "Sending..."
+msgstr "Wysyłanie..."
+
+#: ../../../src/ui.cpp:2202
+msgid "Invalid address "
+msgstr "Nieprawidłowy adres"
+
+#: ../../../src/ui.cpp:2257
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Wysyłanie %s do %s"
+
+#: ../../../src/ui.cpp:2330
+#: ../../../src/ui.cpp:2363
+msgid "CANCELLED"
+msgstr "ANULOWANO"
+
+#: ../../../src/ui.cpp:2334
+msgid "Cancelled"
+msgstr "Anulowano"
+
+#: ../../../src/ui.cpp:2336
+msgid "Transfer cancelled "
+msgstr "Transfer anulowano"
+
+#: ../../../src/ui.cpp:2389
+msgid "Error: "
+msgstr "Błąd:"
+
+#: ../../../src/ui.cpp:2403
+#: ../../../src/ui.cpp:2474
+#: ../../../src/wallet.cpp:1116
+msgid "Insufficient funds"
+msgstr "Niewystarczające fundusze"
+
+#: ../../../src/ui.cpp:2408
+msgid "Connecting..."
+msgstr "Łączenie..."
+
+#: ../../../src/ui.cpp:2413
+msgid "Unable to connect"
+msgstr "Nie można połączyć"
+
+#: ../../../src/ui.cpp:2418
+msgid "Requesting public key..."
+msgstr "Żądanie klucza publicznego..."
+
+#: ../../../src/ui.cpp:2430
+msgid "Received public key..."
+msgstr "Otrzymano klucz publiczny..."
+
+#: ../../../src/ui.cpp:2444
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Adresat nie akceptuje transakcji wysyłanych przez adres IP"
+
+#: ../../../src/ui.cpp:2446
+msgid "Transfer was not accepted"
+msgstr "Transfer nie został zaakceptowany"
+
+#: ../../../src/ui.cpp:2455
+msgid "Invalid response received"
+msgstr "Otrzymano niepoprawną odpowiedź"
+
+#: ../../../src/ui.cpp:2470
+msgid "Creating transaction..."
+msgstr "Tworzenie transakcji..."
+
+#: ../../../src/ui.cpp:2489
+#, c-format
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Ta transakcja wymaga prowizji co najmniej %s z uwagi na kwotę, złożoność lub użycie niedawno otrzymanych funduszy"
+
+#: ../../../src/ui.cpp:2491
+msgid "Transaction creation failed"
+msgstr "Błąd tworzenia transakcji "
+
+#: ../../../src/ui.cpp:2502
+msgid "Transaction aborted"
+msgstr "Transakcję przerwano"
+
+#: ../../../src/ui.cpp:2510
+msgid "Lost connection, transaction cancelled"
+msgstr "Utracono połączenie, transakcja anulowana"
+
+#: ../../../src/ui.cpp:2526
+msgid "Sending payment..."
+msgstr "Wysyłanie płatności..."
+
+#: ../../../src/ui.cpp:2532
+msgid "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."
+msgstr "Transakcja została odrzucona. Może się tak zdarzyć jeżeli część monet w twoim portfelu zostało wydanych, np. gdy użyto kopii pliku wallet.dat i monety zostały wydane w kopii, a tutaj nie zostały oznaczone jako wydane."
+
+#: ../../../src/ui.cpp:2541
+msgid "Waiting for confirmation..."
+msgstr "Oczekiwanie na potwierdzenie..."
+
+#: ../../../src/ui.cpp:2559
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"Płatność została wysłana, ale odbiorca nie mógł jej zweryfikować.\n"
+"Transakcja została zarejestrowana i zostanie przypisana do odbiorcy,\n"
+"ale informacja w komentarzu będzie pusta."
+
+#: ../../../src/ui.cpp:2568
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Płatność została wysłana, ale otrzymano nieprawidłową odpowiedź"
+
+#: ../../../src/ui.cpp:2574
+msgid "Payment completed"
+msgstr "Płatność zakończona"
+
+#: ../../../src/ui.cpp:2616
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2804
+msgid "Name"
+msgstr "Nazwa"
+
+#: ../../../src/ui.cpp:2617
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2804
+msgid "Address"
+msgstr "Adres"
+
+#: ../../../src/ui.cpp:2619
+#: ../../../src/ui.cpp:2776
+msgid "Label"
+msgstr "Etykieta"
+
+#: ../../../src/ui.cpp:2620
+#: ../../../src/uibase.cpp:847
+msgid "Bitcoin Address"
+msgstr "Adres Bitcoin"
+
+#: ../../../src/ui.cpp:2746
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
+msgstr "To jest jeden z twoich adresów na otrzymywane płatności i nie może zostać wpisany do księgi adresowej."
+
+#: ../../../src/ui.cpp:2764
+#: ../../../src/ui.cpp:2770
+msgid "Edit Address"
+msgstr "Edytuj Adres"
+
+#: ../../../src/ui.cpp:2776
+msgid "Edit Address Label"
+msgstr "Edytuj Etykietę Adresu"
+
+#: ../../../src/ui.cpp:2804
+#: ../../../src/ui.cpp:2810
+msgid "Add Address"
+msgstr "Dodaj Adres"
+
+#: ../../../src/ui.cpp:2898
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../src/ui.cpp:2900
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - Generowanie"
+
+#: ../../../src/ui.cpp:2902
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (nie połączony)"
+
+#: ../../../src/ui.cpp:2981
+msgid "&Open Bitcoin"
+msgstr "&Otwórz Bitcoin"
+
+#: ../../../src/ui.cpp:2982
+msgid "&Send Bitcoins"
+msgstr "&Wyślij Bitcoiny"
+
+#: ../../../src/ui.cpp:2983
+msgid "O&ptions..."
+msgstr "O&pcje..."
+
+#: ../../../src/ui.cpp:2986
+#: ../../../src/uibase.cpp:25
+msgid "E&xit"
+msgstr "W&yjście"
+
+#: ../../../src/ui.cpp:3212
+msgid "Program has crashed and will terminate. "
+msgstr "Program uległ awarii i zostanie przerwany."
+
+#: ../../../src/main.cpp:1430
+msgid "Warning: Disk space is low "
+msgstr "Ostrzeżenie: Mało miejsca na dysku"
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "&Plik"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "&Twój Adres Odbiorczy..."
+
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "&Zaszyfruj portfel..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "&Zmień hasło szyfrowania portfela..."
+
+#: ../../../src/uibase.cpp:42
+msgid "&Options..."
+msgstr "&Opcje..."
+
+#: ../../../src/uibase.cpp:45
+msgid "&Settings"
+msgstr "&Ustawienia"
+
+#: ../../../src/uibase.cpp:49
+msgid "&About..."
+msgstr "&O programie..."
+
+#: ../../../src/uibase.cpp:52
+msgid "&Help"
+msgstr "&Pomoc"
+
+#: ../../../src/uibase.cpp:62
+msgid "Address Book"
+msgstr "Księga Adresowa"
+
+#: ../../../src/uibase.cpp:75
+msgid "Your Bitcoin Address:"
+msgstr "Twój Adres Bitcoin:"
+
+#: ../../../src/uibase.cpp:82
+msgid " &New... "
+msgstr " &Nowy..."
+
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
+msgid " &Copy to Clipboard "
+msgstr " &Kopiuj do schowka "
+
+#: ../../../src/uibase.cpp:99
+msgid "Balance:"
+msgstr "Saldo:"
+
+#: ../../../src/uibase.cpp:115
+msgid " All"
+msgstr " Wszystko"
+
+#: ../../../src/uibase.cpp:115
+msgid " Sent"
+msgstr "Wysłano"
+
+#: ../../../src/uibase.cpp:115
+msgid " Received"
+msgstr "Otrzymano"
+
+#: ../../../src/uibase.cpp:115
+msgid " In Progress"
+msgstr "W Trakcie"
+
+#: ../../../src/uibase.cpp:136
+msgid "All Transactions"
+msgstr "Wszystkie Transakcje"
+
+#: ../../../src/uibase.cpp:147
+msgid "Sent/Received"
+msgstr "Wysłano/Otrzymano"
+
+#: ../../../src/uibase.cpp:158
+msgid "Sent"
+msgstr "Wysłano"
+
+#: ../../../src/uibase.cpp:169
+msgid "Received"
+msgstr "Otrzymano"
+
+#: ../../../src/uibase.cpp:312
+#: ../../../src/uibase.cpp:453
+#: ../../../src/uibase.cpp:552
+#: ../../../src/uibase.cpp:732
+#: ../../../src/uibase.cpp:793
+#: ../../../src/uibase.cpp:902
+#: ../../../src/uibase.cpp:991
+msgid "OK"
+msgstr "OK"
+
+#: ../../../src/uibase.cpp:355
+msgid "&Start Bitcoin on system startup"
+msgstr "&Uruchom Bitcoin wraz ze startem systemu"
+
+#: ../../../src/uibase.cpp:358
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Zminimalizuj do traya zamiast do paska zadań"
+
+#: ../../../src/uibase.cpp:361
+msgid "Map port using &UPnP"
+msgstr "Mapuj port używając &UPnP"
+
+#: ../../../src/uibase.cpp:364
+msgid "M&inimize to the tray on close"
+msgstr "Zm&inimalizuj do traya przy zamknięciu"
+
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy: "
+msgstr "&Połącz przez socks4 proxy:"
+
+#: ../../../src/uibase.cpp:381
+msgid "Proxy &IP:"
+msgstr "Proxy &IP:"
+
+#: ../../../src/uibase.cpp:389
+msgid " &Port:"
+msgstr " &Port:"
+
+#: ../../../src/uibase.cpp:402
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Opcjonalna prowizja określona dla KB transakcji, która zapewni, że twoje transakcje będą szybko przetworzone. Większość transakcji to 1KB. Rekomendowana prowizja to 0.01."
+
+#: ../../../src/uibase.cpp:409
+msgid "Pay transaction fee:"
+msgstr "Płać prowizję transakcji:"
+
+#: ../../../src/uibase.cpp:430
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../src/uibase.cpp:434
+msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
+msgstr ""
+
+#: ../../../src/uibase.cpp:456
+#: ../../../src/uibase.cpp:678
+#: ../../../src/uibase.cpp:737
+#: ../../../src/uibase.cpp:796
+#: ../../../src/uibase.cpp:905
+#: ../../../src/uibase.cpp:994
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: ../../../src/uibase.cpp:459
+msgid "&Apply"
+msgstr "&Zastosuj"
+
+#: ../../../src/uibase.cpp:518
+msgid "Bitcoin "
+msgstr "Bitcoin"
+
+#: ../../../src/uibase.cpp:524
+msgid "version"
+msgstr "wersja"
+
+#: ../../../src/uibase.cpp:535
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"To oprogramowanie jest eksperymentalne.\n"
+"\n"
+"Dystrybuowane na licencji MIT/X11, zobacz towarzyszący plik \n"
+"license.txt lub http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Ten produkt zawiera oprogramowanie rozwijane przez OpenSSL Project w \n"
+"OpenSSL Toolkit (http://www.openssl.org/) i oprogramowanie kryptograficzne napisane przez \n"
+"Erica Younga (eay@cryptsoft.com) oraz oprogramowanie UPnP napisane przez Thomasa Bernarda."
+
+#: ../../../src/uibase.cpp:591
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:605
+msgid "Pay &To:"
+msgstr "Wpłać &Dla:"
+
+#: ../../../src/uibase.cpp:620
+msgid "&Paste"
+msgstr "&Wklej"
+
+#: ../../../src/uibase.cpp:623
+msgid " Address &Book..."
+msgstr " Księga &Adresowa..."
+
+#: ../../../src/uibase.cpp:630
+msgid "&Amount:"
+msgstr "&Kwota:"
+
+#: ../../../src/uibase.cpp:640
+msgid "T&ransfer:"
+msgstr "T&ransfer:"
+
+#: ../../../src/uibase.cpp:646
+msgid " Standard"
+msgstr " Standard"
+
+#: ../../../src/uibase.cpp:673
+msgid "&Send"
+msgstr "&Wyślij"
+
+#: ../../../src/uibase.cpp:721
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Łączenie..."
+
+#: ../../../src/uibase.cpp:771
+msgid "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. The highlighted address is displayed in the main window."
+msgstr "To są twoje adresy Bitcoin dla otrzymywania płatności. Możesz chcieć podać różne dla każdego płacącego aby kontrolować kto ci płaci. Wyróżniony adres będzie wyświetlany w oknie głównym."
+
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
+msgid "&Edit..."
+msgstr "&Edytuj..."
+
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
+msgid " &New Address... "
+msgstr " &Nowy Adres..."
+
+#: ../../../src/uibase.cpp:859
+msgid "Sending"
+msgstr "Wysyłanie"
+
+#: ../../../src/uibase.cpp:867
+msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
+msgstr "To są twoje adresy Bitcoin dla otrzymywania płatności. Możesz podać różne dla każdego płacącego aby kontrolować kto ci płaci. Wyróżniony adres będzie wyświetlany w oknie głównym."
+
+#: ../../../src/uibase.cpp:880
+msgid "Receiving"
+msgstr "Otrzymywanie"
+
+#: ../../../src/uibase.cpp:890
+msgid "&Delete"
+msgstr "&Usuń"
+
+#: ../../../src/wallet.cpp:1081
+msgid "Error: Wallet locked, unable to create transaction "
+msgstr "Błąd: Portfel zablokowany, nie można utworzyć transakcji"
+
+#: ../../../src/wallet.cpp:1089
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Błąd: Ta transakcja wymaga prowizji co najmniej %s z uwagi na kwotę, złożoność lub użycie niedawno otrzymanych funduszy"
+
+#: ../../../src/wallet.cpp:1091
+msgid "Error: Transaction creation failed "
+msgstr "Błąd: Nie udało się utworzyć transakcji"
+
+#: ../../../src/wallet.cpp:1101
+msgid "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."
+msgstr "Błąd: Transakcja została odrzucona. Może się tak zdarzyć jeżeli część monet w twoim portfelu zostało wydanych, np. gdy użyto kopii pliku wallet.dat i monety zostały wydane w kopii, a tutaj nie zostały oznaczone jako wydane."
+
+#: ../../../src/wallet.cpp:1114
+msgid "Invalid amount"
+msgstr "Niewłaściwa kwota"
+
+#: ../../../src/wallet.cpp:1121
+msgid "Invalid bitcoin address"
+msgstr "Niewłaściwy adres bitcoin"
+
+#: ../../../src/uibase.h:151
+msgid "Transaction Details"
+msgstr "Szczegóły Transakcji"
+
+#: ../../../src/uibase.h:203
+msgid "Options"
+msgstr "Opcje"
+
+#: ../../../src/uibase.h:232
+msgid "About Bitcoin"
+msgstr "O Bitcoin"
+
+#: ../../../src/uibase.h:341
+msgid "Your Bitcoin Addresses"
+msgstr "Twoje Adresy Bitcoin"
+
diff --git a/locale/pt/LC_MESSAGES/bitcoin.po b/locale/pt/LC_MESSAGES/bitcoin.po
index 9bf193e19b..040fb1da68 100644
--- a/locale/pt/LC_MESSAGES/bitcoin.po
+++ b/locale/pt/LC_MESSAGES/bitcoin.po
@@ -527,11 +527,6 @@ msgstr "&Abrir Bitcoin"
msgid "O&ptions..."
msgstr "O&pções"
-#: ../../../ui.cpp:2502
-#: ../../../uibase.cpp:34
-msgid "&Generate Coins"
-msgstr "&Gerar Moedas"
-
#: ../../../ui.cpp:2505
#: ../../../uibase.cpp:27
msgid "E&xit"
diff --git a/locale/ru/LC_MESSAGES/bitcoin.mo b/locale/ru/LC_MESSAGES/bitcoin.mo
index b44c10ad47..4175fc47d1 100644
--- a/locale/ru/LC_MESSAGES/bitcoin.mo
+++ b/locale/ru/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/ru/LC_MESSAGES/bitcoin.po b/locale/ru/LC_MESSAGES/bitcoin.po
index 5a87259c9e..266e76825a 100644
--- a/locale/ru/LC_MESSAGES/bitcoin.po
+++ b/locale/ru/LC_MESSAGES/bitcoin.po
@@ -1,11 +1,12 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-10-05 10:53+0300\n"
-"PO-Revision-Date: 2010-10-05 11:43+0300\n"
-"Last-Translator: eurekafag\n"
+"Report-Msgid-Bugs-To: m0Ray <m0ray@nm.ru>\n"
+"POT-Creation-Date: 2011-05-15 18:24+0100\n"
+"PO-Revision-Date: 2011-07-17 04:18+0100\n"
+"Last-Translator: Michael Bemmerl <mail@mx-server.de>\n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -13,503 +14,365 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
-#: ../../../init.cpp:162
-msgid "Usage:"
-msgstr "Использование"
-
-#: ../../../init.cpp:164
-msgid "Send command to -server or bitcoind\n"
-msgstr "Отправить команду bitcoin, запущенному с -server\n"
-
-#: ../../../init.cpp:165
-msgid "List commands\n"
-msgstr "Список команд\n"
-
-#: ../../../init.cpp:166
-msgid "Get help for a command\n"
-msgstr "Получить помощь для команды\n"
-
-#: ../../../init.cpp:167
-msgid "Options:\n"
-msgstr "Параметры:\n"
-
-#: ../../../init.cpp:168
-msgid "Specify configuration file (default: bitcoin.conf)\n"
-msgstr "Укажите конфигурационный файл (по умолчанию: bitcoin.conf)\n"
-
-#: ../../../init.cpp:169
-msgid "Generate coins\n"
-msgstr "Генерировать монеты\n"
-
-#: ../../../init.cpp:170
-msgid "Don't generate coins\n"
-msgstr "Не генерировать монеты\n"
-
-#: ../../../init.cpp:171
-msgid "Start minimized\n"
-msgstr "Запускать свёрнутым\n"
-
-#: ../../../init.cpp:172
-msgid "Specify data directory\n"
-msgstr "Указать каталог данных\n"
-
-#: ../../../init.cpp:173
-msgid "Connect through socks4 proxy\n"
-msgstr "Подключаться через socks4 прокси\n"
-
-#: ../../../init.cpp:174
-msgid "Add a node to connect to\n"
-msgstr "Добавить узел для подключения\n"
-
-#: ../../../init.cpp:175
-msgid "Connect only to the specified node\n"
-msgstr "Подключаться только к указанному узлу\n"
-
-#: ../../../init.cpp:176
-msgid "Accept command line and JSON-RPC commands\n"
-msgstr "Принимать команды из командной строки и через JSON-RPC\n"
-
-#: ../../../init.cpp:177
-msgid "Run in the background as a daemon and accept commands\n"
-msgstr "Запустить в фоне как демон и принимать команды\n"
-
-#: ../../../init.cpp:178
-msgid "This help message\n"
-msgstr "Эта справка\n"
-
-#: ../../../init.cpp:284
-msgid "Error loading addr.dat \n"
-msgstr "Ошибка загрузки addr.dat \n"
-
-#: ../../../init.cpp:290
-msgid "Error loading blkindex.dat \n"
-msgstr "Ошибка загрузки blkindex.dat \n"
-
-#: ../../../init.cpp:297
-msgid "Error loading wallet.dat \n"
-msgstr "Ошибка загрузки wallet.dat \n"
-
-#: ../../../init.cpp:365
-msgid "Invalid -proxy address"
-msgstr "Неверный адрес -proxy"
-
-#: ../../../init.cpp:385
-msgid "Invalid amount for -paytxfee=<amount>"
-msgstr "Неверное значение для -paytxfee=<amount>"
-
-#: ../../../init.cpp:389
-msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
-msgstr "Внимание: -paytxfee установлено в очень большое значение. Это комиссия, которую вы будете платить при переводе."
-
-#: ../../../main.cpp:1641
-msgid "Warning: Disk space is low "
-msgstr "Внимание: мало места на диске "
-
-#: ../../../main.cpp:3505
-#, c-format
-msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
-msgstr "Ошибка: этот перевод слишком большого размера, который требует комиссию %s "
-
-#: ../../../main.cpp:3507
-msgid "Error: Transaction creation failed "
-msgstr "Ошибка: не удалось создать перевод "
-
-#: ../../../main.cpp:3512
-#: ../../../ui.cpp:1964
-#: ../../../ui.cpp:1966
-#: ../../../ui.cpp:2107
-#: ../../../ui.cpp:2260
-msgid "Sending..."
-msgstr "Отправка..."
-
-#: ../../../main.cpp:3516
-msgid "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."
-msgstr "Перевод был отклонен. Это могло произойти, если некоторые из монет в вашем кошельке уже были потрачены, например, если вы использовали копию wallet.dat, и монеты были потрачены в копии, но не отмечены израсходованными здесь."
-
-#: ../../../main.cpp:3528
-msgid "Invalid amount"
-msgstr "Неверное количество"
-
-#: ../../../main.cpp:3530
-#: ../../../ui.cpp:2174
-#: ../../../ui.cpp:2245
-msgid "Insufficient funds"
-msgstr "Недостаточно средств"
-
-#: ../../../main.cpp:3535
-msgid "Invalid bitcoin address"
-msgstr "Неверный адрес bitcoin"
-
-#: ../../../rpc.cpp:963
-#: ../../../rpc.cpp:965
-#, c-format
-msgid "To use the %s option"
-msgstr "Чтобы использовать опцию %s"
-
-#: ../../../rpc.cpp:967
-#, c-format
-msgid ""
-"Warning: %s, you must set rpcpassword=<password>\n"
-"in the configuration file: %s\n"
-"If the file does not exist, create it with owner-readable-only file permissions.\n"
-msgstr ""
-"Внимание: %s, вы должны установить rpcpassword=<пароль>\n"
-"в конфигурационном файле: %s\n"
-"Если файл не существует, создайте его с правами \"чтение только владельцем\".\n"
-
-#: ../../../rpc.cpp:1100
+#: ../../../src/net.cpp:1499
#, c-format
-msgid ""
-"You must set rpcpassword=<password> in the configuration file:\n"
-"%s\n"
-"If the file does not exist, create it with owner-readable-only file permissions."
-msgstr ""
-"Вы должны установить rpcpassword=<пароль> в конфигурационном файле:\n"
-"%s\n"
-"Если файл не существует, создайте его с правами \"чтение только владельцем\"."
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Не могу открыть порт %d. Возможно, Bitcoin уже запущен."
-#: ../../../ui.cpp:202
+#: ../../../src/ui.cpp:202
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
msgstr "Этот перевод превышает допустимый лимит. Вы можете провести его с комиссией %s, которую получат узлы, обрабатывающие перевод, и поможет поддерживать сеть. Вы хотите заплатить комиссию?"
-#: ../../../ui.cpp:301
+#: ../../../src/ui.cpp:301
msgid "Status"
msgstr "Статус"
-#: ../../../ui.cpp:302
+#: ../../../src/ui.cpp:302
msgid "Date"
msgstr "Дата"
-#: ../../../ui.cpp:303
+#: ../../../src/ui.cpp:303
msgid "Description"
msgstr "Описание"
-#: ../../../ui.cpp:304
+#: ../../../src/ui.cpp:304
msgid "Debit"
-msgstr "Дебет"
+msgstr "Расход"
-#: ../../../ui.cpp:305
+#: ../../../src/ui.cpp:305
msgid "Credit"
-msgstr "Кредит"
+msgstr "Приход"
-#: ../../../ui.cpp:511
+#: ../../../src/ui.cpp:511
#, c-format
msgid "Open for %d blocks"
-msgstr "Открыто для %d блоков"
+msgstr "Открыто на %d блоков"
-#: ../../../ui.cpp:513
+#: ../../../src/ui.cpp:513
#, c-format
msgid "Open until %s"
msgstr "Открыто до %s"
-#: ../../../ui.cpp:519
+#: ../../../src/ui.cpp:519
#, c-format
msgid "%d/offline?"
msgstr "%d/оффлайн?"
-#: ../../../ui.cpp:521
+#: ../../../src/ui.cpp:521
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/не подтверждено"
-#: ../../../ui.cpp:523
+#: ../../../src/ui.cpp:523
#, c-format
msgid "%d confirmations"
msgstr "%d подтверждений"
-#: ../../../ui.cpp:608
+#: ../../../src/ui.cpp:608
msgid "Generated"
msgstr "Сгенерировано"
-#: ../../../ui.cpp:616
+#: ../../../src/ui.cpp:616
#, c-format
msgid "Generated (%s matures in %d more blocks)"
msgstr "Сгенерировано (%s станет доступно через %d блоков)"
-#: ../../../ui.cpp:620
+#: ../../../src/ui.cpp:620
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
msgstr "Сгенерировано - Внимание: этот блок не был получен ни одним узлом и, скорее всего, не будет принят!"
-#: ../../../ui.cpp:624
+#: ../../../src/ui.cpp:624
msgid "Generated (not accepted)"
msgstr "Сгенерировано (не принято)"
-#: ../../../ui.cpp:634
+#: ../../../src/ui.cpp:634
msgid "From: "
msgstr "От: "
-#: ../../../ui.cpp:658
+#: ../../../src/ui.cpp:658
msgid "Received with: "
msgstr "Получено для: "
-#: ../../../ui.cpp:704
+#: ../../../src/ui.cpp:704
msgid "Payment to yourself"
msgstr "Платёж самому себе"
-#: ../../../ui.cpp:741
+#: ../../../src/ui.cpp:738
msgid "To: "
msgstr "Кому: "
-#: ../../../ui.cpp:1049
+#: ../../../src/ui.cpp:1053
msgid " Generating"
msgstr " Генерация"
-#: ../../../ui.cpp:1051
+#: ../../../src/ui.cpp:1055
msgid "(not connected)"
msgstr "(не подключен)"
-#: ../../../ui.cpp:1054
+#: ../../../src/ui.cpp:1058
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d подключений %d блоков %d переводов"
-#: ../../../ui.cpp:1165
-#: ../../../ui.cpp:2560
+#: ../../../src/ui.cpp:1163
+#: ../../../src/ui.cpp:2527
msgid "New Receiving Address"
msgstr "Новый адрес получения"
-#: ../../../ui.cpp:1166
-#: ../../../ui.cpp:2561
+#: ../../../src/ui.cpp:1164
+#: ../../../src/ui.cpp:2528
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
-"Вы должны использовать новый адрес для каждого получаемого платежа.\n"
+"Рекомендуется использовать новый адрес для каждого получаемого платежа.\n"
"\n"
"Метка"
-#: ../../../ui.cpp:1235
+#: ../../../src/ui.cpp:1233
msgid "<b>Status:</b> "
msgstr "<b>Статус:</b> "
-#: ../../../ui.cpp:1240
+#: ../../../src/ui.cpp:1238
msgid ", has not been successfully broadcast yet"
msgstr ", ещё не был успешно разослан"
-#: ../../../ui.cpp:1242
+#: ../../../src/ui.cpp:1240
#, c-format
msgid ", broadcast through %d node"
msgstr ", рассылка через %d узел"
-#: ../../../ui.cpp:1244
+#: ../../../src/ui.cpp:1242
#, c-format
msgid ", broadcast through %d nodes"
msgstr ", рассылка через %d узлов"
-#: ../../../ui.cpp:1248
+#: ../../../src/ui.cpp:1246
msgid "<b>Date:</b> "
msgstr "<b>Дата:</b> "
-#: ../../../ui.cpp:1256
+#: ../../../src/ui.cpp:1254
msgid "<b>Source:</b> Generated<br>"
msgstr "<b>Источник:</b> Сгенерировано<br>"
-#: ../../../ui.cpp:1262
-#: ../../../ui.cpp:1280
+#: ../../../src/ui.cpp:1260
+#: ../../../src/ui.cpp:1278
msgid "<b>From:</b> "
msgstr "<b>От:</b> "
-#: ../../../ui.cpp:1280
+#: ../../../src/ui.cpp:1278
msgid "unknown"
msgstr "аноним"
-#: ../../../ui.cpp:1281
-#: ../../../ui.cpp:1305
-#: ../../../ui.cpp:1364
+#: ../../../src/ui.cpp:1279
+#: ../../../src/ui.cpp:1303
+#: ../../../src/ui.cpp:1362
msgid "<b>To:</b> "
msgstr "<b>Кому:</b> "
-#: ../../../ui.cpp:1284
+#: ../../../src/ui.cpp:1282
msgid " (yours, label: "
msgstr " (ваш, метка: "
-#: ../../../ui.cpp:1286
+#: ../../../src/ui.cpp:1284
msgid " (yours)"
msgstr " (ваш)"
-#: ../../../ui.cpp:1323
-#: ../../../ui.cpp:1335
-#: ../../../ui.cpp:1398
+#: ../../../src/ui.cpp:1321
+#: ../../../src/ui.cpp:1333
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:1396
msgid "<b>Credit:</b> "
-msgstr "<b>Кредит:</b> "
+msgstr "<b>Приход:</b> "
-#: ../../../ui.cpp:1325
+#: ../../../src/ui.cpp:1323
#, c-format
msgid "(%s matures in %d more blocks)"
msgstr "(%s станет доступно через %d блоков)"
-#: ../../../ui.cpp:1327
+#: ../../../src/ui.cpp:1325
msgid "(not accepted)"
msgstr "(не принято)"
-#: ../../../ui.cpp:1372
-#: ../../../ui.cpp:1395
+#: ../../../src/ui.cpp:1370
+#: ../../../src/ui.cpp:1378
+#: ../../../src/ui.cpp:1393
msgid "<b>Debit:</b> "
-msgstr "<b>Дебет:</b> "
+msgstr "<b>Расход:</b> "
-#: ../../../ui.cpp:1386
+#: ../../../src/ui.cpp:1384
msgid "<b>Transaction fee:</b> "
msgstr "<b>Комиссия:</b> "
-#: ../../../ui.cpp:1402
+#: ../../../src/ui.cpp:1400
msgid "<b>Net amount:</b> "
-msgstr "<b>Количество сети:</b> "
+msgstr "<b>Чистая сумма:</b> "
-#: ../../../ui.cpp:1409
+#: ../../../src/ui.cpp:1407
msgid "Message:"
msgstr "Сообщение:"
-#: ../../../ui.cpp:1412
+#: ../../../src/ui.cpp:1409
+msgid "Comment:"
+msgstr "Комментарий:"
+
+#: ../../../src/ui.cpp:1412
msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
-msgstr "Сгенерированные монеты должны ждать 120 блоков, прежде чем они могут быть потрачены. Когда вы сгенерировали этот блок, он был разослан в сети для добавления в цепь блоков. Если не удалось добавить этот блок в цепь, он будет обозначен как \"не принятый\" и не может быть потрачен. Такое может случиться, если другой узел сгенерировал блок через несколько секунд после вас."
+msgstr "Сгенерированные монеты должны ждать 120 блоков, прежде чем они могут быть потрачены. Когда вы сгенерировали этот блок, он был разослан в сети для добавления в цепь блоков. Если не удалось добавить этот блок в цепь, он будет обозначен как \"не принятый\" и не может быть потрачен. Такое может случиться, если другой узел сгенерировал блок примерно в то же время, что и вы."
-#: ../../../ui.cpp:1593
+#: ../../../src/ui.cpp:1592
msgid "Cannot write autostart/bitcoin.desktop file"
msgstr "Не удаётся записать файл autostart/bitcoin.desktop"
-#: ../../../ui.cpp:1629
+#: ../../../src/ui.cpp:1628
msgid "Main"
msgstr "Основные"
-#: ../../../ui.cpp:1634
+#: ../../../src/ui.cpp:1636
msgid "&Start Bitcoin on window system startup"
msgstr "&Запускать Bitcoin при запуске оконной системы"
-#: ../../../ui.cpp:1641
+#: ../../../src/ui.cpp:1643
msgid "&Minimize on close"
msgstr "&Сворачивать при закрытии"
-#: ../../../ui.cpp:1798
+#: ../../../src/ui.cpp:1785
#, c-format
-msgid "version %s%s BETA"
-msgstr "версия %s%s бета"
-
-#: ../../../ui.cpp:1884
-msgid "n/a"
-msgstr "н/д"
+msgid "version %s"
+msgstr "версия %s"
-#: ../../../ui.cpp:1885
-msgid "Can't include a message when sending to a Bitcoin address"
-msgstr "Не удаётся включить сообщение при отправке на адрес Bitcoin"
-
-#: ../../../ui.cpp:1938
+#: ../../../src/ui.cpp:1897
msgid "Error in amount "
msgstr "Ошибка в количестве "
-#: ../../../ui.cpp:1938
-#: ../../../ui.cpp:1943
-#: ../../../ui.cpp:1948
-#: ../../../ui.cpp:1974
-#: ../../../uibase.cpp:59
+#: ../../../src/ui.cpp:1897
+#: ../../../src/ui.cpp:1902
+#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:1942
+#: ../../../src/uibase.cpp:55
msgid "Send Coins"
msgstr "Отправить монеты"
-#: ../../../ui.cpp:1943
+#: ../../../src/ui.cpp:1902
msgid "Amount exceeds your balance "
msgstr "Количество превышает ваш баланс "
-#: ../../../ui.cpp:1948
+#: ../../../src/ui.cpp:1907
msgid "Total exceeds your balance when the "
msgstr "Общая сумма превышает ваш баланс, когда "
-#: ../../../ui.cpp:1948
+#: ../../../src/ui.cpp:1907
msgid " transaction fee is included "
msgstr " комиссия включена "
-#: ../../../ui.cpp:1964
+#: ../../../src/ui.cpp:1925
msgid "Payment sent "
msgstr "Платёж отправлен "
-#: ../../../ui.cpp:1974
+#: ../../../src/ui.cpp:1925
+#: ../../../src/ui.cpp:1930
+#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2227
+#: ../../../src/main.cpp:3999
+msgid "Sending..."
+msgstr "Отправка..."
+
+#: ../../../src/ui.cpp:1942
msgid "Invalid address "
msgstr "Неверный адрес "
-#: ../../../ui.cpp:2028
+#: ../../../src/ui.cpp:1995
#, c-format
msgid "Sending %s to %s"
msgstr "Отправка %s для %s"
-#: ../../../ui.cpp:2101
-#: ../../../ui.cpp:2134
+#: ../../../src/ui.cpp:2068
+#: ../../../src/ui.cpp:2101
msgid "CANCELLED"
msgstr "ОТМЕНЕНО"
-#: ../../../ui.cpp:2105
+#: ../../../src/ui.cpp:2072
msgid "Cancelled"
msgstr "Отменено"
-#: ../../../ui.cpp:2107
+#: ../../../src/ui.cpp:2074
msgid "Transfer cancelled "
msgstr "Передача отменена "
-#: ../../../ui.cpp:2160
+#: ../../../src/ui.cpp:2127
msgid "Error: "
msgstr "Ошибка: "
-#: ../../../ui.cpp:2179
+#: ../../../src/ui.cpp:2141
+#: ../../../src/ui.cpp:2212
+#: ../../../src/main.cpp:4018
+msgid "Insufficient funds"
+msgstr "Недостаточно средств"
+
+#: ../../../src/ui.cpp:2146
msgid "Connecting..."
msgstr "Подключение..."
-#: ../../../ui.cpp:2184
+#: ../../../src/ui.cpp:2151
msgid "Unable to connect"
msgstr "Невозможно подключиться"
-#: ../../../ui.cpp:2189
+#: ../../../src/ui.cpp:2156
msgid "Requesting public key..."
msgstr "Запрос публичного ключа..."
-#: ../../../ui.cpp:2201
+#: ../../../src/ui.cpp:2168
msgid "Received public key..."
msgstr "Получен публичный ключ..."
-#: ../../../ui.cpp:2215
+#: ../../../src/ui.cpp:2182
msgid "Recipient is not accepting transactions sent by IP address"
msgstr "Получатель не принимает переводы на IP-адрес"
-#: ../../../ui.cpp:2217
+#: ../../../src/ui.cpp:2184
msgid "Transfer was not accepted"
msgstr "Передача не принята"
-#: ../../../ui.cpp:2226
+#: ../../../src/ui.cpp:2193
msgid "Invalid response received"
msgstr "Получен неверный отклик"
-#: ../../../ui.cpp:2241
+#: ../../../src/ui.cpp:2208
msgid "Creating transaction..."
msgstr "Создание перевода..."
-#: ../../../ui.cpp:2253
+#: ../../../src/ui.cpp:2220
#, c-format
-msgid "This is an oversized transaction that requires a transaction fee of %s"
-msgstr "Это слишком большой перевод, который требует комиссию в размере %s"
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Этот перевод требует уплаты комиссии минимум в %s, так как имеет большой объём, сложность или использует недавно полученные средства"
-#: ../../../ui.cpp:2255
+#: ../../../src/ui.cpp:2222
msgid "Transaction creation failed"
msgstr "Не удалось создать перевод"
-#: ../../../ui.cpp:2262
+#: ../../../src/ui.cpp:2229
msgid "Transaction aborted"
msgstr "Перевод прерван"
-#: ../../../ui.cpp:2270
+#: ../../../src/ui.cpp:2237
msgid "Lost connection, transaction cancelled"
msgstr "Соединение разорвано, перевод отменён"
-#: ../../../ui.cpp:2286
+#: ../../../src/ui.cpp:2253
msgid "Sending payment..."
msgstr "Отправка платежа..."
-#: ../../../ui.cpp:2292
+#: ../../../src/ui.cpp:2259
msgid "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."
msgstr "Перевод был отклонён. Это могло произойти, если некоторые из монет в вашем кошельке уже были потрачены, например, если вы использовали копию wallet.dat, и монеты были потрачены в копии, но не отмечены израсходованными здесь."
-#: ../../../ui.cpp:2301
+#: ../../../src/ui.cpp:2268
msgid "Waiting for confirmation..."
msgstr "Ожидание подтверждения..."
-#: ../../../ui.cpp:2319
+#: ../../../src/ui.cpp:2286
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
@@ -519,248 +382,304 @@ msgstr ""
"Перевод был записан и будет начислен получателю,\n"
"но поле комментария будет пустое."
-#: ../../../ui.cpp:2328
+#: ../../../src/ui.cpp:2295
msgid "Payment was sent, but an invalid response was received"
msgstr "Платёж отправлен, но был получен неверный отклик"
-#: ../../../ui.cpp:2334
+#: ../../../src/ui.cpp:2301
msgid "Payment completed"
msgstr "Платёж проведён"
-#: ../../../ui.cpp:2365
-#: ../../../ui.cpp:2511
-#: ../../../ui.cpp:2548
+#: ../../../src/ui.cpp:2332
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Name"
msgstr "Имя"
-#: ../../../ui.cpp:2366
-#: ../../../ui.cpp:2511
-#: ../../../ui.cpp:2548
+#: ../../../src/ui.cpp:2333
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2515
msgid "Address"
msgstr "Адрес"
-#: ../../../ui.cpp:2368
-#: ../../../ui.cpp:2523
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2490
msgid "Label"
msgstr "Метка"
-#: ../../../ui.cpp:2369
-#: ../../../uibase.cpp:902
+#: ../../../src/ui.cpp:2336
+#: ../../../src/uibase.cpp:837
msgid "Bitcoin Address"
msgstr "Адрес Bitcoin"
-#: ../../../ui.cpp:2493
+#: ../../../src/ui.cpp:2460
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Это один из ваших собственных адресов для получения платежей, он не может быть внесён в адресную книгу. "
-#: ../../../ui.cpp:2511
-#: ../../../ui.cpp:2517
+#: ../../../src/ui.cpp:2478
+#: ../../../src/ui.cpp:2484
msgid "Edit Address"
msgstr "Правка адреса"
-#: ../../../ui.cpp:2523
+#: ../../../src/ui.cpp:2490
msgid "Edit Address Label"
msgstr "Правка метки адреса"
-#: ../../../ui.cpp:2548
-#: ../../../ui.cpp:2554
+#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2521
msgid "Add Address"
msgstr "Добавить адрес"
-#: ../../../ui.cpp:2630
+#: ../../../src/ui.cpp:2598
msgid "Bitcoin"
msgstr "Bitcoin"
-#: ../../../ui.cpp:2632
+#: ../../../src/ui.cpp:2600
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Генерация"
-#: ../../../ui.cpp:2634
+#: ../../../src/ui.cpp:2602
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (не подключен)"
-#: ../../../ui.cpp:2711
+#: ../../../src/ui.cpp:2681
msgid "&Open Bitcoin"
msgstr "&Открыть Bitcoin"
-#: ../../../ui.cpp:2712
+#: ../../../src/ui.cpp:2682
+msgid "&Send Bitcoins"
+msgstr "&Отправить Bitcoins"
+
+#: ../../../src/ui.cpp:2683
msgid "O&ptions..."
msgstr "О&пции..."
-#: ../../../ui.cpp:2713
-#: ../../../uibase.cpp:32
-msgid "&Generate Coins"
-msgstr "&Генерировать монеты"
-
-#: ../../../ui.cpp:2716
-#: ../../../uibase.cpp:25
+#: ../../../src/ui.cpp:2686
+#: ../../../src/uibase.cpp:25
msgid "E&xit"
msgstr "&Выход"
-#: ../../../ui.cpp:2931
+#: ../../../src/ui.cpp:2902
msgid "Program has crashed and will terminate. "
msgstr "Сбой программы, завершение. "
-#: ../../../uibase.cpp:28
+#: ../../../src/main.cpp:1868
+msgid "Warning: Disk space is low "
+msgstr "Внимание: мало места на диске "
+
+#: ../../../src/main.cpp:3992
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Ошибка: Этот перевод требует уплаты комиссии минимум в %s, так как имеет большой объём, сложность или использует недавно полученные средства "
+
+#: ../../../src/main.cpp:3994
+msgid "Error: Transaction creation failed "
+msgstr "Ошибка: не удалось создать перевод "
+
+#: ../../../src/main.cpp:4003
+msgid "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."
+msgstr "Перевод был отклонен. Это могло произойти, если некоторые из монет в вашем кошельке уже были потрачены, например, если вы использовали копию wallet.dat, и монеты были потрачены в копии, но не отмечены израсходованными здесь."
+
+#: ../../../src/main.cpp:4016
+msgid "Invalid amount"
+msgstr "Неверное количество"
+
+#: ../../../src/main.cpp:4023
+msgid "Invalid bitcoin address"
+msgstr "Неверный адрес bitcoin"
+
+#: ../../../src/rpc.cpp:1800
+#: ../../../src/rpc.cpp:1802
+#, c-format
+msgid "To use the %s option"
+msgstr "Чтобы использовать опцию %s"
+
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Внимание: %s, вы должны установить rpcpassword=<пароль>\n"
+"в конфигурационном файле: %s\n"
+"Если файл не существует, создайте его с правами \"чтение только владельцем\".\n"
+
+#: ../../../src/rpc.cpp:1972
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Вы должны установить rpcpassword=<пароль> в конфигурационном файле:\n"
+"%s\n"
+"Если файл не существует, создайте его с правами \"чтение только владельцем\"."
+
+#: ../../../src/util.cpp:865
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Внимание: пожалуйста, проверьте дату и время на вашем компьютере. Если часы идут неверно, Bitcoin не будет работать правильно."
+
+#: ../../../src/util.cpp:898
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/uibase.cpp:28
msgid "&File"
msgstr "&Файл"
-#: ../../../uibase.cpp:36
+#: ../../../src/uibase.cpp:32
msgid "&Your Receiving Addresses..."
msgstr "&Ваши адреса получения..."
-#: ../../../uibase.cpp:40
+#: ../../../src/uibase.cpp:36
msgid "&Options..."
msgstr "&Опции"
-#: ../../../uibase.cpp:43
+#: ../../../src/uibase.cpp:39
msgid "&Settings"
msgstr "&Настройки"
-#: ../../../uibase.cpp:47
+#: ../../../src/uibase.cpp:43
msgid "&About..."
msgstr "&О программе..."
-#: ../../../uibase.cpp:50
+#: ../../../src/uibase.cpp:46
msgid "&Help"
msgstr "&Справка"
-#: ../../../uibase.cpp:60
+#: ../../../src/uibase.cpp:56
msgid "Address Book"
msgstr "Адресная книга"
-#: ../../../uibase.cpp:75
+#: ../../../src/uibase.cpp:69
msgid "Your Bitcoin Address:"
msgstr "Ваш адрес Bitcoin:"
-#: ../../../uibase.cpp:82
+#: ../../../src/uibase.cpp:76
msgid " &New... "
msgstr " &Новый... "
-#: ../../../uibase.cpp:85
-#: ../../../uibase.cpp:845
-#: ../../../uibase.cpp:948
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
msgid " &Copy to Clipboard "
msgstr " &Копировать в буфер обмена "
-#: ../../../uibase.cpp:99
+#: ../../../src/uibase.cpp:93
msgid "Balance:"
msgstr "Баланс:"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " All"
msgstr " Все"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " Sent"
msgstr " Отправленные"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " Received"
msgstr " Полученные"
-#: ../../../uibase.cpp:115
+#: ../../../src/uibase.cpp:109
msgid " In Progress"
msgstr " В процессе"
-#: ../../../uibase.cpp:136
+#: ../../../src/uibase.cpp:130
msgid "All Transactions"
msgstr "Все переводы"
-#: ../../../uibase.cpp:147
+#: ../../../src/uibase.cpp:141
msgid "Sent/Received"
msgstr "Отправленные/Полученные"
-#: ../../../uibase.cpp:158
+#: ../../../src/uibase.cpp:152
msgid "Sent"
msgstr "Отправленные"
-#: ../../../uibase.cpp:169
+#: ../../../src/uibase.cpp:163
msgid "Received"
msgstr "Полученные"
-#: ../../../uibase.cpp:312
-#: ../../../uibase.cpp:473
-#: ../../../uibase.cpp:574
-#: ../../../uibase.cpp:787
-#: ../../../uibase.cpp:848
-#: ../../../uibase.cpp:957
-#: ../../../uibase.cpp:1046
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
msgid "OK"
msgstr "ОК"
-#: ../../../uibase.cpp:355
-msgid "Optional transaction fee you give to the nodes that process your transactions."
-msgstr "Необязательная комиссия, которую вы даёте узлам, проводящим ваш перевод."
-
-#: ../../../uibase.cpp:364
-msgid "Transaction fee:"
-msgstr "Комиссия:"
-
-#: ../../../uibase.cpp:380
-msgid "&Limit coin generation to"
-msgstr "&Ограничить генерацию монет до"
-
-#: ../../../uibase.cpp:387
-msgid "processors"
-msgstr "процессоров"
-
-#: ../../../uibase.cpp:393
+#: ../../../src/uibase.cpp:345
msgid "&Start Bitcoin on system startup"
msgstr "&Запускать Bitcoin при старте системы"
-#: ../../../uibase.cpp:397
+#: ../../../src/uibase.cpp:348
msgid "&Minimize to the tray instead of the taskbar"
msgstr "&Сворачивать в трей вместо панели задач"
-#: ../../../uibase.cpp:401
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Использовать &UPnP"
+
+#: ../../../src/uibase.cpp:354
msgid "M&inimize to the tray on close"
msgstr "С&ворачивать в трей при закрытии"
-#: ../../../uibase.cpp:408
+#: ../../../src/uibase.cpp:360
msgid "&Connect through socks4 proxy: "
msgstr "&Подключаться через socks4 прокси: "
-#: ../../../uibase.cpp:420
+#: ../../../src/uibase.cpp:371
msgid "Proxy &IP:"
-msgstr "IP п&рокси:"
+msgstr "IP п&рокси-сервера:"
-#: ../../../uibase.cpp:428
+#: ../../../src/uibase.cpp:379
msgid " &Port:"
msgstr " &Порт"
-#: ../../../uibase.cpp:450
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Необязательная комиссия за килобайт обеспечивает приоритет обработки перевода. Большинство транзакций имеют размер в 1КБ. Рекомендуется значение в 0.01."
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Комиссия:"
+
+#: ../../../src/uibase.cpp:420
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
-#: ../../../uibase.cpp:454
+#: ../../../src/uibase.cpp:424
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
-#: ../../../uibase.cpp:476
-#: ../../../uibase.cpp:729
-#: ../../../uibase.cpp:792
-#: ../../../uibase.cpp:851
-#: ../../../uibase.cpp:960
-#: ../../../uibase.cpp:1049
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
msgid "Cancel"
msgstr "Отмена"
-#: ../../../uibase.cpp:479
+#: ../../../src/uibase.cpp:449
msgid "&Apply"
msgstr "&Применить"
-#: ../../../uibase.cpp:540
+#: ../../../src/uibase.cpp:508
msgid "Bitcoin "
msgstr "Bitcoin "
-#: ../../../uibase.cpp:546
+#: ../../../src/uibase.cpp:514
msgid "version"
msgstr "версия"
-#: ../../../uibase.cpp:557
+#: ../../../src/uibase.cpp:525
msgid ""
-"Copyright (c) 2009-2010 Bitcoin Developers\n"
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -782,47 +701,39 @@ msgstr ""
"OpenSSL Toolkit (http://www.openssl.org/), и криптографическое ПО, написанное\n"
"Eric Young (eay@cryptsoft.com) и UPnP программного обеспечения, написанного Thomas Bernard."
-#: ../../../uibase.cpp:613
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
-msgstr "Введите адрес Bitcoin (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) или IP адрес (напр. 123.45.6.7)"
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Введите адрес Bitcoin (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-#: ../../../uibase.cpp:627
+#: ../../../src/uibase.cpp:595
msgid "Pay &To:"
msgstr "&Кому:"
-#: ../../../uibase.cpp:642
+#: ../../../src/uibase.cpp:610
msgid "&Paste"
msgstr "&Вставить"
-#: ../../../uibase.cpp:645
+#: ../../../src/uibase.cpp:613
msgid " Address &Book..."
msgstr " А&дресная книга..."
-#: ../../../uibase.cpp:652
+#: ../../../src/uibase.cpp:620
msgid "&Amount:"
msgstr "К&оличество:"
-#: ../../../uibase.cpp:662
+#: ../../../src/uibase.cpp:630
msgid "T&ransfer:"
msgstr "&Передача:"
-#: ../../../uibase.cpp:668
+#: ../../../src/uibase.cpp:636
msgid " Standard"
msgstr " Стандарт"
-#: ../../../uibase.cpp:690
-msgid "&From:"
-msgstr "О&т:"
-
-#: ../../../uibase.cpp:707
-msgid "&Message:"
-msgstr "&Сообщение:"
-
-#: ../../../uibase.cpp:724
+#: ../../../src/uibase.cpp:663
msgid "&Send"
msgstr "Отп&равить"
-#: ../../../uibase.cpp:776
+#: ../../../src/uibase.cpp:711
msgid ""
"\n"
"\n"
@@ -832,57 +743,272 @@ msgstr ""
"\n"
"Подключение..."
-#: ../../../uibase.cpp:826
+#: ../../../src/uibase.cpp:761
msgid "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. The highlighted address is displayed in the main window."
msgstr "Это ваши адреса для получения платежей. Вы можете использовать разные для каждого отправителя, чтобы отслеживать, кто вам платит. Выделенный адрес отображается в главном окне."
-#: ../../../uibase.cpp:839
-#: ../../../uibase.cpp:951
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
msgid "&Edit..."
msgstr "&Правка..."
-#: ../../../uibase.cpp:842
-#: ../../../uibase.cpp:954
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
msgid " &New Address... "
msgstr " &Новый адрес... "
-#: ../../../uibase.cpp:914
+#: ../../../src/uibase.cpp:849
msgid "Sending"
msgstr "Отправка"
-#: ../../../uibase.cpp:922
+#: ../../../src/uibase.cpp:857
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
msgstr "Это ваши адреса для получения платежей. Вы можете использовать разные для каждого отправителя, чтобы отслеживать, кто вам платит. Выделенный адрес отображается в главном окне."
-#: ../../../uibase.cpp:935
+#: ../../../src/uibase.cpp:870
msgid "Receiving"
msgstr "Получение"
-#: ../../../uibase.cpp:945
+#: ../../../src/uibase.cpp:880
msgid "&Delete"
msgstr "&Удалить"
-#: ../../../util.cpp:807
-msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
-msgstr "Внимание: пожалуйста, проверьте дату и время на вашем компьютере. Если часы идут неверно, Bitcoin не будет работать правильно."
+#: ../../../src/init.cpp:147
+msgid "Bitcoin version"
+msgstr "Bitcoin версия"
+
+#: ../../../src/init.cpp:148
+msgid "Usage:"
+msgstr "Использование"
+
+#: ../../../src/init.cpp:150
+msgid "Send command to -server or bitcoind\n"
+msgstr "Отправить команду bitcoin, запущенному с -server\n"
+
+#: ../../../src/init.cpp:151
+msgid "List commands\n"
+msgstr "Список команд\n"
+
+#: ../../../src/init.cpp:152
+msgid "Get help for a command\n"
+msgstr "Получить помощь для команды\n"
+
+#: ../../../src/init.cpp:153
+msgid "Options:\n"
+msgstr "Параметры:\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Укажите конфигурационный файл (по умолчанию: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:155
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Укажите конфигурационный файл (по умолчанию: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:156
+msgid "Generate coins\n"
+msgstr "Генерировать монеты\n"
+
+#: ../../../src/init.cpp:157
+msgid "Don't generate coins\n"
+msgstr "Не генерировать монеты\n"
+
+#: ../../../src/init.cpp:158
+msgid "Start minimized\n"
+msgstr "Запускать свёрнутым\n"
+
+#: ../../../src/init.cpp:159
+msgid "Specify data directory\n"
+msgstr "Указать каталог данных\n"
+
+#: ../../../src/init.cpp:160
+msgid "Connect through socks4 proxy\n"
+msgstr "Подключаться через socks4 прокси\n"
+
+#: ../../../src/init.cpp:161
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Использовать DNS для добавления узлов и соединения\n"
-#: ../../../uibase.h:149
+#: ../../../src/init.cpp:162
+msgid "Add a node to connect to\n"
+msgstr "Добавить узел для подключения\n"
+
+#: ../../../src/init.cpp:163
+msgid "Connect only to the specified node\n"
+msgstr "Подключаться только к указанному узлу\n"
+
+#: ../../../src/init.cpp:164
+msgid "Don't accept connections from outside\n"
+msgstr "Не принимать входящие соединения\n"
+
+#: ../../../src/init.cpp:167
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Не использовать UPnP для отображения порта входящих соединений\n"
+
+#: ../../../src/init.cpp:169
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Использовать UPnP для отображения порта входящих соединений\n"
+
+#: ../../../src/init.cpp:172
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Комиссия за 1 килобайт отправляемых транзакций\n"
+
+#: ../../../src/init.cpp:174
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Принимать команды из командной строки и через JSON-RPC\n"
+
+#: ../../../src/init.cpp:177
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Запустить в фоне как демон и принимать команды\n"
+
+#: ../../../src/init.cpp:179
+msgid "Use the test network\n"
+msgstr "Использовать тестовую сеть (testnet)\n"
+
+#: ../../../src/init.cpp:180
+msgid "Username for JSON-RPC connections\n"
+msgstr "Имя пользователя для JSON-RPC\n"
+
+#: ../../../src/init.cpp:181
+msgid "Password for JSON-RPC connections\n"
+msgstr "Пароль для JSON-RPC\n"
+
+#: ../../../src/init.cpp:182
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Порт входящих соединений JSON-RPC (по умолчанию 8332)\n"
+
+#: ../../../src/init.cpp:183
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Разрешить соединения JSON-RPC со следующих IP-адресов\n"
+
+#: ../../../src/init.cpp:184
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Посылать команды узлу с указанным адресом (по умолчанию 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:185
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Установить размер пула адресов (по умолчанию 100)\n"
+
+#: ../../../src/init.cpp:181
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Просканировать цепочку блоков в поисках утерянных переводов\n"
+
+#: ../../../src/init.cpp:182
+msgid "Purge all transactions from wallet and rescan\n"
+msgstr "Удалить все транзакции из кошелька и пересканировать цепочку блоков в поисках транзакций\n"
+
+#: ../../../src/init.cpp:190
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"Опции SSL: (прочтите документацию для правильной настройки)\n"
+
+#: ../../../src/init.cpp:191
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Использовать OpenSSL (протокол https) для соединений JSON-RPC\n"
+
+#: ../../../src/init.cpp:192
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Файл сертификата сервера (по умолчанию server.cert)\n"
+
+#: ../../../src/init.cpp:193
+msgid "Server private key (default: server.pem)\n"
+msgstr "Приватный ключ сервера (по умолчанию server.pem)\n"
+
+#: ../../../src/init.cpp:194
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Приемлемые шифры (по умолчанию TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:198
+msgid "This help message\n"
+msgstr "Эта справка\n"
+
+#: ../../../src/init.cpp:335
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Не удаётся получить блокировку каталога с данными %s. Возможно, Bitcoin уже запущен."
+
+#: ../../../src/init.cpp:361
+msgid "Error loading addr.dat \n"
+msgstr "Ошибка загрузки addr.dat \n"
+
+#: ../../../src/init.cpp:367
+msgid "Error loading blkindex.dat \n"
+msgstr "Ошибка загрузки blkindex.dat \n"
+
+#: ../../../src/init.cpp:374
+msgid "Error loading wallet.dat \n"
+msgstr "Ошибка загрузки wallet.dat \n"
+
+#: ../../../src/init.cpp:454
+msgid "Invalid -proxy address"
+msgstr "Неверный адрес -proxy"
+
+#: ../../../src/init.cpp:477
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Неверное значение для -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:481
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Внимание: -paytxfee установлено в очень большое значение. Это комиссия, которую вы будете платить при переводе."
+
+#: ../../../src/uibase.h:147
msgid "Transaction Details"
msgstr "Подробности транзакции"
-#: ../../../uibase.h:202
+#: ../../../src/uibase.h:199
msgid "Options"
msgstr "Опции"
-#: ../../../uibase.h:230
+#: ../../../src/uibase.h:228
msgid "About Bitcoin"
msgstr "О Bitcoin"
-#: ../../../uibase.h:340
+#: ../../../src/uibase.h:337
msgid "Your Bitcoin Addresses"
msgstr "Ваш адрес Bitcoin"
#~ msgid ""
+#~ "Error: This is an oversized transaction that requires a transaction fee "
+#~ "of %s "
+#~ msgstr ""
+#~ "Ошибка: этот перевод слишком большого размера, который требует комиссию "
+#~ "%s "
+
+#~ msgid "version %s%s BETA"
+#~ msgstr "версия %s%s бета"
+
+#~ msgid "n/a"
+#~ msgstr "н/д"
+
+#~ msgid "Can't include a message when sending to a Bitcoin address"
+#~ msgstr "Не удаётся включить сообщение при отправке на адрес Bitcoin"
+
+#~ msgid ""
+#~ "This is an oversized transaction that requires a transaction fee of %s"
+#~ msgstr "Это слишком большой перевод, который требует комиссию в размере %s"
+
+#~ msgid ""
+#~ "Optional transaction fee you give to the nodes that process your "
+#~ "transactions."
+#~ msgstr ""
+#~ "Необязательная комиссия, которую вы даёте узлам, проводящим ваш перевод."
+
+#~ msgid "&Limit coin generation to"
+#~ msgstr "&Ограничить генерацию монет до"
+
+#~ msgid "processors"
+#~ msgstr "процессоров"
+
+#~ msgid "&From:"
+#~ msgstr "О&т:"
+
+#~ msgid "&Message:"
+#~ msgstr "&Сообщение:"
+
+#~ msgid ""
#~ "It's good policy to use a new address for each payment you receive.\n"
#~ "\n"
#~ "Label"
diff --git a/locale/sv/LC_MESSAGES/bitcoin.mo b/locale/sv/LC_MESSAGES/bitcoin.mo
new file mode 100644
index 0000000000..b61914cb4b
--- /dev/null
+++ b/locale/sv/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/sv/LC_MESSAGES/bitcoin.po b/locale/sv/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..dc635f3139
--- /dev/null
+++ b/locale/sv/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,973 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-07-03 10:40+0100\n"
+"PO-Revision-Date: 2011-07-03 15:13+0100\n"
+"Last-Translator: Codler <github>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../init.cpp:162
+msgid "Bitcoin version"
+msgstr "Bitcoin version"
+
+#: ../../../init.cpp:163
+msgid "Usage:"
+msgstr "Användning:"
+
+#: ../../../init.cpp:165
+msgid "Send command to -server or bitcoind\n"
+msgstr "Skicka kommando till -server eller bitcoind\n"
+
+#: ../../../init.cpp:166
+msgid "List commands\n"
+msgstr "Lista kommandon\n"
+
+#: ../../../init.cpp:167
+msgid "Get help for a command\n"
+msgstr "Få hjälp om kommandon\n"
+
+#: ../../../init.cpp:168
+msgid "Options:\n"
+msgstr "Val:\n"
+
+#: ../../../init.cpp:169
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Ange konfigurationsfil (standard: bitcoin.conf)\n"
+
+#: ../../../init.cpp:170
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Ange pid-fil (standard: bitcoind.pid)\n"
+
+#: ../../../init.cpp:171
+msgid "Generate coins\n"
+msgstr "Generera mynt\n"
+
+#: ../../../init.cpp:172
+msgid "Don't generate coins\n"
+msgstr "Generera inte mynt\n"
+
+#: ../../../init.cpp:173
+msgid "Start minimized\n"
+msgstr "Starta minimerad\n"
+
+#: ../../../init.cpp:174
+msgid "Specify data directory\n"
+msgstr "Ange data mappen\n"
+
+#: ../../../init.cpp:175
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Ange timeout för anslutning (i millisekunder)\n"
+
+#: ../../../init.cpp:176
+msgid "Connect through socks4 proxy\n"
+msgstr "Anslut via socks4 proxy\n"
+
+#: ../../../init.cpp:177
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Tillåt DNS uppslagningar för addnode och connect\n"
+
+#: ../../../init.cpp:178
+msgid "Add a node to connect to\n"
+msgstr "Lägg till en nod att ansluta till\n"
+
+#: ../../../init.cpp:179
+msgid "Connect only to the specified node\n"
+msgstr "Anslut endast till specifik nod\n"
+
+#: ../../../init.cpp:180
+msgid "Don't accept connections from outside\n"
+msgstr "Acceptera ej anslutningar från utsidan\n"
+
+#: ../../../init.cpp:183
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Försöker inte använda UPnP till avslyssningsport\n"
+
+#: ../../../init.cpp:185
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Försöker använda UPnP till avlyssningsport\n"
+
+#: ../../../init.cpp:188
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Avgift per KB som läggs på transaktionen när du sänder\n"
+
+#: ../../../init.cpp:190
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Accepterar kommandorad och JSON-RPC kommando\n"
+
+#: ../../../init.cpp:193
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Kör i bakgrund som daemon och accepterar kommando\n"
+
+#: ../../../init.cpp:195
+msgid "Use the test network\n"
+msgstr "Använd test nätverk\n"
+
+#: ../../../init.cpp:196
+msgid "Username for JSON-RPC connections\n"
+msgstr "Användarnamn till JSON-RPC anslutning\n"
+
+#: ../../../init.cpp:197
+msgid "Password for JSON-RPC connections\n"
+msgstr "Lösenord till JSON-RPC anslutning\n"
+
+#: ../../../init.cpp:198
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Lyssnar på JSON-RPC anslutningar på <port> (standard: 8332)\n"
+
+#: ../../../init.cpp:199
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Tillåt JSON-RPC anslutningar från specifik IP-adress\n"
+
+#: ../../../init.cpp:200
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Skicka kommando till noden som körs på <ip> (standard: 127.0.0.1)\n"
+
+#: ../../../init.cpp:201
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Sätt nyckel pool storlek till <n> (standard: 100)\n"
+
+#: ../../../init.cpp:202
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Scanna om block kedja efter saknade plånbokstransaktioner\n"
+
+#: ../../../init.cpp:206
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL val: (Se på Bitcoin Wiki för SSL installation instruktioner)\n"
+
+#: ../../../init.cpp:207
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Använd OpenSSL (https) till JSON-RPC anslutningar\n"
+
+#: ../../../init.cpp:208
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Server certifikatfil (standard: server.cert)\n"
+
+#: ../../../init.cpp:209
+msgid "Server private key (default: server.pem)\n"
+msgstr "Server privat nyckel (standard: server.pem)\n"
+
+#: ../../../init.cpp:210
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Acceptabla krypteringar (standard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../init.cpp:214
+msgid "This help message\n"
+msgstr "Detta hjälpmeddelande\n"
+
+#: ../../../init.cpp:351
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "Kan inte sätta lås på data mappen %s. Bitcoin körs troligen redan."
+
+#: ../../../init.cpp:377
+msgid "Error loading addr.dat \n"
+msgstr "Fel vid laddning av addr.dat \n"
+
+#: ../../../init.cpp:383
+msgid "Error loading blkindex.dat \n"
+msgstr "Fel vid laddning av blkindex.dat \n"
+
+#: ../../../init.cpp:391
+msgid "Error loading wallet.dat \n"
+msgstr "Fel vid laddning av wallet.dat \n"
+
+#: ../../../init.cpp:481
+msgid "Invalid -proxy address"
+msgstr "Ogiltig -proxy adress"
+
+#: ../../../init.cpp:506
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Ogiltig belopp på -paytxfee=<belopp>"
+
+#: ../../../init.cpp:510
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "Varning: -paytxfee är satt väldigt högt. Denna är transaktionsavgiften som du kommer att betala om du skickar en transaktion."
+
+#: ../../../main.cpp:1430
+msgid "Warning: Disk space is low "
+msgstr "Varning: Diskutrymme är låg "
+
+#: ../../../net.cpp:1598
+#, c-format
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "Det gick inte att binda till port %d på denna dator. Bitcoin körs troligen redan."
+
+#: ../../../rpc.cpp:1828
+#: ../../../rpc.cpp:1830
+#, c-format
+msgid "To use the %s option"
+msgstr "För att använda %s val"
+
+#: ../../../rpc.cpp:1832
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"Varning: %s, du måste sätta rpcpassword=<lösenord>\n"
+"i konfigurationsfilen: %s\n"
+"Om filen inte existerar, skapa med ägare med filbehörigheten -readable-only.\n"
+
+#: ../../../rpc.cpp:2005
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"Du måste sätta rpcpassword=<lösenord> i konfigurationsfilen:\n"
+"%s\n"
+"Om filen inte existerar, skapa med ägare med filbehörighete -readable-only."
+
+#: ../../../ui.cpp:216
+#, c-format
+msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
+msgstr "Denna transaktion är över storleksbegränsningen. Du kan fortfarande skicka mot en avgift på %s, som går till noderna som bearbetar din transaktion och hjälper att stödja nätverket. Vill du fortfarande betala avgiften?"
+
+#: ../../../ui.cpp:316
+msgid "Status"
+msgstr "Status"
+
+#: ../../../ui.cpp:317
+msgid "Date"
+msgstr "Datum"
+
+#: ../../../ui.cpp:318
+msgid "Description"
+msgstr "Beskrivning"
+
+#: ../../../ui.cpp:319
+msgid "Debit"
+msgstr "Debet"
+
+#: ../../../ui.cpp:320
+msgid "Credit"
+msgstr "Kredit"
+
+#: ../../../ui.cpp:526
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Öppen för %d block"
+
+#: ../../../ui.cpp:528
+#, c-format
+msgid "Open until %s"
+msgstr "Öppen tills %s"
+
+#: ../../../ui.cpp:534
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/offline?"
+
+#: ../../../ui.cpp:536
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/obekräftade"
+
+#: ../../../ui.cpp:538
+#, c-format
+msgid "%d confirmations"
+msgstr "%d bekräftelser"
+
+#: ../../../ui.cpp:623
+msgid "Generated"
+msgstr "Genererad"
+
+#: ../../../ui.cpp:631
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Genererad (%s mognar om %d block)"
+
+#: ../../../ui.cpp:635
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "Genererad - Varning: Denna block har inte blivit mottagen av någon annan nod och kommer troligtvis inte bli accepterad"
+
+#: ../../../ui.cpp:639
+msgid "Generated (not accepted)"
+msgstr "Genererad (ej accepterad)"
+
+#: ../../../ui.cpp:649
+msgid "From: "
+msgstr "Från: "
+
+#: ../../../ui.cpp:673
+msgid "Received with: "
+msgstr "Mottagen med: "
+
+#: ../../../ui.cpp:719
+msgid "Payment to yourself"
+msgstr "Betalning till dig själv"
+
+#: ../../../ui.cpp:753
+msgid "To: "
+msgstr "Till: "
+
+#: ../../../ui.cpp:1068
+msgid " Generating"
+msgstr " Generering"
+
+#: ../../../ui.cpp:1070
+msgid "(not connected)"
+msgstr "(inte ansluten)"
+
+#: ../../../ui.cpp:1073
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d anslutningar %d block %d transaktioner"
+
+#: ../../../ui.cpp:1178
+#: ../../../ui.cpp:2577
+msgid "New Receiving Address"
+msgstr "Ny Mottagningsadress"
+
+#: ../../../ui.cpp:1179
+#: ../../../ui.cpp:2578
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Du borde använda en ny adress för varje betalning som du mottagit.\n"
+"\n"
+"Etikett"
+
+#: ../../../ui.cpp:1252
+msgid "<b>Status:</b> "
+msgstr "<b>Status:</b> "
+
+#: ../../../ui.cpp:1257
+msgid ", has not been successfully broadcast yet"
+msgstr ", har inte lyckats broadcast än"
+
+#: ../../../ui.cpp:1259
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", broadcast genom %d nod"
+
+#: ../../../ui.cpp:1261
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", broadcast genom %d noder"
+
+#: ../../../ui.cpp:1265
+msgid "<b>Date:</b> "
+msgstr "<b>Datum:</b> "
+
+#: ../../../ui.cpp:1273
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Källa:</b> Genererad<br>"
+
+#: ../../../ui.cpp:1279
+#: ../../../ui.cpp:1297
+msgid "<b>From:</b> "
+msgstr "<b>Från:</b> "
+
+#: ../../../ui.cpp:1297
+msgid "unknown"
+msgstr "okänd"
+
+#: ../../../ui.cpp:1298
+#: ../../../ui.cpp:1322
+#: ../../../ui.cpp:1381
+msgid "<b>To:</b> "
+msgstr "<b>Till:</b> "
+
+#: ../../../ui.cpp:1301
+msgid " (yours, label: "
+msgstr " (din, etikett: "
+
+#: ../../../ui.cpp:1303
+msgid " (yours)"
+msgstr " (ditt)"
+
+#: ../../../ui.cpp:1340
+#: ../../../ui.cpp:1352
+#: ../../../ui.cpp:1398
+#: ../../../ui.cpp:1415
+msgid "<b>Credit:</b> "
+msgstr "<b>Kredit:</b> "
+
+#: ../../../ui.cpp:1342
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s mognar om %d block)"
+
+#: ../../../ui.cpp:1344
+msgid "(not accepted)"
+msgstr "(ej accepterad)"
+
+#: ../../../ui.cpp:1389
+#: ../../../ui.cpp:1397
+#: ../../../ui.cpp:1412
+msgid "<b>Debit:</b> "
+msgstr "<b>Debet:</b> "
+
+#: ../../../ui.cpp:1403
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Transaktionsavgift:</b> "
+
+#: ../../../ui.cpp:1419
+msgid "<b>Net amount:</b> "
+msgstr "<b>Nät belopp:</b> "
+
+#: ../../../ui.cpp:1426
+msgid "Message:"
+msgstr "Meddelande:"
+
+#: ../../../ui.cpp:1428
+msgid "Comment:"
+msgstr "Kommentar:"
+
+#: ../../../ui.cpp:1431
+msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
+msgstr "Genererad mynt måste vänta 120 block innan dem kan användas.När du genererat denna block, skickades en broadcast till nätet och lades till block kedjan. Om den misslyckas att lägga till kedjan så kommer det ändras till \"not accepted\" och är icke brukbar. Detta kan hända om en annan nod genererat en block några sekunder efter din."
+
+#: ../../../ui.cpp:1611
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Kan inte skriva autostart/bitcoin.desktop fil"
+
+#: ../../../ui.cpp:1647
+msgid "Main"
+msgstr "Allmänt"
+
+#: ../../../ui.cpp:1657
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Starta Bitcoin vid system uppstart"
+
+#: ../../../ui.cpp:1664
+msgid "&Minimize on close"
+msgstr "&Minimera vid stängning"
+
+#: ../../../ui.cpp:1806
+#, c-format
+msgid "version %s"
+msgstr "version %s"
+
+#: ../../../ui.cpp:1929
+msgid "Error in amount "
+msgstr "Fel i belopp "
+
+#: ../../../ui.cpp:1929
+#: ../../../ui.cpp:1934
+#: ../../../ui.cpp:1939
+#: ../../../ui.cpp:1974
+#: ../../../uibase.cpp:55
+msgid "Send Coins"
+msgstr "Skicka mynt"
+
+#: ../../../ui.cpp:1934
+msgid "Amount exceeds your balance "
+msgstr "Belopp överskrider din balans "
+
+#: ../../../ui.cpp:1939
+msgid "Total exceeds your balance when the "
+msgstr "Totalt överskrider din balans när "
+
+#: ../../../ui.cpp:1939
+msgid " transaction fee is included "
+msgstr " transaktionsavgift är inkluderad "
+
+#: ../../../ui.cpp:1957
+msgid "Payment sent "
+msgstr "Betalning skickad "
+
+#: ../../../ui.cpp:1957
+#: ../../../ui.cpp:1962
+#: ../../../ui.cpp:2108
+#: ../../../ui.cpp:2261
+#: ../../../wallet.cpp:924
+msgid "Sending..."
+msgstr "Skickar..."
+
+#: ../../../ui.cpp:1974
+msgid "Invalid address "
+msgstr "Ogiltig adress "
+
+#: ../../../ui.cpp:2029
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Skickar %s till %s"
+
+#: ../../../ui.cpp:2102
+#: ../../../ui.cpp:2135
+msgid "CANCELLED"
+msgstr "AVBRUTEN"
+
+#: ../../../ui.cpp:2106
+msgid "Cancelled"
+msgstr "Avbruten"
+
+#: ../../../ui.cpp:2108
+msgid "Transfer cancelled "
+msgstr "Överföring avbruten "
+
+#: ../../../ui.cpp:2161
+msgid "Error: "
+msgstr "Fel: "
+
+#: ../../../ui.cpp:2175
+#: ../../../ui.cpp:2246
+#: ../../../wallet.cpp:943
+msgid "Insufficient funds"
+msgstr "Otillräckligt med pengar"
+
+#: ../../../ui.cpp:2180
+msgid "Connecting..."
+msgstr "Ansluter..."
+
+#: ../../../ui.cpp:2185
+msgid "Unable to connect"
+msgstr "Det gick inte att ansluta"
+
+#: ../../../ui.cpp:2190
+msgid "Requesting public key..."
+msgstr "Efterfrågar publik nyckel..."
+
+#: ../../../ui.cpp:2202
+msgid "Received public key..."
+msgstr "Mottagen publik nyckel..."
+
+#: ../../../ui.cpp:2216
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Mottagaren accepterar inte transaktioner skickat från IP adress"
+
+#: ../../../ui.cpp:2218
+msgid "Transfer was not accepted"
+msgstr "Överföringen var inte accepterad"
+
+#: ../../../ui.cpp:2227
+msgid "Invalid response received"
+msgstr "Ogiltig respons mottagen"
+
+#: ../../../ui.cpp:2242
+msgid "Creating transaction..."
+msgstr "Skapar transation..."
+
+#: ../../../ui.cpp:2254
+#, c-format
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "Denna transaktion kräver en transaktionsavgift minst %s för dess belopp, komplexitet, eller användning av nyligen mottagna pengar"
+
+#: ../../../ui.cpp:2256
+msgid "Transaction creation failed"
+msgstr "Misslyckades skapa transaktion"
+
+#: ../../../ui.cpp:2263
+msgid "Transaction aborted"
+msgstr "Transaktion avbruten"
+
+#: ../../../ui.cpp:2271
+msgid "Lost connection, transaction cancelled"
+msgstr "Förlorad anslutning, transaktionen avbruten"
+
+#: ../../../ui.cpp:2287
+msgid "Sending payment..."
+msgstr "Skickar betalning..."
+
+#: ../../../ui.cpp:2293
+msgid "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."
+msgstr "Transaktionen blev nekad. Detta kan hända om några av dina mynt i din plånbok var redan spenderad. Till exempel om du använde en kopia av wallet.dat och mynten var redan spenderad i kopian, men som inte var markerad som spenderad här."
+
+#: ../../../ui.cpp:2302
+msgid "Waiting for confirmation..."
+msgstr "Väntar på bekräftelse..."
+
+#: ../../../ui.cpp:2320
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"Betalning var skickat, men mottagaren kunde inte verifiera det.\n"
+"Transaktionen är registrerad och kommer att kreditera mottagaren,\n"
+"men kommentar informationen kommer att vara tom."
+
+#: ../../../ui.cpp:2329
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Betalning var skickad, men en ogiltig respons var mottagen"
+
+#: ../../../ui.cpp:2335
+msgid "Payment completed"
+msgstr "Betalning slutförd"
+
+#: ../../../ui.cpp:2377
+#: ../../../ui.cpp:2525
+#: ../../../ui.cpp:2565
+msgid "Name"
+msgstr "Namn"
+
+#: ../../../ui.cpp:2378
+#: ../../../ui.cpp:2525
+#: ../../../ui.cpp:2565
+msgid "Address"
+msgstr "Adress"
+
+#: ../../../ui.cpp:2380
+#: ../../../ui.cpp:2537
+msgid "Label"
+msgstr "Etikett"
+
+#: ../../../ui.cpp:2381
+#: ../../../uibase.cpp:837
+msgid "Bitcoin Address"
+msgstr "Bitcoin Adress"
+
+#: ../../../ui.cpp:2507
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
+msgstr "Denna är en av dina egna adresser för mottagning av betalningar och kan inte slås in i adressboken. "
+
+#: ../../../ui.cpp:2525
+#: ../../../ui.cpp:2531
+msgid "Edit Address"
+msgstr "Ändra Adress"
+
+#: ../../../ui.cpp:2537
+msgid "Edit Address Label"
+msgstr "Ändra Address Etikett"
+
+#: ../../../ui.cpp:2565
+#: ../../../ui.cpp:2571
+msgid "Add Address"
+msgstr "Lägg till Adress"
+
+#: ../../../ui.cpp:2649
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../ui.cpp:2651
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - Genererar"
+
+#: ../../../ui.cpp:2653
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (ej ansluten)"
+
+#: ../../../ui.cpp:2732
+msgid "&Open Bitcoin"
+msgstr "&Öppna Bitcoin"
+
+#: ../../../ui.cpp:2733
+msgid "&Send Bitcoins"
+msgstr "&Skicka Bitcoins"
+
+#: ../../../ui.cpp:2734
+msgid "O&ptions..."
+msgstr "&Inställningar..."
+
+#: ../../../ui.cpp:2737
+#: ../../../uibase.cpp:25
+msgid "E&xit"
+msgstr "&Avsluta"
+
+#: ../../../ui.cpp:2963
+msgid "Program has crashed and will terminate. "
+msgstr "Programmet har krachat och kommer att avslutas. "
+
+#: ../../../uibase.cpp:28
+msgid "&File"
+msgstr "&Fil"
+
+#: ../../../uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "&Dina Mottagningsadresser..."
+
+#: ../../../uibase.cpp:36
+msgid "&Options..."
+msgstr "&Inställningar..."
+
+#: ../../../uibase.cpp:39
+msgid "&Settings"
+msgstr "&Inställningar"
+
+#: ../../../uibase.cpp:43
+msgid "&About..."
+msgstr "&Om..."
+
+#: ../../../uibase.cpp:46
+msgid "&Help"
+msgstr "&Hjälp"
+
+#: ../../../uibase.cpp:56
+msgid "Address Book"
+msgstr "Adressbok"
+
+#: ../../../uibase.cpp:69
+msgid "Your Bitcoin Address:"
+msgstr "Din Bitcoin Adress:"
+
+#: ../../../uibase.cpp:76
+msgid " &New... "
+msgstr " &Nytt... "
+
+#: ../../../uibase.cpp:79
+#: ../../../uibase.cpp:780
+#: ../../../uibase.cpp:883
+msgid " &Copy to Clipboard "
+msgstr " &Kopiera till Urklipp "
+
+#: ../../../uibase.cpp:93
+msgid "Balance:"
+msgstr "Balans:"
+
+#: ../../../uibase.cpp:109
+msgid " All"
+msgstr " Alla"
+
+#: ../../../uibase.cpp:109
+msgid " Sent"
+msgstr " Skickat"
+
+#: ../../../uibase.cpp:109
+msgid " Received"
+msgstr " Mottagen"
+
+#: ../../../uibase.cpp:109
+msgid " In Progress"
+msgstr " Pågående"
+
+#: ../../../uibase.cpp:130
+msgid "All Transactions"
+msgstr "Alla Transaktioner"
+
+#: ../../../uibase.cpp:141
+msgid "Sent/Received"
+msgstr "Skickat/Mottagen"
+
+#: ../../../uibase.cpp:152
+msgid "Sent"
+msgstr "Skickat"
+
+#: ../../../uibase.cpp:163
+msgid "Received"
+msgstr "Mottagen"
+
+#: ../../../uibase.cpp:302
+#: ../../../uibase.cpp:443
+#: ../../../uibase.cpp:542
+#: ../../../uibase.cpp:722
+#: ../../../uibase.cpp:783
+#: ../../../uibase.cpp:892
+#: ../../../uibase.cpp:981
+msgid "OK"
+msgstr "OK"
+
+#: ../../../uibase.cpp:345
+msgid "&Start Bitcoin on system startup"
+msgstr "&Starta Bitcoin vid system uppstart"
+
+#: ../../../uibase.cpp:348
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Minimerar till systemfältet istället för aktivitetsfält"
+
+#: ../../../uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "Mapp port använder &UPnP"
+
+#: ../../../uibase.cpp:354
+msgid "M&inimize to the tray on close"
+msgstr "M&inimera till systemfältet vid stängning"
+
+#: ../../../uibase.cpp:360
+msgid "&Connect through socks4 proxy: "
+msgstr "&Anslut via socks4 proxy: "
+
+#: ../../../uibase.cpp:371
+msgid "Proxy &IP:"
+msgstr "Proxy &IP:"
+
+#: ../../../uibase.cpp:379
+msgid " &Port:"
+msgstr " &Port:"
+
+#: ../../../uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "Frivillig transaktionsavgift per KB som garanterar att din transaktion bearbetas snabbt. Flesta transaktioner är 1KB. Avgift 0.01 rekommenderas."
+
+#: ../../../uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "Betala transaktionsavgift:"
+
+#: ../../../uibase.cpp:420
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../uibase.cpp:424
+msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
+msgstr ""
+
+#: ../../../uibase.cpp:446
+#: ../../../uibase.cpp:668
+#: ../../../uibase.cpp:727
+#: ../../../uibase.cpp:786
+#: ../../../uibase.cpp:895
+#: ../../../uibase.cpp:984
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: ../../../uibase.cpp:449
+msgid "&Apply"
+msgstr "&Använd"
+
+#: ../../../uibase.cpp:508
+msgid "Bitcoin "
+msgstr "Bitcoin "
+
+#: ../../../uibase.cpp:514
+msgid "version"
+msgstr "version"
+
+#: ../../../uibase.cpp:525
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"Detta är en experimentell mjukvara.\n"
+"\n"
+"Distribuerad under MIT/X11 mjukvarulicens, se medföljande fil \n"
+"license.txt eller http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Denna produkt inkluderar mjukvara utvecklad av OpenSSL Project för användning i \n"
+"OpenSSL Toolkit (http://www.openssl.org/) och kryptografisk mjukvara skriven av \n"
+"Eric Young (eay@cryptsoft.com) och UPnP mjukvara skriven av Thomas Bernard.\n"
+"\n"
+"Översatt av Han Lin Yap."
+
+#: ../../../uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Ange en Bitcoin adress (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../uibase.cpp:595
+msgid "Pay &To:"
+msgstr "Betala &Till:"
+
+#: ../../../uibase.cpp:610
+msgid "&Paste"
+msgstr "&Klistra in"
+
+#: ../../../uibase.cpp:613
+msgid " Address &Book..."
+msgstr " Adress&bok..."
+
+#: ../../../uibase.cpp:620
+msgid "&Amount:"
+msgstr "&Belopp:"
+
+#: ../../../uibase.cpp:630
+msgid "T&ransfer:"
+msgstr "&Överföring:"
+
+#: ../../../uibase.cpp:636
+msgid " Standard"
+msgstr " Standard"
+
+#: ../../../uibase.cpp:663
+msgid "&Send"
+msgstr "&Skicka"
+
+#: ../../../uibase.cpp:711
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Ansluter..."
+
+#: ../../../uibase.cpp:761
+msgid "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. The highlighted address is displayed in the main window."
+msgstr "Dessa är dina Bitcoin adresser för mottagning av betalningar. Du rekommenderas att ge olika till varje avsändare så du kan ha koll på vem som betalar dig. Den markerade adressen visas i huvudfönstret."
+
+#: ../../../uibase.cpp:774
+#: ../../../uibase.cpp:886
+msgid "&Edit..."
+msgstr "&Redigera..."
+
+#: ../../../uibase.cpp:777
+#: ../../../uibase.cpp:889
+msgid " &New Address... "
+msgstr " &Ny Adress... "
+
+#: ../../../uibase.cpp:849
+msgid "Sending"
+msgstr "Skickar"
+
+#: ../../../uibase.cpp:857
+msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
+msgstr "Dessa är dina Bitcoin adresser för mottagning av betalningar. Du kan ge olika till varje avsändare så du kan ha koll på vem som betalar dig. Den markerade adressen visas i huvudfönstret."
+
+#: ../../../uibase.cpp:870
+msgid "Receiving"
+msgstr "Mottagning"
+
+#: ../../../uibase.cpp:880
+msgid "&Delete"
+msgstr "&Ta bort"
+
+#: ../../../util.cpp:874
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "Varning: Var god och kolla att din dator har rätt datum och klockslag. Om din klocka är fel så kommer Bitcoin inte att fungera ordentligt."
+
+#: ../../../util.cpp:908
+msgid "beta"
+msgstr "beta"
+
+#: ../../../wallet.cpp:917
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "Fel: Denna transaktion kräver en transaktionsavgift minst %s för dess belopp, komplexitet, eller användning av nyligen mottagna pengar "
+
+#: ../../../wallet.cpp:919
+msgid "Error: Transaction creation failed "
+msgstr "Fel: Misslyckades att skapa transaktion "
+
+#: ../../../wallet.cpp:928
+msgid "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."
+msgstr "Fel: Transaktionen blev nekad. Detta kan hända om några av dina mynt i din plånbok var redan spenderad. Till exempel om du använde en kopia av wallet.dat och mynten var redan spenderad i kopian, men som inte var markerad som spenderad här."
+
+#: ../../../wallet.cpp:941
+msgid "Invalid amount"
+msgstr "Ogiltig belopp"
+
+#: ../../../wallet.cpp:948
+msgid "Invalid bitcoin address"
+msgstr "Ogiltig bitcoin adress"
+
+#: ../../../uibase.h:147
+msgid "Transaction Details"
+msgstr "Transaktion detaljer"
+
+#: ../../../uibase.h:199
+msgid "Options"
+msgstr "Inställningar"
+
+#: ../../../uibase.h:228
+msgid "About Bitcoin"
+msgstr "Om Bitcoin"
+
+#: ../../../uibase.h:337
+msgid "Your Bitcoin Addresses"
+msgstr "Dina Bitcoin Adresser"
+
diff --git a/locale/zh_cn/LC_MESSAGES/bitcoin.mo b/locale/zh_cn/LC_MESSAGES/bitcoin.mo
new file mode 100644
index 0000000000..87538f01df
--- /dev/null
+++ b/locale/zh_cn/LC_MESSAGES/bitcoin.mo
Binary files differ
diff --git a/locale/zh_cn/LC_MESSAGES/bitcoin.po b/locale/zh_cn/LC_MESSAGES/bitcoin.po
new file mode 100644
index 0000000000..e870a16400
--- /dev/null
+++ b/locale/zh_cn/LC_MESSAGES/bitcoin.po
@@ -0,0 +1,967 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-05-21 14:19+0800\n"
+"PO-Revision-Date: 2011-05-28 17:08+0800\n"
+"Last-Translator: Dean Lee <xslidian@gmail.com>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Language: zh_CN\n"
+"X-Source-Language: C\n"
+"X-Poedit-Bookmarks: 77,-1,-1,-1,-1,-1,-1,-1,-1,-1\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/init.cpp:142
+msgid "Bitcoin version"
+msgstr "Bitcoin 版本"
+
+#: ../../../src/init.cpp:143
+msgid "Usage:"
+msgstr "用法:"
+
+#: ../../../src/init.cpp:145
+msgid "Send command to -server or bitcoind\n"
+msgstr "发送命令给 -server 或 bitcoin\n"
+
+#: ../../../src/init.cpp:146
+msgid "List commands\n"
+msgstr "列出命令\n"
+
+#: ../../../src/init.cpp:147
+msgid "Get help for a command\n"
+msgstr "获取命令的帮助\n"
+
+#: ../../../src/init.cpp:148
+msgid "Options:\n"
+msgstr "选项:\n"
+
+#: ../../../src/init.cpp:149
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "指定配置文件 (默认: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:150
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "指定 pid 文件 (默认: bitcoin.pid)\n"
+
+#: ../../../src/init.cpp:151
+msgid "Generate coins\n"
+msgstr "生成货币\n"
+
+#: ../../../src/init.cpp:152
+msgid "Don't generate coins\n"
+msgstr "不要生成货币\n"
+
+#: ../../../src/init.cpp:153
+msgid "Start minimized\n"
+msgstr "启动时最小化\n"
+
+#: ../../../src/init.cpp:154
+msgid "Specify data directory\n"
+msgstr "指定数据目录\n"
+
+#: ../../../src/init.cpp:155
+msgid "Connect through socks4 proxy\n"
+msgstr "通过 socks4 代理连接\n"
+
+#: ../../../src/init.cpp:156
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "允许 DNS 查找新增结点和连接\n"
+
+#: ../../../src/init.cpp:157
+msgid "Add a node to connect to\n"
+msgstr "添加一个连接结点\n"
+
+#: ../../../src/init.cpp:158
+msgid "Connect only to the specified node\n"
+msgstr "只连接特定结点\n"
+
+#: ../../../src/init.cpp:159
+msgid "Don't accept connections from outside\n"
+msgstr "不要接受外部传来的连接\n"
+
+#: ../../../src/init.cpp:162
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "不要尝试使用 UPnP 映射监听端口\n"
+
+#: ../../../src/init.cpp:164
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "尝试使用 UPnP 映射监听端口\n"
+
+#: ../../../src/init.cpp:167
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "您为每 KB 支付所增加的交易佣金\n"
+
+#: ../../../src/init.cpp:169
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "允许命令行和 JSON-RPC 控制\n"
+
+#: ../../../src/init.cpp:172
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "在后台运行并接收命令\n"
+
+#: ../../../src/init.cpp:174
+msgid "Use the test network\n"
+msgstr "使用测试网络\n"
+
+#: ../../../src/init.cpp:175
+msgid "Username for JSON-RPC connections\n"
+msgstr "JSON-RPC 连接的用户名\n"
+
+#: ../../../src/init.cpp:176
+msgid "Password for JSON-RPC connections\n"
+msgstr "JSON-RPC 连接的密码\n"
+
+#: ../../../src/init.cpp:177
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "在端口 <port> 监听 JSON-RPC 连接 (默认: 8332)\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "允许来自特定 IP 地址的 JSON-RPC 连接\n"
+
+#: ../../../src/init.cpp:179
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "发送命令给运行的结点,IP 地址 <ip> (默认: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:180
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "设置密钥池大小为 <n> (默认: 100)\n"
+
+#: ../../../src/init.cpp:181
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "重新扫描货币包链来检测丢失的货币交易\n"
+
+#: ../../../src/init.cpp:185
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"SSL 选项: (SSL 设置步骤请参见 Bitcoin Wiki)\n"
+
+#: ../../../src/init.cpp:186
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "使用 OpenSSL (https) 进行 JSON-RPC 连接\n"
+
+#: ../../../src/init.cpp:187
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "服务器证书 (默认: server.cert)\n"
+
+#: ../../../src/init.cpp:188
+msgid "Server private key (default: server.pem)\n"
+msgstr "服务器私有密钥 (默认: server.pem)\n"
+
+#: ../../../src/init.cpp:189
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "许可密码 (默认: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:193
+msgid "This help message\n"
+msgstr "本帮助信息\n"
+
+#: ../../../src/init.cpp:330
+#, c-format
+msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
+msgstr "无法获取数据目录 %s 的锁。 Bitcoin 可能已经启动。"
+
+#: ../../../src/init.cpp:356
+msgid "Error loading addr.dat \n"
+msgstr "加载 addr.dat 出错 \n"
+
+#: ../../../src/init.cpp:362
+msgid "Error loading blkindex.dat \n"
+msgstr "加载 blkindex.dat 出错 \n"
+
+#: ../../../src/init.cpp:369
+msgid "Error loading wallet.dat \n"
+msgstr "加载 wallet.dat 出错 \n"
+
+#: ../../../src/init.cpp:449
+msgid "Invalid -proxy address"
+msgstr "无效 -proxy 地址"
+
+#: ../../../src/init.cpp:472
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "无效的金额 -paytxfee=<amount>"
+
+#: ../../../src/init.cpp:476
+msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
+msgstr "警告: -paytxfee 设置得过高。 这个参数是您发送一笔交易要支付的佣金。"
+
+#: ../../../src/main.cpp:1866
+msgid "Warning: Disk space is low "
+msgstr "警告: 磁盘空间不足"
+
+#: ../../../src/main.cpp:3990
+#, c-format
+msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
+msgstr "错误: 这个交易因为近期收到支付的数量,难度或者使用而需要支付至少 %s 交易佣金 "
+
+#: ../../../src/main.cpp:3992
+msgid "Error: Transaction creation failed "
+msgstr "错误: 交易创建失败"
+
+#: ../../../src/main.cpp:3997
+#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:1932
+#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2229
+msgid "Sending..."
+msgstr "正在发送..."
+
+#: ../../../src/main.cpp:4001
+msgid "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."
+msgstr "错误: 交易被拒绝。 这可能是因为您账户里的一些货币应经被使用,比如您使用了一个复制的 wallet.dat 文件,一些货币在另一个复件里支付了但是没有在这里更新。"
+
+#: ../../../src/main.cpp:4014
+msgid "Invalid amount"
+msgstr "无效金额"
+
+#: ../../../src/main.cpp:4016
+#: ../../../src/ui.cpp:2143
+#: ../../../src/ui.cpp:2214
+msgid "Insufficient funds"
+msgstr "余额不足"
+
+#: ../../../src/main.cpp:4021
+msgid "Invalid bitcoin address"
+msgstr "无效 bitcoin 地址"
+
+#: ../../../src/net.cpp:1503
+#, c-format
+msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
+msgstr "无法在这台电脑上绑定 %d 端口。 Bitcoin 可能已经在运行。"
+
+#: ../../../src/rpc.cpp:1802
+#: ../../../src/rpc.cpp:1804
+#, c-format
+msgid "To use the %s option"
+msgstr "使用 %s 选项"
+
+#: ../../../src/rpc.cpp:1806
+#, c-format
+msgid ""
+"Warning: %s, you must set rpcpassword=<password>\n"
+"in the configuration file: %s\n"
+"If the file does not exist, create it with owner-readable-only file permissions.\n"
+msgstr ""
+"警告: %s,您必须在配置文件中设置 rpcpassword=<password>\n"
+"配置文件为: %s\n"
+"如果文件不存在,请创建文件并只给创建者提供只读访问权限。\n"
+
+#: ../../../src/rpc.cpp:1974
+#, c-format
+msgid ""
+"You must set rpcpassword=<password> in the configuration file:\n"
+"%s\n"
+"If the file does not exist, create it with owner-readable-only file permissions."
+msgstr ""
+"您必须在配置文件中设置 rpcpassword=<password> :\n"
+"%s\n"
+"如果文件不存在,请创建文件并只给创建者提供只读访问权限。"
+
+#: ../../../src/ui.cpp:204
+#, c-format
+msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
+msgstr "这笔交易超过了大小限制。 您依然可以通过支付 %s 的佣金来进行,佣金用来支付为您的交易计算的结点来帮助支撑网络。 您是否要支付佣金?"
+
+#: ../../../src/ui.cpp:303
+msgid "Status"
+msgstr "状态"
+
+#: ../../../src/ui.cpp:304
+msgid "Date"
+msgstr "日期"
+
+#: ../../../src/ui.cpp:305
+msgid "Description"
+msgstr "描述"
+
+#: ../../../src/ui.cpp:306
+msgid "Debit"
+msgstr "付款人"
+
+#: ../../../src/ui.cpp:307
+msgid "Credit"
+msgstr "信用"
+
+#: ../../../src/ui.cpp:513
+#, c-format
+msgid "Open for %d blocks"
+msgstr "%d 个货币包开放"
+
+#: ../../../src/ui.cpp:515
+#, c-format
+msgid "Open until %s"
+msgstr "开放直到 %s"
+
+#: ../../../src/ui.cpp:521
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/离线?"
+
+#: ../../../src/ui.cpp:523
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/未确认"
+
+#: ../../../src/ui.cpp:525
+#, c-format
+msgid "%d confirmations"
+msgstr "%d 确认"
+
+#: ../../../src/ui.cpp:610
+msgid "Generated"
+msgstr "已生成"
+
+#: ../../../src/ui.cpp:618
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "已生成 (%s 成熟 %d 新增货币包)"
+
+#: ../../../src/ui.cpp:622
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "已生成 - 警告: 这个货币包没有被任何其他结点收到,因此很可能不会被接受!"
+
+#: ../../../src/ui.cpp:626
+msgid "Generated (not accepted)"
+msgstr "已生成 (未被接受)"
+
+#: ../../../src/ui.cpp:636
+msgid "From: "
+msgstr "来自: "
+
+#: ../../../src/ui.cpp:660
+msgid "Received with: "
+msgstr "伴随接收: "
+
+#: ../../../src/ui.cpp:706
+msgid "Payment to yourself"
+msgstr "支付给您自己"
+
+#: ../../../src/ui.cpp:740
+msgid "To: "
+msgstr "到: "
+
+#: ../../../src/ui.cpp:1055
+msgid " Generating"
+msgstr " 生成中"
+
+#: ../../../src/ui.cpp:1057
+msgid "(not connected)"
+msgstr "(未连接)"
+
+#: ../../../src/ui.cpp:1060
+#, c-format
+msgid " %d connections %d blocks %d transactions"
+msgstr " %d 个连接 %d 个货币包 %d 个交易 "
+
+#: ../../../src/ui.cpp:1165
+#: ../../../src/ui.cpp:2529
+msgid "New Receiving Address"
+msgstr "新建接收地址"
+
+#: ../../../src/ui.cpp:1166
+#: ../../../src/ui.cpp:2530
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"您应该为您收到的每次付款使用不同的地址。\n"
+"\n"
+"标签"
+
+#: ../../../src/ui.cpp:1235
+msgid "<b>Status:</b> "
+msgstr "<b>状态:</b> "
+
+#: ../../../src/ui.cpp:1240
+msgid ", has not been successfully broadcast yet"
+msgstr ",尚未被成功广播"
+
+#: ../../../src/ui.cpp:1242
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ",通过 %d 个结点广播"
+
+#: ../../../src/ui.cpp:1244
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ",通过 %d 个结点广播"
+
+#: ../../../src/ui.cpp:1248
+msgid "<b>Date:</b> "
+msgstr "<b>日期:</b>"
+
+#: ../../../src/ui.cpp:1256
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>来源:</b> 生成<br>"
+
+#: ../../../src/ui.cpp:1262
+#: ../../../src/ui.cpp:1280
+msgid "<b>From:</b> "
+msgstr "<b>从:</b> "
+
+#: ../../../src/ui.cpp:1280
+msgid "unknown"
+msgstr "未知"
+
+#: ../../../src/ui.cpp:1281
+#: ../../../src/ui.cpp:1305
+#: ../../../src/ui.cpp:1364
+msgid "<b>To:</b> "
+msgstr "<b>到:</b> "
+
+#: ../../../src/ui.cpp:1284
+msgid " (yours, label: "
+msgstr " (您的标签: "
+
+#: ../../../src/ui.cpp:1286
+msgid " (yours)"
+msgstr " (您的)"
+
+#: ../../../src/ui.cpp:1323
+#: ../../../src/ui.cpp:1335
+#: ../../../src/ui.cpp:1381
+#: ../../../src/ui.cpp:1398
+msgid "<b>Credit:</b> "
+msgstr "<b>信用:</b> "
+
+#: ../../../src/ui.cpp:1325
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s 收获在 %d 更多的货币包)"
+
+#: ../../../src/ui.cpp:1327
+msgid "(not accepted)"
+msgstr "(未被接受)"
+
+#: ../../../src/ui.cpp:1372
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:1395
+msgid "<b>Debit:</b> "
+msgstr "<b>付款人:</b> "
+
+#: ../../../src/ui.cpp:1386
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>交易佣金:</b> "
+
+#: ../../../src/ui.cpp:1402
+msgid "<b>Net amount:</b> "
+msgstr "<b>网络金额:</b> "
+
+#: ../../../src/ui.cpp:1409
+msgid "Message:"
+msgstr "消息:"
+
+#: ../../../src/ui.cpp:1411
+msgid "Comment:"
+msgstr "评论"
+
+#: ../../../src/ui.cpp:1414
+msgid "Generated coins must wait 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, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
+msgstr "生成的货币必须等待 120 个货币包之后才能够使用。 当您生成了一个货币包后,它被广播给网络来加入货币包链中。 如果它无法加入货币包链中,他将会标记为\"不被接受\"且不能被支付。 这种情况可能因为在您生成这个货币包之后的几秒钟内有别人也生成了货币包而发生。"
+
+#: ../../../src/ui.cpp:1594
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "无法写入 autostart/bitcoin.desktop 文件"
+
+#: ../../../src/ui.cpp:1630
+msgid "Main"
+msgstr "主要"
+
+#: ../../../src/ui.cpp:1638
+msgid "&Start Bitcoin on window system startup"
+msgstr "开机自动启动 Bitcoin(&S)"
+
+#: ../../../src/ui.cpp:1645
+msgid "&Minimize on close"
+msgstr "关闭时最小化(&M)"
+
+#: ../../../src/ui.cpp:1787
+#, c-format
+msgid "version %s"
+msgstr "版本 %s"
+
+#: ../../../src/ui.cpp:1899
+msgid "Error in amount "
+msgstr "金额有误 "
+
+#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:1944
+#: ../../../src/uibase.cpp:55
+msgid "Send Coins"
+msgstr "发送货币"
+
+#: ../../../src/ui.cpp:1904
+msgid "Amount exceeds your balance "
+msgstr "金额超出您的账户余额"
+
+#: ../../../src/ui.cpp:1909
+msgid "Total exceeds your balance when the "
+msgstr "总费用超出您的账户余额当 "
+
+#: ../../../src/ui.cpp:1909
+msgid " transaction fee is included "
+msgstr " 交易佣金已包括"
+
+#: ../../../src/ui.cpp:1927
+msgid "Payment sent "
+msgstr "付款已发送"
+
+#: ../../../src/ui.cpp:1944
+msgid "Invalid address "
+msgstr "无效地址 "
+
+#: ../../../src/ui.cpp:1997
+#, c-format
+msgid "Sending %s to %s"
+msgstr "发送 %s 给 %s"
+
+#: ../../../src/ui.cpp:2070
+#: ../../../src/ui.cpp:2103
+msgid "CANCELLED"
+msgstr "已取消"
+
+#: ../../../src/ui.cpp:2074
+msgid "Cancelled"
+msgstr "已取消"
+
+#: ../../../src/ui.cpp:2076
+msgid "Transfer cancelled "
+msgstr "传输已取消 "
+
+#: ../../../src/ui.cpp:2129
+msgid "Error: "
+msgstr "错误: "
+
+#: ../../../src/ui.cpp:2148
+msgid "Connecting..."
+msgstr "正在连接..."
+
+#: ../../../src/ui.cpp:2153
+msgid "Unable to connect"
+msgstr "无法连接"
+
+#: ../../../src/ui.cpp:2158
+msgid "Requesting public key..."
+msgstr "正在请求公共密钥..."
+
+#: ../../../src/ui.cpp:2170
+msgid "Received public key..."
+msgstr "收到公共密钥..."
+
+#: ../../../src/ui.cpp:2184
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "收款人不接受来自 IP 地址的交易"
+
+#: ../../../src/ui.cpp:2186
+msgid "Transfer was not accepted"
+msgstr "传输没有被接受"
+
+#: ../../../src/ui.cpp:2195
+msgid "Invalid response received"
+msgstr "接收到无效回复"
+
+#: ../../../src/ui.cpp:2210
+msgid "Creating transaction..."
+msgstr "正在创建交易..."
+
+#: ../../../src/ui.cpp:2222
+#, c-format
+msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
+msgstr "这笔交易因为它最近收到的付款的数量,交易难度或者使用情况,需要至少 %s 交易佣金"
+
+#: ../../../src/ui.cpp:2224
+msgid "Transaction creation failed"
+msgstr "交易创建失败"
+
+#: ../../../src/ui.cpp:2231
+msgid "Transaction aborted"
+msgstr "交易中止"
+
+#: ../../../src/ui.cpp:2239
+msgid "Lost connection, transaction cancelled"
+msgstr "失去连接,交易已取消"
+
+#: ../../../src/ui.cpp:2255
+msgid "Sending payment..."
+msgstr "正在发送付款..."
+
+#: ../../../src/ui.cpp:2261
+msgid "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."
+msgstr "交易被拒绝。 这可能是因为您账户中的一部分货币已经被使用,比如您使用了一个复制的 wallet.dat 文件,而且货币在另一个副本里使用但没有在这里标记。"
+
+#: ../../../src/ui.cpp:2270
+msgid "Waiting for confirmation..."
+msgstr "正在等待确认..."
+
+#: ../../../src/ui.cpp:2288
+msgid ""
+"The payment was sent, but the recipient was unable to verify it.\n"
+"The transaction is recorded and will credit to the recipient,\n"
+"but the comment information will be blank."
+msgstr ""
+"付款已发送,但是收款人无法进行确认。\n"
+"交易已经被记录,并且支付给收款人,\n"
+"但是评论信息可能是空的。"
+
+#: ../../../src/ui.cpp:2297
+msgid "Payment was sent, but an invalid response was received"
+msgstr "支付已发送,但是收到无效回复"
+
+#: ../../../src/ui.cpp:2303
+msgid "Payment completed"
+msgstr "付款完成"
+
+#: ../../../src/ui.cpp:2334
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
+msgid "Name"
+msgstr "姓名"
+
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2517
+msgid "Address"
+msgstr "地址"
+
+#: ../../../src/ui.cpp:2337
+#: ../../../src/ui.cpp:2492
+msgid "Label"
+msgstr "标签"
+
+#: ../../../src/ui.cpp:2338
+#: ../../../src/uibase.cpp:837
+msgid "Bitcoin Address"
+msgstr "Bitcoin 地址"
+
+#: ../../../src/ui.cpp:2462
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
+msgstr "这是您拥有的接收付款的地址之一,它不能够进入这个地址簿。 "
+
+#: ../../../src/ui.cpp:2480
+#: ../../../src/ui.cpp:2486
+msgid "Edit Address"
+msgstr "编辑地址"
+
+#: ../../../src/ui.cpp:2492
+msgid "Edit Address Label"
+msgstr "编辑地址标签"
+
+#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2523
+msgid "Add Address"
+msgstr "添加地址"
+
+#: ../../../src/ui.cpp:2600
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../src/ui.cpp:2602
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - 生成中"
+
+#: ../../../src/ui.cpp:2604
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (未连接)"
+
+#: ../../../src/ui.cpp:2683
+msgid "&Open Bitcoin"
+msgstr "打开 Bitcoin(&O)"
+
+#: ../../../src/ui.cpp:2684
+msgid "&Send Bitcoins"
+msgstr "发送 Bitcoins(&S)"
+
+#: ../../../src/ui.cpp:2685
+msgid "O&ptions..."
+msgstr "选项(&P)..."
+
+#: ../../../src/ui.cpp:2688
+#: ../../../src/uibase.cpp:25
+msgid "E&xit"
+msgstr "退出(&X)"
+
+#: ../../../src/ui.cpp:2904
+msgid "Program has crashed and will terminate. "
+msgstr "程序崩溃,即将关闭。 "
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "文件(&F)"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "您的接收地址(&Y)..."
+
+#: ../../../src/uibase.cpp:36
+msgid "&Options..."
+msgstr "选项(&O)..."
+
+#: ../../../src/uibase.cpp:39
+msgid "&Settings"
+msgstr "设置(&S)"
+
+#: ../../../src/uibase.cpp:43
+msgid "&About..."
+msgstr "关于(&A)..."
+
+#: ../../../src/uibase.cpp:46
+msgid "&Help"
+msgstr "帮助(&H)"
+
+#: ../../../src/uibase.cpp:56
+msgid "Address Book"
+msgstr "地址簿"
+
+#: ../../../src/uibase.cpp:69
+msgid "Your Bitcoin Address:"
+msgstr "您的 Bitcoin 地址:"
+
+#: ../../../src/uibase.cpp:76
+msgid " &New... "
+msgstr " 新建(&N)... "
+
+#: ../../../src/uibase.cpp:79
+#: ../../../src/uibase.cpp:780
+#: ../../../src/uibase.cpp:883
+msgid " &Copy to Clipboard "
+msgstr " 复制到剪贴板(&C)"
+
+#: ../../../src/uibase.cpp:93
+msgid "Balance:"
+msgstr "账户余额:"
+
+#: ../../../src/uibase.cpp:109
+msgid " All"
+msgstr "全部"
+
+#: ../../../src/uibase.cpp:109
+msgid " Sent"
+msgstr " 已发送"
+
+#: ../../../src/uibase.cpp:109
+msgid " Received"
+msgstr " 已接收"
+
+#: ../../../src/uibase.cpp:109
+msgid " In Progress"
+msgstr "处理中"
+
+#: ../../../src/uibase.cpp:130
+msgid "All Transactions"
+msgstr "所有交易"
+
+#: ../../../src/uibase.cpp:141
+msgid "Sent/Received"
+msgstr "已发送/已接收"
+
+#: ../../../src/uibase.cpp:152
+msgid "Sent"
+msgstr "已发送"
+
+#: ../../../src/uibase.cpp:163
+msgid "Received"
+msgstr "已接收"
+
+#: ../../../src/uibase.cpp:302
+#: ../../../src/uibase.cpp:443
+#: ../../../src/uibase.cpp:542
+#: ../../../src/uibase.cpp:722
+#: ../../../src/uibase.cpp:783
+#: ../../../src/uibase.cpp:892
+#: ../../../src/uibase.cpp:981
+msgid "OK"
+msgstr "确定"
+
+#: ../../../src/uibase.cpp:345
+msgid "&Start Bitcoin on system startup"
+msgstr "开机自动启动(&S)"
+
+#: ../../../src/uibase.cpp:348
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "最小化到系统托盘(&M)"
+
+#: ../../../src/uibase.cpp:351
+msgid "Map port using &UPnP"
+msgstr "使用 &UPnP 映射端口"
+
+#: ../../../src/uibase.cpp:354
+msgid "M&inimize to the tray on close"
+msgstr "关闭时最小化到托盘(&I)"
+
+#: ../../../src/uibase.cpp:360
+msgid "&Connect through socks4 proxy: "
+msgstr "通过 socks4 代理连接(&C): "
+
+#: ../../../src/uibase.cpp:371
+msgid "Proxy &IP:"
+msgstr "代理服务器(&I):"
+
+#: ../../../src/uibase.cpp:379
+msgid " &Port:"
+msgstr " 端口(&P):"
+
+#: ../../../src/uibase.cpp:392
+msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
+msgstr "可以选择按照KB支付交易佣金来确保您的交易得到迅速处理。 大多数交易需要 1KB。 建议支付 0.01。"
+
+#: ../../../src/uibase.cpp:399
+msgid "Pay transaction fee:"
+msgstr "支付交易佣金:"
+
+#: ../../../src/uibase.cpp:420
+msgid "// [don't translate] Test panel 2 for future expansion"
+msgstr ""
+
+#: ../../../src/uibase.cpp:424
+msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
+msgstr ""
+
+#: ../../../src/uibase.cpp:446
+#: ../../../src/uibase.cpp:668
+#: ../../../src/uibase.cpp:727
+#: ../../../src/uibase.cpp:786
+#: ../../../src/uibase.cpp:895
+#: ../../../src/uibase.cpp:984
+msgid "Cancel"
+msgstr "取消"
+
+#: ../../../src/uibase.cpp:449
+msgid "&Apply"
+msgstr "应用(&A)"
+
+#: ../../../src/uibase.cpp:508
+msgid "Bitcoin "
+msgstr "Bitcoin "
+
+#: ../../../src/uibase.cpp:514
+msgid "version"
+msgstr "版本"
+
+#: ../../../src/uibase.cpp:525
+msgid ""
+"Copyright (c) 2009-2011 Bitcoin Developers\n"
+"\n"
+"This is experimental software.\n"
+"\n"
+"Distributed under the MIT/X11 software license, see the accompanying file \n"
+"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"This product includes software developed by the OpenSSL Project for use in the \n"
+"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
+"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
+msgstr ""
+"版权所有 (c) 2009-2010 Bitcoin 开发人员\n"
+"这是一个实验软件。\n"
+"分发遵循 MIT/X11 软件许可协议,请参见附带的 license.txt 文件或访问\n"
+"http://www.opensource.org/licenses/mit-license.php。\n"
+"本产品使用了 OpenSSL Project 开发的 OpenSSL Toolkit\n"
+"(http://www.openssl.org/),以及 Eric Young(eay@cryptsoft.com)\n"
+"编写的加密软件和 Thomas Bernard 编写的 UPnP 软件。"
+
+#: ../../../src/uibase.cpp:581
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "输入 Bitcoin 地址 (比如 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:595
+msgid "Pay &To:"
+msgstr "付款给(&T):"
+
+#: ../../../src/uibase.cpp:610
+msgid "&Paste"
+msgstr "粘贴(&P)"
+
+#: ../../../src/uibase.cpp:613
+msgid " Address &Book..."
+msgstr " 地址簿(&B)..."
+
+#: ../../../src/uibase.cpp:620
+msgid "&Amount:"
+msgstr "数量(&A):"
+
+#: ../../../src/uibase.cpp:630
+msgid "T&ransfer:"
+msgstr "传输(&R):"
+
+#: ../../../src/uibase.cpp:636
+msgid " Standard"
+msgstr "标准"
+
+#: ../../../src/uibase.cpp:663
+msgid "&Send"
+msgstr "发送(&S)"
+
+#: ../../../src/uibase.cpp:711
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"正在连接..."
+
+#: ../../../src/uibase.cpp:761
+msgid "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. The highlighted address is displayed in the main window."
+msgstr "这些是您用来接收付款的 Bitcoin 地址。 您可能需要给每一个付款人一个不同的地址从而可以最终每一笔交易是谁支付的。 下面高亮的地址是您的主窗口正在使用的地址。"
+
+#: ../../../src/uibase.cpp:774
+#: ../../../src/uibase.cpp:886
+msgid "&Edit..."
+msgstr "编辑(&E)..."
+
+#: ../../../src/uibase.cpp:777
+#: ../../../src/uibase.cpp:889
+msgid " &New Address... "
+msgstr " 新建地址(&N)..."
+
+#: ../../../src/uibase.cpp:849
+msgid "Sending"
+msgstr "发送人地址"
+
+#: ../../../src/uibase.cpp:857
+msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
+msgstr "这些是您用来接收付款的 Bitcoin 地址。 您可以给每一个付款人一个不同的地址从而可以最终每一笔交易是谁支付的。 下面高亮的地址是您的主窗口正在使用的地址。"
+
+#: ../../../src/uibase.cpp:870
+msgid "Receiving"
+msgstr "我的接收地址"
+
+#: ../../../src/uibase.cpp:880
+msgid "&Delete"
+msgstr "删除(&D)"
+
+#: ../../../src/util.cpp:866
+msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
+msgstr "警告: 请检查您的电脑日期和时间是否正确。 如果您的时钟不正确 Bitcoin 将无法正常工作。"
+
+#: ../../../src/util.cpp:899
+msgid "beta"
+msgstr "测试版"
+
+#: ../../../src/uibase.h:147
+msgid "Transaction Details"
+msgstr "交易详情"
+
+#: ../../../src/uibase.h:199
+msgid "Options"
+msgstr "选项"
+
+#: ../../../src/uibase.h:228
+msgid "About Bitcoin"
+msgstr "关于 Bitcoin"
+
+#: ../../../src/uibase.h:337
+msgid "Your Bitcoin Addresses"
+msgstr "您的 Bitcoin 地址"
diff --git a/rc/bitcoin.ico b/rc/bitcoin.ico
deleted file mode 100644
index cdec9a037b..0000000000
--- a/rc/bitcoin.ico
+++ /dev/null
Binary files differ
diff --git a/sha256.cpp b/sha256.cpp
deleted file mode 100644
index ca116bdcd3..0000000000
--- a/sha256.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-// Copyright (c) 2010 Nils Schneider
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
-// 4-way 128-bit SSE2 SHA-256
-
-#ifdef FOURWAYSSE2
-
-#include <string.h>
-#include <assert.h>
-
-#include <xmmintrin.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#define NPAR 32
-
-extern void DoubleBlockSHA256(const void* pin, void* pout, const void* pinit, unsigned int hash[8][NPAR], const void* init2);
-
-static const unsigned int sha256_consts[] = {
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, /* 0 */
- 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, /* 8 */
- 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, /* 16 */
- 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, /* 24 */
- 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, /* 32 */
- 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, /* 40 */
- 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, /* 48 */
- 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, /* 56 */
- 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
-};
-
-
-static inline __m128i Ch(const __m128i b, const __m128i c, const __m128i d) {
- return (b & c) ^ (~b & d);
-}
-
-static inline __m128i Maj(const __m128i b, const __m128i c, const __m128i d) {
- return (b & c) ^ (b & d) ^ (c & d);
-}
-
-static inline __m128i ROTR(__m128i x, const int n) {
- return _mm_srli_epi32(x, n) | _mm_slli_epi32(x, 32 - n);
-}
-
-static inline __m128i SHR(__m128i x, const int n) {
- return _mm_srli_epi32(x, n);
-}
-
-/* SHA256 Functions */
-#define BIGSIGMA0_256(x) (ROTR((x), 2) ^ ROTR((x), 13) ^ ROTR((x), 22))
-#define BIGSIGMA1_256(x) (ROTR((x), 6) ^ ROTR((x), 11) ^ ROTR((x), 25))
-#define SIGMA0_256(x) (ROTR((x), 7) ^ ROTR((x), 18) ^ SHR((x), 3))
-#define SIGMA1_256(x) (ROTR((x), 17) ^ ROTR((x), 19) ^ SHR((x), 10))
-
-static inline unsigned int store32(const __m128i x, int i) {
- union { unsigned int ret[4]; __m128i x; } box;
- box.x = x;
- return box.ret[i];
-}
-
-static inline void store_epi32(const __m128i x, unsigned int *x0, unsigned int *x1, unsigned int *x2, unsigned int *x3) {
- union { unsigned int ret[4]; __m128i x; } box;
- box.x = x;
- *x0 = box.ret[3]; *x1 = box.ret[2]; *x2 = box.ret[1]; *x3 = box.ret[0];
-}
-
-#define add4(x0, x1, x2, x3) _mm_add_epi32(_mm_add_epi32(_mm_add_epi32(x0, x1), x2), x3)
-#define add5(x0, x1, x2, x3, x4) _mm_add_epi32(add4(x0, x1, x2, x3), x4)
-
-#define SHA256ROUND(a, b, c, d, e, f, g, h, i, w) \
- T1 = add5(h, BIGSIGMA1_256(e), Ch(e, f, g), _mm_set1_epi32(sha256_consts[i]), w); \
-d = _mm_add_epi32(d, T1); \
-h = _mm_add_epi32(T1, _mm_add_epi32(BIGSIGMA0_256(a), Maj(a, b, c)));
-
-static inline void dumpreg(__m128i x, char *msg) {
- union { unsigned int ret[4]; __m128i x; } box;
- box.x = x ;
- printf("%s %08x %08x %08x %08x\n", msg, box.ret[0], box.ret[1], box.ret[2], box.ret[3]);
-}
-
-#if 1
-#define dumpstate(i) printf("%s: %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", \
- __func__, store32(w0, i), store32(a, i), store32(b, i), store32(c, i), store32(d, i), store32(e, i), store32(f, i), store32(g, i), store32(h, i));
-#else
-#define dumpstate()
-#endif
-
-// Align by increasing pointer, must have extra space at end of buffer
-template <size_t nBytes, typename T>
-T* alignup(T* p)
-{
- union
- {
- T* ptr;
- size_t n;
- } u;
- u.ptr = p;
- u.n = (u.n + (nBytes-1)) & ~(nBytes-1);
- return u.ptr;
-}
-
-static const unsigned int pSHA256InitState[8] =
-{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
-
-
-unsigned int ScanHash_4WaySSE2(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
-{
- unsigned int& nNonce = *(unsigned int*)(pdata + 12);
- for (;;)
- {
- nNonce += NPAR;
- unsigned int thashbuf[9][NPAR];
- unsigned int (&thash)[9][NPAR] = *alignup<16>(&thashbuf);
- DoubleBlockSHA256(pdata, phash1, pmidstate, thash, pSHA256InitState);
-
- for (int j = 0; j < NPAR; j++)
- {
- if (thash[7][j] == 0)
- {
- for (int i = 0; i < 32/4; i++)
- ((unsigned int*)phash)[i] = thash[i][j];
- return nNonce + j;
- }
- }
-
- if ((nNonce & 0xffff) == 0)
- {
- nHashesDone = 0xffff+1;
- return -1;
- }
- }
-}
-
-
-void DoubleBlockSHA256(const void* pin, void* pad, const void *pre, unsigned int thash[9][NPAR], const void *init)
-{
- unsigned int* In = (unsigned int*)pin;
- unsigned int* Pad = (unsigned int*)pad;
- unsigned int* hPre = (unsigned int*)pre;
- unsigned int* hInit = (unsigned int*)init;
- unsigned int i, j, k;
-
- /* vectors used in calculation */
- __m128i w0, w1, w2, w3, w4, w5, w6, w7;
- __m128i w8, w9, w10, w11, w12, w13, w14, w15;
- __m128i T1;
- __m128i a, b, c, d, e, f, g, h;
- __m128i nonce;
-
- /* nonce offset for vector */
- __m128i offset = _mm_set_epi32(0x00000003, 0x00000002, 0x00000001, 0x00000000);
-
-
- for(k = 0; k<NPAR; k+=4) {
- w0 = _mm_set1_epi32(In[0]);
- w1 = _mm_set1_epi32(In[1]);
- w2 = _mm_set1_epi32(In[2]);
- //w3 = _mm_set1_epi32(In[3]); nonce will be later hacked into the hash
- w4 = _mm_set1_epi32(In[4]);
- w5 = _mm_set1_epi32(In[5]);
- w6 = _mm_set1_epi32(In[6]);
- w7 = _mm_set1_epi32(In[7]);
- w8 = _mm_set1_epi32(In[8]);
- w9 = _mm_set1_epi32(In[9]);
- w10 = _mm_set1_epi32(In[10]);
- w11 = _mm_set1_epi32(In[11]);
- w12 = _mm_set1_epi32(In[12]);
- w13 = _mm_set1_epi32(In[13]);
- w14 = _mm_set1_epi32(In[14]);
- w15 = _mm_set1_epi32(In[15]);
-
- /* hack nonce into lowest byte of w3 */
- nonce = _mm_set1_epi32(In[3]);
- nonce = _mm_add_epi32(nonce, offset);
- nonce = _mm_add_epi32(nonce, _mm_set1_epi32(k));
- w3 = nonce;
-
- a = _mm_set1_epi32(hPre[0]);
- b = _mm_set1_epi32(hPre[1]);
- c = _mm_set1_epi32(hPre[2]);
- d = _mm_set1_epi32(hPre[3]);
- e = _mm_set1_epi32(hPre[4]);
- f = _mm_set1_epi32(hPre[5]);
- g = _mm_set1_epi32(hPre[6]);
- h = _mm_set1_epi32(hPre[7]);
-
- SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
- SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
- SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
- SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
- SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
- SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
- SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
- SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
- SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
- SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
- SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
- SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
- SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
- SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
- SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
- SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
-
-#define store_load(x, i, dest) \
- T1 = _mm_set1_epi32((hPre)[i]); \
- dest = _mm_add_epi32(T1, x);
-
- store_load(a, 0, w0);
- store_load(b, 1, w1);
- store_load(c, 2, w2);
- store_load(d, 3, w3);
- store_load(e, 4, w4);
- store_load(f, 5, w5);
- store_load(g, 6, w6);
- store_load(h, 7, w7);
-
- w8 = _mm_set1_epi32(Pad[8]);
- w9 = _mm_set1_epi32(Pad[9]);
- w10 = _mm_set1_epi32(Pad[10]);
- w11 = _mm_set1_epi32(Pad[11]);
- w12 = _mm_set1_epi32(Pad[12]);
- w13 = _mm_set1_epi32(Pad[13]);
- w14 = _mm_set1_epi32(Pad[14]);
- w15 = _mm_set1_epi32(Pad[15]);
-
- a = _mm_set1_epi32(hInit[0]);
- b = _mm_set1_epi32(hInit[1]);
- c = _mm_set1_epi32(hInit[2]);
- d = _mm_set1_epi32(hInit[3]);
- e = _mm_set1_epi32(hInit[4]);
- f = _mm_set1_epi32(hInit[5]);
- g = _mm_set1_epi32(hInit[6]);
- h = _mm_set1_epi32(hInit[7]);
-
- SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
- SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
- SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
- SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
- SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
- SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
- SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
- SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
- SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
- SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
- SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
- SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
- SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
- SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
- SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
- SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
-
- w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
- SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
- w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
- SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
- w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
- SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
- w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
- SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
- w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
- SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
- w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
- SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
- w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
- SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
- w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
- SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
- w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
- SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
- w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
- SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
- w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
- SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
- w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
- SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
- w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
- SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
- w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
- SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
- w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
- SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
- w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
- SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
-
- /* store resulsts directly in thash */
-#define store_2(x,i) \
- w0 = _mm_set1_epi32(hInit[i]); \
- *(__m128i *)&(thash)[i][0+k] = _mm_add_epi32(w0, x);
-
- store_2(a, 0);
- store_2(b, 1);
- store_2(c, 2);
- store_2(d, 3);
- store_2(e, 4);
- store_2(f, 5);
- store_2(g, 6);
- store_2(h, 7);
- *(__m128i *)&(thash)[8][0+k] = nonce;
- }
-
-}
-
-#endif // FOURWAYSSE2
diff --git a/rc/addressbook16.bmp b/share/pixmaps/addressbook16.bmp
index c5576910b1..c5576910b1 100644
--- a/rc/addressbook16.bmp
+++ b/share/pixmaps/addressbook16.bmp
Binary files differ
diff --git a/rc/addressbook16mask.bmp b/share/pixmaps/addressbook16mask.bmp
index d3a478d1ad..d3a478d1ad 100644
--- a/rc/addressbook16mask.bmp
+++ b/share/pixmaps/addressbook16mask.bmp
Binary files differ
diff --git a/rc/addressbook20.bmp b/share/pixmaps/addressbook20.bmp
index 2b33b228aa..2b33b228aa 100644
--- a/rc/addressbook20.bmp
+++ b/share/pixmaps/addressbook20.bmp
Binary files differ
diff --git a/rc/addressbook20mask.bmp b/share/pixmaps/addressbook20mask.bmp
index 56ce6125db..56ce6125db 100644
--- a/rc/addressbook20mask.bmp
+++ b/share/pixmaps/addressbook20mask.bmp
Binary files differ
diff --git a/rc/bitcoin-bc.ico b/share/pixmaps/bitcoin-bc.ico
index 88cc240e2d..88cc240e2d 100644
--- a/rc/bitcoin-bc.ico
+++ b/share/pixmaps/bitcoin-bc.ico
Binary files differ
diff --git a/share/pixmaps/bitcoin.ico b/share/pixmaps/bitcoin.ico
new file mode 100644
index 0000000000..734d21701e
--- /dev/null
+++ b/share/pixmaps/bitcoin.ico
Binary files differ
diff --git a/rc/check.ico b/share/pixmaps/check.ico
index 0c4e6e8147..0c4e6e8147 100644
--- a/rc/check.ico
+++ b/share/pixmaps/check.ico
Binary files differ
diff --git a/rc/favicon.ico b/share/pixmaps/favicon.ico
index d249e41feb..d249e41feb 100644
--- a/rc/favicon.ico
+++ b/share/pixmaps/favicon.ico
Binary files differ
diff --git a/share/pixmaps/nsis-header.bmp b/share/pixmaps/nsis-header.bmp
new file mode 100644
index 0000000000..9ab0ce2591
--- /dev/null
+++ b/share/pixmaps/nsis-header.bmp
Binary files differ
diff --git a/share/pixmaps/nsis-wizard.bmp b/share/pixmaps/nsis-wizard.bmp
new file mode 100644
index 0000000000..71255c6850
--- /dev/null
+++ b/share/pixmaps/nsis-wizard.bmp
Binary files differ
diff --git a/rc/send16.bmp b/share/pixmaps/send16.bmp
index 676b5c4b49..676b5c4b49 100644
--- a/rc/send16.bmp
+++ b/share/pixmaps/send16.bmp
Binary files differ
diff --git a/rc/send16mask.bmp b/share/pixmaps/send16mask.bmp
index 06c747f934..06c747f934 100644
--- a/rc/send16mask.bmp
+++ b/share/pixmaps/send16mask.bmp
Binary files differ
diff --git a/rc/send16masknoshadow.bmp b/share/pixmaps/send16masknoshadow.bmp
index faf24e0d8a..faf24e0d8a 100644
--- a/rc/send16masknoshadow.bmp
+++ b/share/pixmaps/send16masknoshadow.bmp
Binary files differ
diff --git a/rc/send20.bmp b/share/pixmaps/send20.bmp
index 2b90422b38..2b90422b38 100644
--- a/rc/send20.bmp
+++ b/share/pixmaps/send20.bmp
Binary files differ
diff --git a/rc/send20mask.bmp b/share/pixmaps/send20mask.bmp
index f124d0da08..f124d0da08 100644
--- a/rc/send20mask.bmp
+++ b/share/pixmaps/send20mask.bmp
Binary files differ
diff --git a/setup.nsi b/share/setup.nsi
index a4efc603a2..b4bf3cff47 100644
--- a/setup.nsi
+++ b/share/setup.nsi
@@ -1,15 +1,20 @@
Name Bitcoin
RequestExecutionLevel highest
+SetCompressor /SOLID lzma
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 0.3.21
+!define VERSION 0.3.25
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
# MUI Symbol Definitions
-!define MUI_ICON "src\rc\bitcoin.ico"
+!define MUI_ICON "../share/pixmaps/bitcoin.ico"
+!define MUI_WELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_RIGHT
+!define MUI_HEADERIMAGE_BITMAP "../share/pixmaps/nsis-header.bmp"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
@@ -17,6 +22,7 @@ RequestExecutionLevel highest
!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
@@ -39,12 +45,13 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English
# Installer attributes
-OutFile bitcoin-0.3.21-win32-setup.exe
+OutFile bitcoin-0.3.25-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
+BrandingText " "
ShowInstDetails show
-VIProductVersion 0.3.21.0
+VIProductVersion 0.3.25.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
@@ -59,16 +66,15 @@ ShowUninstDetails show
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
- File bitcoin.exe
- File libeay32.dll
- File license.txt
- File readme.txt
+ File ../src/bitcoin.exe
+ File /oname=license.txt ../COPYING
+ File /oname=readme.txt ../doc/README_windows.txt
SetOutPath $INSTDIR\daemon
- File /r daemon\*.*
+ File ../src/bitcoind.exe
SetOutPath $INSTDIR\locale
- File /r locale\*.*
+ File /r ../locale/*.*
SetOutPath $INSTDIR\src
- File /r src\*.*
+ File /r /x *.exe /x *.o ../src\*.*
SetOutPath $INSTDIR
WriteRegStr HKCU "${REGKEY}\Components" Main 1
SectionEnd
@@ -108,7 +114,6 @@ done${UNSECTION_ID}:
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin.exe
- Delete /REBOOTOK $INSTDIR\libeay32.dll
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
diff --git a/share/ui.rc b/share/ui.rc
new file mode 100644
index 0000000000..063641cba2
--- /dev/null
+++ b/share/ui.rc
@@ -0,0 +1,15 @@
+bitcoin ICON "pixmaps/bitcoin.ico"
+
+#include "wx/msw/wx.rc"
+
+check ICON "pixmaps/check.ico"
+send16 BITMAP "pixmaps/send16.bmp"
+send16mask BITMAP "pixmaps/send16mask.bmp"
+send16masknoshadow BITMAP "pixmaps/send16masknoshadow.bmp"
+send20 BITMAP "pixmaps/send20.bmp"
+send20mask BITMAP "pixmaps/send20mask.bmp"
+addressbook16 BITMAP "pixmaps/addressbook16.bmp"
+addressbook16mask BITMAP "pixmaps/addressbook16mask.bmp"
+addressbook20 BITMAP "pixmaps/addressbook20.bmp"
+addressbook20mask BITMAP "pixmaps/addressbook20mask.bmp"
+favicon ICON "pixmaps/favicon.ico"
diff --git a/uiproject.fbp b/share/uiproject.fbp
index d55566eefc..7d2c258415 100644
--- a/uiproject.fbp
+++ b/share/uiproject.fbp
@@ -152,15 +152,15 @@
<property name="checked">0</property>
<property name="enabled">1</property>
<property name="help"></property>
- <property name="id">wxID_OPTIONSGENERATEBITCOINS</property>
- <property name="kind">wxITEM_CHECK</property>
- <property name="label">&amp;Generate Coins</property>
- <property name="name">m_menuOptionsGenerateBitcoins</property>
+ <property name="id">wxID_ANY</property>
+ <property name="kind">wxITEM_NORMAL</property>
+ <property name="label">&amp;Your Receiving Addresses...</property>
+ <property name="name">m_menuOptionsChangeYourAddress</property>
<property name="permission">none</property>
<property name="shortcut"></property>
<property name="unchecked_bitmap"></property>
- <event name="OnMenuSelection">OnMenuOptionsGenerate</event>
- <event name="OnUpdateUI">OnUpdateUIOptionsGenerate</event>
+ <event name="OnMenuSelection">OnMenuOptionsChangeYourAddress</event>
+ <event name="OnUpdateUI"></event>
</object>
<object class="wxMenuItem" expanded="1">
<property name="bitmap"></property>
@@ -169,12 +169,27 @@
<property name="help"></property>
<property name="id">wxID_ANY</property>
<property name="kind">wxITEM_NORMAL</property>
- <property name="label">&amp;Your Receiving Addresses...</property>
- <property name="name">m_menuOptionsChangeYourAddress</property>
- <property name="permission">none</property>
+ <property name="label">&amp;Encrypt Wallet...</property>
+ <property name="name">m_menuOptionsEncryptWallet</property>
+ <property name="permission">public</property>
<property name="shortcut"></property>
<property name="unchecked_bitmap"></property>
- <event name="OnMenuSelection">OnMenuOptionsChangeYourAddress</event>
+ <event name="OnMenuSelection">OnMenuOptionsEncryptWallet</event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ <object class="wxMenuItem" expanded="1">
+ <property name="bitmap"></property>
+ <property name="checked">0</property>
+ <property name="enabled">1</property>
+ <property name="help"></property>
+ <property name="id">wxID_ANY</property>
+ <property name="kind">wxITEM_NORMAL</property>
+ <property name="label">&amp;Change Wallet Encryption Passphrase...</property>
+ <property name="name">m_menuOptionsChangeWalletPassphrase</property>
+ <property name="permission">public</property>
+ <property name="shortcut"></property>
+ <property name="unchecked_bitmap"></property>
+ <event name="OnMenuSelection">OnMenuOptionsChangeWalletPassphrase</event>
<event name="OnUpdateUI"></event>
</object>
<object class="wxMenuItem" expanded="1">
@@ -1831,187 +1846,6 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag"></property>
- <property name="proportion">0</property>
- <object class="wxBoxSizer" expanded="1">
- <property name="minimum_size"></property>
- <property name="name">bSizer71</property>
- <property name="orient">wxHORIZONTAL</property>
- <property name="permission">none</property>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
- <property name="proportion">0</property>
- <object class="wxCheckBox" expanded="1">
- <property name="bg"></property>
- <property name="checked">0</property>
- <property name="context_help"></property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="label">&amp;Limit coin generation to</property>
- <property name="maximum_size"></property>
- <property name="minimum_size"></property>
- <property name="name">m_checkBoxLimitProcessors</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size"></property>
- <property name="style"></property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="validator_data_type"></property>
- <property name="validator_style">wxFILTER_NONE</property>
- <property name="validator_type">wxDefaultValidator</property>
- <property name="validator_variable"></property>
- <property name="window_extra_style"></property>
- <property name="window_name"></property>
- <property name="window_style"></property>
- <event name="OnChar"></event>
- <event name="OnCheckBox">OnCheckBoxLimitProcessors</event>
- <event name="OnEnterWindow"></event>
- <event name="OnEraseBackground"></event>
- <event name="OnKeyDown"></event>
- <event name="OnKeyUp"></event>
- <event name="OnKillFocus"></event>
- <event name="OnLeaveWindow"></event>
- <event name="OnLeftDClick"></event>
- <event name="OnLeftDown"></event>
- <event name="OnLeftUp"></event>
- <event name="OnMiddleDClick"></event>
- <event name="OnMiddleDown"></event>
- <event name="OnMiddleUp"></event>
- <event name="OnMotion"></event>
- <event name="OnMouseEvents"></event>
- <event name="OnMouseWheel"></event>
- <event name="OnPaint"></event>
- <event name="OnRightDClick"></event>
- <event name="OnRightDown"></event>
- <event name="OnRightUp"></event>
- <event name="OnSetFocus"></event>
- <event name="OnSize"></event>
- <event name="OnUpdateUI"></event>
- </object>
- </object>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALIGN_CENTER_VERTICAL</property>
- <property name="proportion">0</property>
- <object class="wxSpinCtrl" expanded="1">
- <property name="bg"></property>
- <property name="context_help"></property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="initial">1</property>
- <property name="max">999</property>
- <property name="maximum_size"></property>
- <property name="min">1</property>
- <property name="minimum_size"></property>
- <property name="name">m_spinCtrlLimitProcessors</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size">48,-1</property>
- <property name="style">wxSP_ARROW_KEYS</property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="validator_data_type"></property>
- <property name="validator_style">wxFILTER_NONE</property>
- <property name="validator_type">wxDefaultValidator</property>
- <property name="validator_variable"></property>
- <property name="value"></property>
- <property name="window_extra_style"></property>
- <property name="window_name"></property>
- <property name="window_style"></property>
- <event name="OnChar"></event>
- <event name="OnEnterWindow"></event>
- <event name="OnEraseBackground"></event>
- <event name="OnKeyDown"></event>
- <event name="OnKeyUp"></event>
- <event name="OnKillFocus"></event>
- <event name="OnLeaveWindow"></event>
- <event name="OnLeftDClick"></event>
- <event name="OnLeftDown"></event>
- <event name="OnLeftUp"></event>
- <event name="OnMiddleDClick"></event>
- <event name="OnMiddleDown"></event>
- <event name="OnMiddleUp"></event>
- <event name="OnMotion"></event>
- <event name="OnMouseEvents"></event>
- <event name="OnMouseWheel"></event>
- <event name="OnPaint"></event>
- <event name="OnRightDClick"></event>
- <event name="OnRightDown"></event>
- <event name="OnRightUp"></event>
- <event name="OnSetFocus"></event>
- <event name="OnSize"></event>
- <event name="OnSpinCtrl"></event>
- <event name="OnSpinCtrlText"></event>
- <event name="OnUpdateUI"></event>
- </object>
- </object>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
- <property name="proportion">0</property>
- <object class="wxStaticText" expanded="1">
- <property name="bg"></property>
- <property name="context_help"></property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="label">processors</property>
- <property name="maximum_size"></property>
- <property name="minimum_size"></property>
- <property name="name">m_staticText35</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size"></property>
- <property name="style"></property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="validator_data_type"></property>
- <property name="validator_style">wxFILTER_NONE</property>
- <property name="validator_type">wxDefaultValidator</property>
- <property name="validator_variable"></property>
- <property name="window_extra_style"></property>
- <property name="window_name"></property>
- <property name="window_style"></property>
- <property name="wrap">-1</property>
- <event name="OnChar"></event>
- <event name="OnEnterWindow"></event>
- <event name="OnEraseBackground"></event>
- <event name="OnKeyDown"></event>
- <event name="OnKeyUp"></event>
- <event name="OnKillFocus"></event>
- <event name="OnLeaveWindow"></event>
- <event name="OnLeftDClick"></event>
- <event name="OnLeftDown"></event>
- <event name="OnLeftUp"></event>
- <event name="OnMiddleDClick"></event>
- <event name="OnMiddleDown"></event>
- <event name="OnMiddleUp"></event>
- <event name="OnMotion"></event>
- <event name="OnMouseEvents"></event>
- <event name="OnMouseWheel"></event>
- <event name="OnPaint"></event>
- <event name="OnRightDClick"></event>
- <event name="OnRightDown"></event>
- <event name="OnRightUp"></event>
- <event name="OnSetFocus"></event>
- <event name="OnSize"></event>
- <event name="OnUpdateUI"></event>
- </object>
- </object>
- </object>
- </object>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
@@ -2256,7 +2090,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
- <property name="label">&amp;Connect through socks4 proxy: </property>
+ <property name="label">&amp;Connect through socks4 proxy (requires restart to apply): </property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_checkBoxUseProxy</property>
diff --git a/src/base58.h b/src/base58.h
new file mode 100644
index 0000000000..592756ff74
--- /dev/null
+++ b/src/base58.h
@@ -0,0 +1,308 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin Developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+
+
+//
+// Why base-58 instead of standard base-64 encoding?
+// - Don't want 0OIl characters that look the same in some fonts and
+// could be used to create visually identical looking account numbers.
+// - A string with non-alphanumeric characters is not as easily accepted as an account number.
+// - E-mail usually won't line-break if there's no punctuation to break at.
+// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
+//
+#ifndef BITCOIN_BASE58_H
+#define BITCOIN_BASE58_H
+
+#include <string>
+#include <vector>
+#include "bignum.h"
+
+static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
+
+
+inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
+{
+ CAutoBN_CTX pctx;
+ CBigNum bn58 = 58;
+ CBigNum bn0 = 0;
+
+ // Convert big endian data to little endian
+ // Extra zero at the end make sure bignum will interpret as a positive number
+ std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
+ reverse_copy(pbegin, pend, vchTmp.begin());
+
+ // Convert little endian data to bignum
+ CBigNum bn;
+ bn.setvch(vchTmp);
+
+ // Convert bignum to std::string
+ std::string str;
+ // Expected size increase from base58 conversion is approximately 137%
+ // use 138% to be safe
+ str.reserve((pend - pbegin) * 138 / 100 + 1);
+ CBigNum dv;
+ CBigNum rem;
+ while (bn > bn0)
+ {
+ if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
+ throw bignum_error("EncodeBase58 : BN_div failed");
+ bn = dv;
+ unsigned int c = rem.getulong();
+ str += pszBase58[c];
+ }
+
+ // Leading zeroes encoded as base58 zeros
+ for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
+ str += pszBase58[0];
+
+ // Convert little endian std::string to big endian
+ reverse(str.begin(), str.end());
+ return str;
+}
+
+inline std::string EncodeBase58(const std::vector<unsigned char>& vch)
+{
+ return EncodeBase58(&vch[0], &vch[0] + vch.size());
+}
+
+inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
+{
+ CAutoBN_CTX pctx;
+ vchRet.clear();
+ CBigNum bn58 = 58;
+ CBigNum bn = 0;
+ CBigNum bnChar;
+ while (isspace(*psz))
+ psz++;
+
+ // Convert big endian string to bignum
+ for (const char* p = psz; *p; p++)
+ {
+ const char* p1 = strchr(pszBase58, *p);
+ if (p1 == NULL)
+ {
+ while (isspace(*p))
+ p++;
+ if (*p != '\0')
+ return false;
+ break;
+ }
+ bnChar.setulong(p1 - pszBase58);
+ if (!BN_mul(&bn, &bn, &bn58, pctx))
+ throw bignum_error("DecodeBase58 : BN_mul failed");
+ bn += bnChar;
+ }
+
+ // Get bignum as little endian data
+ std::vector<unsigned char> vchTmp = bn.getvch();
+
+ // Trim off sign byte if present
+ if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
+ vchTmp.erase(vchTmp.end()-1);
+
+ // Restore leading zeros
+ int nLeadingZeros = 0;
+ for (const char* p = psz; *p == pszBase58[0]; p++)
+ nLeadingZeros++;
+ vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
+
+ // Convert little endian data to big endian
+ reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
+ return true;
+}
+
+inline bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
+{
+ return DecodeBase58(str.c_str(), vchRet);
+}
+
+
+
+
+
+inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
+{
+ // add 4-byte hash check to the end
+ std::vector<unsigned char> vch(vchIn);
+ uint256 hash = Hash(vch.begin(), vch.end());
+ vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
+ return EncodeBase58(vch);
+}
+
+inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
+{
+ if (!DecodeBase58(psz, vchRet))
+ return false;
+ if (vchRet.size() < 4)
+ {
+ vchRet.clear();
+ return false;
+ }
+ uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
+ if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
+ {
+ vchRet.clear();
+ return false;
+ }
+ vchRet.resize(vchRet.size()-4);
+ return true;
+}
+
+inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
+{
+ return DecodeBase58Check(str.c_str(), vchRet);
+}
+
+
+
+
+
+
+class CBase58Data
+{
+protected:
+ unsigned char nVersion;
+ std::vector<unsigned char> vchData;
+
+ CBase58Data()
+ {
+ nVersion = 0;
+ vchData.clear();
+ }
+
+ ~CBase58Data()
+ {
+ if (!vchData.empty())
+ memset(&vchData[0], 0, vchData.size());
+ }
+
+ void SetData(int nVersionIn, const void* pdata, size_t nSize)
+ {
+ nVersion = nVersionIn;
+ vchData.resize(nSize);
+ if (!vchData.empty())
+ memcpy(&vchData[0], pdata, nSize);
+ }
+
+ void SetData(int nVersionIn, const unsigned char *pbegin, const unsigned char *pend)
+ {
+ SetData(nVersionIn, (void*)pbegin, pend - pbegin);
+ }
+
+public:
+ bool SetString(const char* psz)
+ {
+ std::vector<unsigned char> vchTemp;
+ DecodeBase58Check(psz, vchTemp);
+ if (vchTemp.empty())
+ {
+ vchData.clear();
+ nVersion = 0;
+ return false;
+ }
+ nVersion = vchTemp[0];
+ vchData.resize(vchTemp.size() - 1);
+ if (!vchData.empty())
+ memcpy(&vchData[0], &vchTemp[1], vchData.size());
+ memset(&vchTemp[0], 0, vchTemp.size());
+ return true;
+ }
+
+ bool SetString(const std::string& str)
+ {
+ return SetString(str.c_str());
+ }
+
+ std::string ToString() const
+ {
+ std::vector<unsigned char> vch(1, nVersion);
+ vch.insert(vch.end(), vchData.begin(), vchData.end());
+ return EncodeBase58Check(vch);
+ }
+
+ int CompareTo(const CBase58Data& b58) const
+ {
+ if (nVersion < b58.nVersion) return -1;
+ if (nVersion > b58.nVersion) return 1;
+ if (vchData < b58.vchData) return -1;
+ if (vchData > b58.vchData) return 1;
+ return 0;
+ }
+
+ bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; }
+ bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; }
+ bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; }
+ bool operator< (const CBase58Data& b58) const { return CompareTo(b58) < 0; }
+ bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
+};
+
+
+class CBitcoinAddress : public CBase58Data
+{
+public:
+ bool SetHash160(const uint160& hash160)
+ {
+ SetData(fTestNet ? 111 : 0, &hash160, 20);
+ return true;
+ }
+
+ bool SetPubKey(const std::vector<unsigned char>& vchPubKey)
+ {
+ return SetHash160(Hash160(vchPubKey));
+ }
+
+ bool IsValid() const
+ {
+ int nExpectedSize = 20;
+ bool fExpectTestNet = false;
+ switch(nVersion)
+ {
+ case 0:
+ break;
+
+ case 111:
+ fExpectTestNet = true;
+ break;
+
+ default:
+ return false;
+ }
+ return fExpectTestNet == fTestNet && vchData.size() == nExpectedSize;
+ }
+
+ CBitcoinAddress()
+ {
+ }
+
+ CBitcoinAddress(uint160 hash160In)
+ {
+ SetHash160(hash160In);
+ }
+
+ CBitcoinAddress(const std::vector<unsigned char>& vchPubKey)
+ {
+ SetPubKey(vchPubKey);
+ }
+
+ CBitcoinAddress(const std::string& strAddress)
+ {
+ SetString(strAddress);
+ }
+
+ CBitcoinAddress(const char* pszAddress)
+ {
+ SetString(pszAddress);
+ }
+
+ uint160 GetHash160() const
+ {
+ assert(vchData.size() == 20);
+ uint160 hash160;
+ memcpy(&hash160, &vchData[0], 20);
+ return hash160;
+ }
+};
+
+#endif
diff --git a/bignum.h b/src/bignum.h
index 450e809d3d..1a2406b935 100644
--- a/bignum.h
+++ b/src/bignum.h
@@ -1,14 +1,15 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_BIGNUM_H
+#define BITCOIN_BIGNUM_H
#include <stdexcept>
#include <vector>
#include <openssl/bn.h>
-
-
-
+#include "util.h"
class bignum_error : public std::runtime_error
{
@@ -228,10 +229,13 @@ public:
{
std::vector<unsigned char> vch2(vch.size() + 4);
unsigned int nSize = vch.size();
+ // BIGNUM's byte stream format expects 4 bytes of
+ // big endian size data info at the front
vch2[0] = (nSize >> 24) & 0xff;
vch2[1] = (nSize >> 16) & 0xff;
vch2[2] = (nSize >> 8) & 0xff;
vch2[3] = (nSize >> 0) & 0xff;
+ // swap data to big endian
reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4);
BN_mpi2bn(&vch2[0], vch2.size(), this);
}
@@ -308,7 +312,7 @@ public:
CAutoBN_CTX pctx;
CBigNum bnBase = nBase;
CBigNum bn0 = 0;
- string str;
+ std::string str;
CBigNum bn = *this;
BN_set_negative(&bn, false);
CBigNum dv;
@@ -348,7 +352,7 @@ public:
template<typename Stream>
void Unserialize(Stream& s, int nType=0, int nVersion=VERSION)
{
- vector<unsigned char> vch;
+ std::vector<unsigned char> vch;
::Unserialize(s, vch, nType, nVersion);
setvch(vch);
}
@@ -530,3 +534,5 @@ inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a,
inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); }
inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); }
+
+#endif
diff --git a/src/crypter.cpp b/src/crypter.cpp
new file mode 100644
index 0000000000..9a8e6ca89a
--- /dev/null
+++ b/src/crypter.cpp
@@ -0,0 +1,132 @@
+// Copyright (c) 2011 The Bitcoin Developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <openssl/aes.h>
+#include <openssl/evp.h>
+#include <vector>
+#include <string>
+#include "headers.h"
+#ifdef __WXMSW__
+#include <windows.h>
+#endif
+
+#include "crypter.h"
+#include "main.h"
+#include "util.h"
+
+bool CCrypter::SetKeyFromPassphrase(const std::string& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
+{
+ if (nRounds < 1 || chSalt.size() != WALLET_CRYPTO_SALT_SIZE)
+ return false;
+
+ // Try to keep the keydata out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap)
+ // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
+ // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
+ mlock(&chKey[0], sizeof chKey);
+ mlock(&chIV[0], sizeof chIV);
+
+ int i = 0;
+ if (nDerivationMethod == 0)
+ i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0],
+ (unsigned char *)&strKeyData[0], strKeyData.size(), nRounds, chKey, chIV);
+
+ if (i != WALLET_CRYPTO_KEY_SIZE)
+ {
+ memset(&chKey, 0, sizeof chKey);
+ memset(&chIV, 0, sizeof chIV);
+ return false;
+ }
+
+ fKeySet = true;
+ return true;
+}
+
+bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigned char>& chNewIV)
+{
+ if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_KEY_SIZE)
+ return false;
+
+ // Try to keep the keydata out of swap
+ // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
+ // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
+ mlock(&chKey[0], sizeof chKey);
+ mlock(&chIV[0], sizeof chIV);
+
+ memcpy(&chKey[0], &chNewKey[0], sizeof chKey);
+ memcpy(&chIV[0], &chNewIV[0], sizeof chIV);
+
+ fKeySet = true;
+ return true;
+}
+
+bool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext)
+{
+ if (!fKeySet)
+ return false;
+
+ // max ciphertext len for a n bytes of plaintext is
+ // n + AES_BLOCK_SIZE - 1 bytes
+ int nLen = vchPlaintext.size();
+ int nCLen = nLen + AES_BLOCK_SIZE, nFLen = 0;
+ vchCiphertext = std::vector<unsigned char> (nCLen);
+
+ EVP_CIPHER_CTX ctx;
+
+ EVP_CIPHER_CTX_init(&ctx);
+ EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV);
+
+ EVP_EncryptUpdate(&ctx, &vchCiphertext[0], &nCLen, &vchPlaintext[0], nLen);
+ EVP_EncryptFinal_ex(&ctx, (&vchCiphertext[0])+nCLen, &nFLen);
+
+ EVP_CIPHER_CTX_cleanup(&ctx);
+
+ vchCiphertext.resize(nCLen + nFLen);
+ return true;
+}
+
+bool CCrypter::Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext)
+{
+ if (!fKeySet)
+ return false;
+
+ // plaintext will always be equal to or lesser than length of ciphertext
+ int nLen = vchCiphertext.size();
+ int nPLen = nLen, nFLen = 0;
+
+ vchPlaintext = CKeyingMaterial(nPLen);
+
+ EVP_CIPHER_CTX ctx;
+
+ EVP_CIPHER_CTX_init(&ctx);
+ EVP_DecryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV);
+
+ EVP_DecryptUpdate(&ctx, &vchPlaintext[0], &nPLen, &vchCiphertext[0], nLen);
+ EVP_DecryptFinal_ex(&ctx, (&vchPlaintext[0])+nPLen, &nFLen);
+
+ EVP_CIPHER_CTX_cleanup(&ctx);
+
+ vchPlaintext.resize(nPLen + nFLen);
+ return true;
+}
+
+
+bool EncryptSecret(CKeyingMaterial& vMasterKey, const CSecret &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)
+{
+ CCrypter cKeyCrypter;
+ std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
+ memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
+ if(!cKeyCrypter.SetKey(vMasterKey, chIV))
+ return false;
+ return cKeyCrypter.Encrypt((CKeyingMaterial)vchPlaintext, vchCiphertext);
+}
+
+bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CSecret& vchPlaintext)
+{
+ CCrypter cKeyCrypter;
+ std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
+ memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
+ if(!cKeyCrypter.SetKey(vMasterKey, chIV))
+ return false;
+ return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));
+}
diff --git a/src/crypter.h b/src/crypter.h
new file mode 100644
index 0000000000..5b95ea415e
--- /dev/null
+++ b/src/crypter.h
@@ -0,0 +1,96 @@
+// Copyright (c) 2011 The Bitcoin Developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#ifndef __CRYPTER_H__
+#define __CRYPTER_H__
+
+#include "key.h"
+
+const unsigned int WALLET_CRYPTO_KEY_SIZE = 32;
+const unsigned int WALLET_CRYPTO_SALT_SIZE = 8;
+
+/*
+Private key encryption is done based on a CMasterKey,
+which holds a salt and random encryption key.
+
+CMasterKeys is encrypted using AES-256-CBC using a key
+derived using derivation method nDerivationMethod
+(0 == EVP_sha512()) and derivation iterations nDeriveIterations.
+vchOtherDerivationParameters is provided for alternative algorithms
+which may require more parameters (such as scrypt).
+
+Wallet Private Keys are then encrypted using AES-256-CBC
+with the double-sha256 of the private key as the IV, and the
+master key's key as the encryption key.
+*/
+
+class CMasterKey
+{
+public:
+ std::vector<unsigned char> vchCryptedKey;
+ std::vector<unsigned char> vchSalt;
+ // 0 = EVP_sha512()
+ // 1 = scrypt()
+ unsigned int nDerivationMethod;
+ unsigned int nDeriveIterations;
+ // Use this for more parameters to key derivation,
+ // such as the various parameters to scrypt
+ std::vector<unsigned char> vchOtherDerivationParameters;
+
+ IMPLEMENT_SERIALIZE
+ (
+ READWRITE(vchCryptedKey);
+ READWRITE(vchSalt);
+ READWRITE(nDerivationMethod);
+ READWRITE(nDeriveIterations);
+ READWRITE(vchOtherDerivationParameters);
+ )
+ CMasterKey()
+ {
+ // 25000 rounds is just under 0.1 seconds on a 1.86 GHz Pentium M
+ // ie slightly lower than the lowest hardware we need bother supporting
+ nDeriveIterations = 25000;
+ nDerivationMethod = 0;
+ vchOtherDerivationParameters = std::vector<unsigned char>(0);
+ }
+};
+
+typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
+
+class CCrypter
+{
+private:
+ unsigned char chKey[WALLET_CRYPTO_KEY_SIZE];
+ unsigned char chIV[WALLET_CRYPTO_KEY_SIZE];
+ bool fKeySet;
+
+public:
+ bool SetKeyFromPassphrase(const std::string &strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod);
+ bool Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext);
+ bool Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext);
+ bool SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigned char>& chNewIV);
+
+ void CleanKey()
+ {
+ memset(&chKey, 0, sizeof chKey);
+ memset(&chIV, 0, sizeof chIV);
+ munlock(&chKey, sizeof chKey);
+ munlock(&chIV, sizeof chIV);
+ fKeySet = false;
+ }
+
+ CCrypter()
+ {
+ fKeySet = false;
+ }
+
+ ~CCrypter()
+ {
+ CleanKey();
+ }
+};
+
+bool EncryptSecret(CKeyingMaterial& vMasterKey, const CSecret &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext);
+bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char> &vchCiphertext, const uint256& nIV, CSecret &vchPlaintext);
+
+#endif
diff --git a/cryptopp/License.txt b/src/cryptopp/License.txt
index fc3f054693..fc3f054693 100644
--- a/cryptopp/License.txt
+++ b/src/cryptopp/License.txt
diff --git a/cryptopp/Readme.txt b/src/cryptopp/Readme.txt
index 861c036c68..861c036c68 100644
--- a/cryptopp/Readme.txt
+++ b/src/cryptopp/Readme.txt
diff --git a/cryptopp/config.h b/src/cryptopp/config.h
index 0737027f41..0737027f41 100644
--- a/cryptopp/config.h
+++ b/src/cryptopp/config.h
diff --git a/cryptopp/cpu.cpp b/src/cryptopp/cpu.cpp
index 3e46804212..8789dc3176 100644
--- a/cryptopp/cpu.cpp
+++ b/src/cryptopp/cpu.cpp
@@ -80,7 +80,7 @@ bool CpuId(word32 input, word32 *output)
#endif
}
-#ifndef _MSC_VER
+#if !CRYPTOPP_BOOL_X64 && !defined(_MSC_VER) && defined(__GNUC__)
static jmp_buf s_jmpNoSSE2;
static void SigIllHandlerSSE2(int)
{
diff --git a/cryptopp/cpu.h b/src/cryptopp/cpu.h
index 7f01dad852..7f01dad852 100644
--- a/cryptopp/cpu.h
+++ b/src/cryptopp/cpu.h
diff --git a/cryptopp/cryptlib.h b/src/cryptopp/cryptlib.h
index 15cd6dad67..15cd6dad67 100644
--- a/cryptopp/cryptlib.h
+++ b/src/cryptopp/cryptlib.h
diff --git a/cryptopp/iterhash.h b/src/cryptopp/iterhash.h
index 2f5895e2d3..2f5895e2d3 100644
--- a/cryptopp/iterhash.h
+++ b/src/cryptopp/iterhash.h
diff --git a/cryptopp/misc.h b/src/cryptopp/misc.h
index de8037bf61..de8037bf61 100644
--- a/cryptopp/misc.h
+++ b/src/cryptopp/misc.h
diff --git a/cryptopp/obj/.gitignore b/src/cryptopp/obj/.gitignore
index d6b7ef32c8..d6b7ef32c8 100644
--- a/cryptopp/obj/.gitignore
+++ b/src/cryptopp/obj/.gitignore
diff --git a/cryptopp/pch.h b/src/cryptopp/pch.h
index 418c39076d..418c39076d 100644
--- a/cryptopp/pch.h
+++ b/src/cryptopp/pch.h
diff --git a/cryptopp/secblock.h b/src/cryptopp/secblock.h
index 2025757dbb..2025757dbb 100644
--- a/cryptopp/secblock.h
+++ b/src/cryptopp/secblock.h
diff --git a/cryptopp/sha.cpp b/src/cryptopp/sha.cpp
index fd0b0a2596..fd0b0a2596 100644
--- a/cryptopp/sha.cpp
+++ b/src/cryptopp/sha.cpp
diff --git a/cryptopp/sha.h b/src/cryptopp/sha.h
index 679081e8fa..679081e8fa 100644
--- a/cryptopp/sha.h
+++ b/src/cryptopp/sha.h
diff --git a/cryptopp/simple.h b/src/cryptopp/simple.h
index 8b13789179..8b13789179 100644
--- a/cryptopp/simple.h
+++ b/src/cryptopp/simple.h
diff --git a/cryptopp/smartptr.h b/src/cryptopp/smartptr.h
index 6b4040e999..6b4040e999 100644
--- a/cryptopp/smartptr.h
+++ b/src/cryptopp/smartptr.h
diff --git a/cryptopp/stdcpp.h b/src/cryptopp/stdcpp.h
index 9a468ab61e..9a468ab61e 100644
--- a/cryptopp/stdcpp.h
+++ b/src/cryptopp/stdcpp.h
diff --git a/db.cpp b/src/db.cpp
index 28a8b71733..72542705a6 100644
--- a/db.cpp
+++ b/src/db.cpp
@@ -1,10 +1,16 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "db.h"
+#include "net.h"
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
-void ThreadFlushWalletDB(void* parg);
+using namespace std;
+using namespace boost;
unsigned int nWalletDBUpdated;
@@ -144,7 +150,7 @@ void CDB::Close()
--mapFileUseCount[strFile];
}
-void CloseDb(const string& strFile)
+void static CloseDb(const string& strFile)
{
CRITICAL_BLOCK(cs_db)
{
@@ -353,7 +359,7 @@ bool CTxDB::WriteBestInvalidWork(CBigNum bnBestInvalidWork)
return Write(string("bnBestInvalidWork"), bnBestInvalidWork);
}
-CBlockIndex* InsertBlockIndex(uint256 hash)
+CBlockIndex static * InsertBlockIndex(uint256 hash)
{
if (hash == 0)
return NULL;
@@ -434,13 +440,13 @@ bool CTxDB::LoadBlockIndex()
// Calculate bnChainWork
vector<pair<int, CBlockIndex*> > vSortedByHeight;
vSortedByHeight.reserve(mapBlockIndex.size());
- foreach(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
+ BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
{
CBlockIndex* pindex = item.second;
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
}
sort(vSortedByHeight.begin(), vSortedByHeight.end());
- foreach(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
+ BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
{
CBlockIndex* pindex = item.second;
pindex->bnChainWork = (pindex->pprev ? pindex->pprev->bnChainWork : 0) + pindex->GetBlockWork();
@@ -523,7 +529,7 @@ bool CAddrDB::LoadAddresses()
char psz[1000];
while (fgets(psz, sizeof(psz), filein))
{
- CAddress addr(psz, NODE_NETWORK);
+ CAddress addr(psz, false, NODE_NETWORK);
addr.nTime = 0; // so it won't relay unless successfully connected
if (addr.IsValid())
AddAddress(addr);
@@ -578,8 +584,19 @@ bool LoadAddresses()
// CWalletDB
//
-static set<int64> setKeyPool;
-static CCriticalSection cs_setKeyPool;
+bool CWalletDB::WriteName(const string& strAddress, const string& strName)
+{
+ nWalletDBUpdated++;
+ return Write(make_pair(string("name"), strAddress), strName);
+}
+
+bool CWalletDB::EraseName(const string& strAddress)
+{
+ // This should only be used for sending addresses, never for receiving addresses,
+ // receiving addresses must always have an address book entry if they're not change return.
+ nWalletDBUpdated++;
+ return Erase(make_pair(string("name"), strAddress));
+}
bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account)
{
@@ -594,7 +611,7 @@ bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account)
bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry)
{
- return Write(make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry);
+ return Write(boost::make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry);
}
int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
@@ -603,7 +620,7 @@ int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
ListAccountCreditDebit(strAccount, entries);
int64 nCreditDebit = 0;
- foreach (const CAccountingEntry& entry, entries)
+ BOOST_FOREACH (const CAccountingEntry& entry, entries)
nCreditDebit += entry.nCreditDebit;
return nCreditDebit;
@@ -611,8 +628,6 @@ int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& entries)
{
- int64 nCreditDebit = 0;
-
bool fAllAccounts = (strAccount == "*");
Dbc* pcursor = GetCursor();
@@ -624,7 +639,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
// Read next record
CDataStream ssKey;
if (fFlags == DB_SET_RANGE)
- ssKey << make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0));
+ ssKey << boost::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0));
CDataStream ssValue;
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
@@ -654,9 +669,9 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
}
-bool CWalletDB::LoadWallet()
+int CWalletDB::LoadWallet(CWallet* pwallet)
{
- vchDefaultKey.clear();
+ pwallet->vchDefaultKey.clear();
int nFileVersion = 0;
vector<uint256> vWalletUpgrade;
@@ -668,13 +683,13 @@ bool CWalletDB::LoadWallet()
#endif
//// todo: shouldn't we catch exceptions and try to recover and continue?
- CRITICAL_BLOCK(cs_mapWallet)
- CRITICAL_BLOCK(cs_mapKeys)
+ CRITICAL_BLOCK(pwallet->cs_mapWallet)
+ CRITICAL_BLOCK(pwallet->cs_KeyStore)
{
// Get cursor
Dbc* pcursor = GetCursor();
if (!pcursor)
- return false;
+ return DB_CORRUPT;
loop
{
@@ -685,7 +700,7 @@ bool CWalletDB::LoadWallet()
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
- return false;
+ return DB_CORRUPT;
// Unserialize
// Taking advantage of the fact that pair serialization
@@ -696,14 +711,15 @@ bool CWalletDB::LoadWallet()
{
string strAddress;
ssKey >> strAddress;
- ssValue >> mapAddressBook[strAddress];
+ ssValue >> pwallet->mapAddressBook[strAddress];
}
else if (strType == "tx")
{
uint256 hash;
ssKey >> hash;
- CWalletTx& wtx = mapWallet[hash];
+ CWalletTx& wtx = pwallet->mapWallet[hash];
ssValue >> wtx;
+ wtx.pwallet = pwallet;
if (wtx.GetHash() != hash)
printf("Error in wallet.dat, hash mismatch\n");
@@ -748,24 +764,52 @@ bool CWalletDB::LoadWallet()
{
vector<unsigned char> vchPubKey;
ssKey >> vchPubKey;
- CWalletKey wkey;
+ CKey key;
if (strType == "key")
- ssValue >> wkey.vchPrivKey;
+ {
+ CPrivKey pkey;
+ ssValue >> pkey;
+ key.SetPrivKey(pkey);
+ }
else
+ {
+ CWalletKey wkey;
ssValue >> wkey;
-
- mapKeys[vchPubKey] = wkey.vchPrivKey;
- mapPubKeys[Hash160(vchPubKey)] = vchPubKey;
+ key.SetPrivKey(wkey.vchPrivKey);
+ }
+ if (!pwallet->LoadKey(key))
+ return DB_CORRUPT;
+ }
+ else if (strType == "mkey")
+ {
+ unsigned int nID;
+ ssKey >> nID;
+ CMasterKey kMasterKey;
+ ssValue >> kMasterKey;
+ if(pwallet->mapMasterKeys.count(nID) != 0)
+ return DB_CORRUPT;
+ pwallet->mapMasterKeys[nID] = kMasterKey;
+ if (pwallet->nMasterKeyMaxID < nID)
+ pwallet->nMasterKeyMaxID = nID;
+ }
+ else if (strType == "ckey")
+ {
+ vector<unsigned char> vchPubKey;
+ ssKey >> vchPubKey;
+ vector<unsigned char> vchPrivKey;
+ ssValue >> vchPrivKey;
+ if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey))
+ return DB_CORRUPT;
}
else if (strType == "defaultkey")
{
- ssValue >> vchDefaultKey;
+ ssValue >> pwallet->vchDefaultKey;
}
else if (strType == "pool")
{
int64 nIndex;
ssKey >> nIndex;
- setKeyPool.insert(nIndex);
+ pwallet->setKeyPool.insert(nIndex);
}
else if (strType == "version")
{
@@ -778,12 +822,11 @@ bool CWalletDB::LoadWallet()
string strKey;
ssKey >> strKey;
- // Menu state
- if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins;
-
// Options
+#ifndef GUI
+ if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins;
+#endif
if (strKey == "nTransactionFee") ssValue >> nTransactionFee;
- if (strKey == "addrIncoming") ssValue >> addrIncoming;
if (strKey == "fLimitProcessors") ssValue >> fLimitProcessors;
if (strKey == "nLimitProcessors") ssValue >> nLimitProcessors;
if (strKey == "fMinimizeToTray") ssValue >> fMinimizeToTray;
@@ -792,17 +835,23 @@ bool CWalletDB::LoadWallet()
if (strKey == "addrProxy") ssValue >> addrProxy;
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
}
+ else if (strType == "minversion")
+ {
+ int nMinVersion = 0;
+ ssValue >> nMinVersion;
+ if (nMinVersion > VERSION)
+ return DB_TOO_NEW;
+ }
}
pcursor->close();
}
- foreach(uint256 hash, vWalletUpgrade)
- WriteTx(hash, mapWallet[hash]);
+ BOOST_FOREACH(uint256 hash, vWalletUpgrade)
+ WriteTx(hash, pwallet->mapWallet[hash]);
printf("nFileVersion = %d\n", nFileVersion);
printf("fGenerateBitcoins = %d\n", fGenerateBitcoins);
printf("nTransactionFee = %"PRI64d"\n", nTransactionFee);
- printf("addrIncoming = %s\n", addrIncoming.ToString().c_str());
printf("fMinimizeToTray = %d\n", fMinimizeToTray);
printf("fMinimizeOnClose = %d\n", fMinimizeOnClose);
printf("fUseProxy = %d\n", fUseProxy);
@@ -822,40 +871,12 @@ bool CWalletDB::LoadWallet()
}
- return true;
-}
-
-bool LoadWallet(bool& fFirstRunRet)
-{
- fFirstRunRet = false;
- if (!CWalletDB("cr+").LoadWallet())
- return false;
- fFirstRunRet = vchDefaultKey.empty();
-
- if (mapKeys.count(vchDefaultKey))
- {
- // Set keyUser
- keyUser.SetPubKey(vchDefaultKey);
- keyUser.SetPrivKey(mapKeys[vchDefaultKey]);
- }
- else
- {
- // Create new keyUser and set as default key
- RandAddSeedPerfmon();
- keyUser.MakeNewKey();
- if (!AddKey(keyUser))
- return false;
- if (!SetAddressBookName(PubKeyToAddress(keyUser.GetPubKey()), ""))
- return false;
- CWalletDB().WriteDefaultKey(keyUser.GetPubKey());
- }
-
- CreateThread(ThreadFlushWalletDB, NULL);
- return true;
+ return DB_LOAD_OK;
}
void ThreadFlushWalletDB(void* parg)
{
+ const string& strFile = ((const string*)parg)[0];
static bool fOneThread;
if (fOneThread)
return;
@@ -891,7 +912,6 @@ void ThreadFlushWalletDB(void* parg)
if (nRefCount == 0 && !fShutdown)
{
- string strFile = "wallet.dat";
map<string, int>::iterator mi = mapFileUseCount.find(strFile);
if (mi != mapFileUseCount.end())
{
@@ -914,26 +934,27 @@ void ThreadFlushWalletDB(void* parg)
}
}
-void BackupWallet(const string& strDest)
+bool BackupWallet(const CWallet& wallet, const string& strDest)
{
+ if (!wallet.fFileBacked)
+ return false;
while (!fShutdown)
{
CRITICAL_BLOCK(cs_db)
{
- const string strFile = "wallet.dat";
- if (!mapFileUseCount.count(strFile) || mapFileUseCount[strFile] == 0)
+ if (!mapFileUseCount.count(wallet.strWalletFile) || mapFileUseCount[wallet.strWalletFile] == 0)
{
// Flush log data to the dat file
- CloseDb(strFile);
+ CloseDb(wallet.strWalletFile);
dbenv.txn_checkpoint(0, 0, 0);
- dbenv.lsn_reset(strFile.c_str(), 0);
- mapFileUseCount.erase(strFile);
+ dbenv.lsn_reset(wallet.strWalletFile.c_str(), 0);
+ mapFileUseCount.erase(wallet.strWalletFile);
// Copy wallet.dat
- filesystem::path pathSrc(GetDataDir() + "/" + strFile);
+ filesystem::path pathSrc(GetDataDir() + "/" + wallet.strWalletFile);
filesystem::path pathDest(strDest);
if (filesystem::is_directory(pathDest))
- pathDest = pathDest / strFile;
+ pathDest = pathDest / wallet.strWalletFile;
#if BOOST_VERSION >= 104000
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
#else
@@ -941,83 +962,10 @@ void BackupWallet(const string& strDest)
#endif
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
- return;
+ return true;
}
}
Sleep(100);
}
-}
-
-
-void CWalletDB::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
-{
- nIndex = -1;
- keypool.vchPubKey.clear();
- CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
- CRITICAL_BLOCK(cs_setKeyPool)
- {
- // Top up key pool
- int64 nTargetSize = max(GetArg("-keypool", 100), (int64)0);
- while (setKeyPool.size() < nTargetSize+1)
- {
- int64 nEnd = 1;
- if (!setKeyPool.empty())
- nEnd = *(--setKeyPool.end()) + 1;
- if (!Write(make_pair(string("pool"), nEnd), CKeyPool(GenerateNewKey())))
- throw runtime_error("ReserveKeyFromKeyPool() : writing generated key failed");
- setKeyPool.insert(nEnd);
- printf("keypool added key %"PRI64d", size=%d\n", nEnd, setKeyPool.size());
- }
-
- // Get the oldest key
- assert(!setKeyPool.empty());
- nIndex = *(setKeyPool.begin());
- setKeyPool.erase(setKeyPool.begin());
- if (!Read(make_pair(string("pool"), nIndex), keypool))
- throw runtime_error("ReserveKeyFromKeyPool() : read failed");
- if (!mapKeys.count(keypool.vchPubKey))
- throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
- assert(!keypool.vchPubKey.empty());
- printf("keypool reserve %"PRI64d"\n", nIndex);
- }
-}
-
-void CWalletDB::KeepKey(int64 nIndex)
-{
- // Remove from key pool
- CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
- {
- Erase(make_pair(string("pool"), nIndex));
- }
- printf("keypool keep %"PRI64d"\n", nIndex);
-}
-
-void CWalletDB::ReturnKey(int64 nIndex)
-{
- // Return to key pool
- CRITICAL_BLOCK(cs_setKeyPool)
- setKeyPool.insert(nIndex);
- printf("keypool return %"PRI64d"\n", nIndex);
-}
-
-vector<unsigned char> GetKeyFromKeyPool()
-{
- CWalletDB walletdb;
- int64 nIndex = 0;
- CKeyPool keypool;
- walletdb.ReserveKeyFromKeyPool(nIndex, keypool);
- walletdb.KeepKey(nIndex);
- return keypool.vchPubKey;
-}
-
-int64 GetOldestKeyPoolTime()
-{
- CWalletDB walletdb;
- int64 nIndex = 0;
- CKeyPool keypool;
- walletdb.ReserveKeyFromKeyPool(nIndex, keypool);
- walletdb.ReturnKey(nIndex);
- return keypool.nTime;
+ return false;
}
diff --git a/db.h b/src/db.h
index 290981c06a..73ea1902cc 100644
--- a/db.h
+++ b/src/db.h
@@ -1,34 +1,37 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_DB_H
+#define BITCOIN_DB_H
+
+#include "key.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <db_cxx.h>
-class CTransaction;
class CTxIndex;
class CDiskBlockIndex;
class CDiskTxPos;
class COutPoint;
-class CUser;
-class CReview;
class CAddress;
class CWalletTx;
+class CWallet;
class CAccount;
class CAccountingEntry;
class CBlockLocator;
-extern map<string, string> mapAddressBook;
-extern CCriticalSection cs_mapAddressBook;
-extern vector<unsigned char> vchDefaultKey;
-extern bool fClient;
-extern int nBestHeight;
-
extern unsigned int nWalletDBUpdated;
extern DbEnv dbenv;
extern void DBFlush(bool fShutdown);
-extern vector<unsigned char> GetKeyFromKeyPool();
-extern int64 GetOldestKeyPoolTime();
+void ThreadFlushWalletDB(void* parg);
+bool BackupWallet(const CWallet& wallet, const std::string& strDest);
@@ -37,8 +40,8 @@ class CDB
{
protected:
Db* pdb;
- string strFile;
- vector<DbTxn*> vTxn;
+ std::string strFile;
+ std::vector<DbTxn*> vTxn;
bool fReadOnly;
explicit CDB(const char* pszFile, const char* pszMode="r+");
@@ -86,7 +89,7 @@ protected:
if (!pdb)
return false;
if (fReadOnly)
- assert(("Write called on database in read-only mode", false));
+ assert(!"Write called on database in read-only mode");
// Key
CDataStream ssKey(SER_DISK);
@@ -115,7 +118,7 @@ protected:
if (!pdb)
return false;
if (fReadOnly)
- assert(("Erase called on database in read-only mode", false));
+ assert(!"Erase called on database in read-only mode");
// Key
CDataStream ssKey(SER_DISK);
@@ -247,12 +250,12 @@ public:
bool ReadVersion(int& nVersion)
{
nVersion = 0;
- return Read(string("version"), nVersion);
+ return Read(std::string("version"), nVersion);
}
bool WriteVersion(int nVersion)
{
- return Write(string("version"), nVersion);
+ return Write(std::string("version"), nVersion);
}
};
@@ -276,7 +279,7 @@ public:
bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight);
bool EraseTxIndex(const CTransaction& tx);
bool ContainsTx(uint256 hash);
- bool ReadOwnerTxes(uint160 hash160, int nHeight, vector<CTransaction>& vtx);
+ bool ReadOwnerTxes(uint160 hash160, int nHeight, std::vector<CTransaction>& vtx);
bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex);
bool ReadDiskTx(uint256 hash, CTransaction& tx);
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex);
@@ -311,21 +314,18 @@ bool LoadAddresses();
-
-
-
class CKeyPool
{
public:
int64 nTime;
- vector<unsigned char> vchPubKey;
+ std::vector<unsigned char> vchPubKey;
CKeyPool()
{
nTime = GetTime();
}
- CKeyPool(const vector<unsigned char>& vchPubKeyIn)
+ CKeyPool(const std::vector<unsigned char>& vchPubKeyIn)
{
nTime = GetTime();
vchPubKey = vchPubKeyIn;
@@ -343,172 +343,142 @@ public:
+enum DBErrors
+{
+ DB_LOAD_OK,
+ DB_CORRUPT,
+ DB_TOO_NEW,
+ DB_LOAD_FAIL,
+};
+
class CWalletDB : public CDB
{
public:
- CWalletDB(const char* pszMode="r+") : CDB("wallet.dat", pszMode)
+ CWalletDB(std::string strFilename, const char* pszMode="r+") : CDB(strFilename.c_str(), pszMode)
{
}
private:
CWalletDB(const CWalletDB&);
void operator=(const CWalletDB&);
public:
- bool ReadName(const string& strAddress, string& strName)
+ bool ReadName(const std::string& strAddress, std::string& strName)
{
strName = "";
- return Read(make_pair(string("name"), strAddress), strName);
+ return Read(std::make_pair(std::string("name"), strAddress), strName);
}
- bool WriteName(const string& strAddress, const string& strName)
- {
- CRITICAL_BLOCK(cs_mapAddressBook)
- mapAddressBook[strAddress] = strName;
- nWalletDBUpdated++;
- return Write(make_pair(string("name"), strAddress), strName);
- }
+ bool WriteName(const std::string& strAddress, const std::string& strName);
- bool EraseName(const string& strAddress)
- {
- // This should only be used for sending addresses, never for receiving addresses,
- // receiving addresses must always have an address book entry if they're not change return.
- CRITICAL_BLOCK(cs_mapAddressBook)
- mapAddressBook.erase(strAddress);
- nWalletDBUpdated++;
- return Erase(make_pair(string("name"), strAddress));
- }
+ bool EraseName(const std::string& strAddress);
bool ReadTx(uint256 hash, CWalletTx& wtx)
{
- return Read(make_pair(string("tx"), hash), wtx);
+ return Read(std::make_pair(std::string("tx"), hash), wtx);
}
bool WriteTx(uint256 hash, const CWalletTx& wtx)
{
nWalletDBUpdated++;
- return Write(make_pair(string("tx"), hash), wtx);
+ return Write(std::make_pair(std::string("tx"), hash), wtx);
}
bool EraseTx(uint256 hash)
{
nWalletDBUpdated++;
- return Erase(make_pair(string("tx"), hash));
+ return Erase(std::make_pair(std::string("tx"), hash));
}
- bool ReadKey(const vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
+ bool ReadKey(const std::vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
{
vchPrivKey.clear();
- return Read(make_pair(string("key"), vchPubKey), vchPrivKey);
+ return Read(std::make_pair(std::string("key"), vchPubKey), vchPrivKey);
}
- bool WriteKey(const vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
+ bool WriteKey(const std::vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
{
nWalletDBUpdated++;
- return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
+ return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false);
}
- bool WriteBestBlock(const CBlockLocator& locator)
+ bool WriteCryptedKey(const std::vector<unsigned char>& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, bool fEraseUnencryptedKey = true)
{
nWalletDBUpdated++;
- return Write(string("bestblock"), locator);
+ if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false))
+ return false;
+ if (fEraseUnencryptedKey)
+ {
+ Erase(std::make_pair(std::string("key"), vchPubKey));
+ Erase(std::make_pair(std::string("wkey"), vchPubKey));
+ }
+ return true;
}
- bool ReadBestBlock(CBlockLocator& locator)
+ bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
{
- return Read(string("bestblock"), locator);
+ nWalletDBUpdated++;
+ return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
}
- bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
+ bool WriteBestBlock(const CBlockLocator& locator)
{
- vchPubKey.clear();
- return Read(string("defaultkey"), vchPubKey);
+ nWalletDBUpdated++;
+ return Write(std::string("bestblock"), locator);
}
- bool WriteDefaultKey(const vector<unsigned char>& vchPubKey)
+ bool ReadBestBlock(CBlockLocator& locator)
{
- vchDefaultKey = vchPubKey;
- nWalletDBUpdated++;
- return Write(string("defaultkey"), vchPubKey);
+ return Read(std::string("bestblock"), locator);
}
- template<typename T>
- bool ReadSetting(const string& strKey, T& value)
+ bool ReadDefaultKey(std::vector<unsigned char>& vchPubKey)
{
- return Read(make_pair(string("setting"), strKey), value);
+ vchPubKey.clear();
+ return Read(std::string("defaultkey"), vchPubKey);
}
- template<typename T>
- bool WriteSetting(const string& strKey, const T& value)
+ bool WriteDefaultKey(const std::vector<unsigned char>& vchPubKey)
{
nWalletDBUpdated++;
- return Write(make_pair(string("setting"), strKey), value);
+ return Write(std::string("defaultkey"), vchPubKey);
}
- bool ReadAccount(const string& strAccount, CAccount& account);
- bool WriteAccount(const string& strAccount, const CAccount& account);
- bool WriteAccountingEntry(const CAccountingEntry& acentry);
- int64 GetAccountCreditDebit(const string& strAccount);
- void ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& acentries);
-
- bool LoadWallet();
-protected:
- void ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool);
- void KeepKey(int64 nIndex);
- static void ReturnKey(int64 nIndex);
- friend class CReserveKey;
- friend vector<unsigned char> GetKeyFromKeyPool();
- friend int64 GetOldestKeyPoolTime();
-};
-
-bool LoadWallet(bool& fFirstRunRet);
-void BackupWallet(const string& strDest);
-
-inline bool SetAddressBookName(const string& strAddress, const string& strName)
-{
- return CWalletDB().WriteName(strAddress, strName);
-}
-
-class CReserveKey
-{
-protected:
- int64 nIndex;
- vector<unsigned char> vchPubKey;
-public:
- CReserveKey()
+ bool ReadPool(int64 nPool, CKeyPool& keypool)
{
- nIndex = -1;
+ return Read(std::make_pair(std::string("pool"), nPool), keypool);
}
- ~CReserveKey()
+ bool WritePool(int64 nPool, const CKeyPool& keypool)
{
- if (!fShutdown)
- ReturnKey();
+ nWalletDBUpdated++;
+ return Write(std::make_pair(std::string("pool"), nPool), keypool);
}
- vector<unsigned char> GetReservedKey()
+ bool ErasePool(int64 nPool)
{
- if (nIndex == -1)
- {
- CKeyPool keypool;
- CWalletDB().ReserveKeyFromKeyPool(nIndex, keypool);
- vchPubKey = keypool.vchPubKey;
- }
- assert(!vchPubKey.empty());
- return vchPubKey;
+ nWalletDBUpdated++;
+ return Erase(std::make_pair(std::string("pool"), nPool));
}
- void KeepKey()
+ template<typename T>
+ bool ReadSetting(const std::string& strKey, T& value)
{
- if (nIndex != -1)
- CWalletDB().KeepKey(nIndex);
- nIndex = -1;
- vchPubKey.clear();
+ return Read(std::make_pair(std::string("setting"), strKey), value);
}
- void ReturnKey()
+ template<typename T>
+ bool WriteSetting(const std::string& strKey, const T& value)
{
- if (nIndex != -1)
- CWalletDB::ReturnKey(nIndex);
- nIndex = -1;
- vchPubKey.clear();
+ nWalletDBUpdated++;
+ return Write(std::make_pair(std::string("setting"), strKey), value);
}
+
+ bool ReadAccount(const std::string& strAccount, CAccount& account);
+ bool WriteAccount(const std::string& strAccount, const CAccount& account);
+ bool WriteAccountingEntry(const CAccountingEntry& acentry);
+ int64 GetAccountCreditDebit(const std::string& strAccount);
+ void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
+
+ int LoadWallet(CWallet* pwallet);
};
+
+#endif
diff --git a/headers.h b/src/headers.h
index 6a08cb7fe8..d0c7434820 100644
--- a/headers.h
+++ b/src/headers.h
@@ -1,4 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -48,7 +49,6 @@
#include <limits.h>
#include <float.h>
#include <assert.h>
-#include <memory>
#include <iostream>
#include <sstream>
#include <string>
@@ -56,29 +56,8 @@
#include <list>
#include <deque>
#include <map>
-#include <set>
-#include <algorithm>
-#include <numeric>
+
#include <boost/foreach.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
-#include <boost/tuple/tuple_io.hpp>
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/thread.hpp>
-#include <boost/interprocess/sync/file_lock.hpp>
-#include <boost/interprocess/sync/interprocess_mutex.hpp>
-#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
-#include <boost/date_time/gregorian/gregorian_types.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/config.hpp>
-#include <boost/program_options/detail/config_file.hpp>
-#include <boost/program_options/parsers.hpp>
#ifdef __WXMSW__
#include <windows.h>
@@ -109,30 +88,21 @@
#pragma hdrstop
-using namespace std;
-using namespace boost;
-#include "strlcpy.h"
#include "serialize.h"
#include "uint256.h"
#include "util.h"
-#include "key.h"
#include "bignum.h"
#include "base58.h"
-#include "script.h"
-#include "db.h"
-#include "net.h"
-#include "irc.h"
#include "main.h"
-#include "rpc.h"
#ifdef GUI
#include "uibase.h"
#include "ui.h"
#else
#include "noui.h"
#endif
-#include "init.h"
+#ifdef GUI
#include "xpm/addressbook16.xpm"
#include "xpm/addressbook20.xpm"
#include "xpm/bitcoin16.xpm"
@@ -145,3 +115,4 @@ using namespace boost;
#include "xpm/send16noshadow.xpm"
#include "xpm/send20.xpm"
#include "xpm/about.xpm"
+#endif
diff --git a/init.cpp b/src/init.cpp
index 8f72181225..dbc2c41332 100644
--- a/init.cpp
+++ b/src/init.cpp
@@ -1,14 +1,21 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
#include "headers.h"
+#include "db.h"
+#include "rpc.h"
+#include "net.h"
+#include "init.h"
+#include "strlcpy.h"
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/interprocess/sync/file_lock.hpp>
+using namespace std;
+using namespace boost;
-
-
-
-
+CWallet* pwalletMain;
//////////////////////////////////////////////////////////////////////////////
//
@@ -42,6 +49,8 @@ void Shutdown(void* parg)
StopNode();
DBFlush(true);
boost::filesystem::remove(GetPidFile());
+ UnregisterWallet(pwalletMain);
+ delete pwalletMain;
CreateThread(ExitTimeout, NULL);
Sleep(50);
printf("Bitcoin exiting\n\n");
@@ -71,7 +80,6 @@ void HandleSIGTERM(int)
//
// Start
//
-
#ifndef GUI
int main(int argc, char* argv[])
{
@@ -134,15 +142,23 @@ bool AppInit2(int argc, char* argv[])
if (mapArgs.count("-datadir"))
{
- filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
- strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
+ if (filesystem::is_directory(filesystem::system_complete(mapArgs["-datadir"])))
+ {
+ filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
+ strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
+ }
+ else
+ {
+ fprintf(stderr, "Error: Specified directory does not exist\n");
+ Shutdown(NULL);
+ }
}
+
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
if (mapArgs.count("-?") || mapArgs.count("--help"))
{
- string beta = VERSION_IS_BETA ? _(" beta") : "";
string strUsage = string() +
_("Bitcoin version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
@@ -157,7 +173,9 @@ bool AppInit2(int argc, char* argv[])
" -gen=0 \t\t " + _("Don't generate coins\n") +
" -min \t\t " + _("Start minimized\n") +
" -datadir=<dir> \t\t " + _("Specify data directory\n") +
+ " -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)\n") +
" -proxy=<ip:port> \t " + _("Connect through socks4 proxy\n") +
+ " -dns \t " + _("Allow DNS lookups for addnode and connect\n") +
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
" -connect=<ip> \t\t " + _("Connect only to the specified node\n") +
" -nolisten \t " + _("Don't accept connections from outside\n") +
@@ -208,6 +226,7 @@ bool AppInit2(int argc, char* argv[])
}
fDebug = GetBoolArg("-debug");
+ fAllowDNS = GetBoolArg("-dns");
#ifndef __WXMSW__
fDaemon = GetBoolArg("-daemon");
@@ -229,7 +248,8 @@ bool AppInit2(int argc, char* argv[])
fPrintToDebugger = GetBoolArg("-printtodebugger");
fTestNet = GetBoolArg("-testnet");
- fNoListen = GetBoolArg("-nolisten");
+ bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
+ fNoListen = GetBoolArg("-nolisten") || fTOR;
fLogTimestamps = GetBoolArg("-logtimestamps");
for (int i = 1; i < argc; i++)
@@ -326,7 +346,7 @@ bool AppInit2(int argc, char* argv[])
// Make sure only a single bitcoin process is using the data directory.
string strLockFile = GetDataDir() + "/.lock";
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
- fclose(file);
+ if (file) fclose(file);
static boost::interprocess::file_lock lock(strLockFile.c_str());
if (!lock.try_lock())
{
@@ -368,16 +388,27 @@ bool AppInit2(int argc, char* argv[])
printf("Loading wallet...\n");
nStart = GetTimeMillis();
bool fFirstRun;
- if (!LoadWallet(fFirstRun))
- strErrors += _("Error loading wallet.dat \n");
+ pwalletMain = new CWallet("wallet.dat");
+ int nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);
+ if (nLoadWalletRet != DB_LOAD_OK)
+ {
+ if (nLoadWalletRet == DB_CORRUPT)
+ strErrors += _("Error loading wallet.dat: Wallet corrupted \n");
+ else if (nLoadWalletRet == DB_TOO_NEW)
+ strErrors += _("Error loading wallet.dat: Wallet requires newer version of Bitcoin \n");
+ else
+ strErrors += _("Error loading wallet.dat \n");
+ }
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ RegisterWallet(pwalletMain);
+
CBlockIndex *pindexRescan = pindexBest;
if (GetBoolArg("-rescan"))
pindexRescan = pindexGenesisBlock;
else
{
- CWalletDB walletdb;
+ CWalletDB walletdb("wallet.dat");
CBlockLocator locator;
if (walletdb.ReadBestBlock(locator))
pindexRescan = locator.GetBlockIndex();
@@ -386,7 +417,7 @@ bool AppInit2(int argc, char* argv[])
{
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
- ScanForWalletTransactions(pindexRescan);
+ pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
}
@@ -395,10 +426,9 @@ bool AppInit2(int argc, char* argv[])
//// debug print
printf("mapBlockIndex.size() = %d\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
- printf("mapKeys.size() = %d\n", mapKeys.size());
- printf("mapPubKeys.size() = %d\n", mapPubKeys.size());
- printf("mapWallet.size() = %d\n", mapWallet.size());
- printf("mapAddressBook.size() = %d\n", mapAddressBook.size());
+ printf("setKeyPool.size() = %d\n", pwalletMain->setKeyPool.size());
+ printf("mapWallet.size() = %d\n", pwalletMain->mapWallet.size());
+ printf("mapAddressBook.size() = %d\n", pwalletMain->mapAddressBook.size());
if (!strErrors.empty())
{
@@ -407,7 +437,7 @@ bool AppInit2(int argc, char* argv[])
}
// Add wallet transactions that aren't already in a block to mapTransactions
- ReacceptWalletTransactions();
+ pwalletMain->ReacceptWalletTransactions();
//
// Parameters
@@ -418,6 +448,13 @@ bool AppInit2(int argc, char* argv[])
return false;
}
+ if (mapArgs.count("-timeout"))
+ {
+ int nNewTimeout = GetArg("-timeout", 5000);
+ if (nNewTimeout > 0 && nNewTimeout < 600000)
+ nConnectTimeout = nNewTimeout;
+ }
+
if (mapArgs.count("-printblock"))
{
string strMatch = mapArgs["-printblock"];
@@ -456,16 +493,18 @@ bool AppInit2(int argc, char* argv[])
if (mapArgs.count("-addnode"))
{
- foreach(string strAddr, mapMultiArgs["-addnode"])
+ BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
{
- CAddress addr(strAddr, NODE_NETWORK);
+ CAddress addr(strAddr, fAllowDNS);
addr.nTime = 0; // so it won't relay unless successfully connected
if (addr.IsValid())
AddAddress(addr);
}
}
- if (mapArgs.count("-dnsseed"))
+ if (GetBoolArg("-nodnsseed"))
+ printf("DNS seeding disabled\n");
+ else
DNSAddressSeed();
if (mapArgs.count("-paytxfee"))
diff --git a/init.h b/src/init.h
index 265ddb8853..4017f25707 100644
--- a/init.h
+++ b/src/init.h
@@ -1,7 +1,14 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_INIT_H
+#define BITCOIN_INIT_H
+
+extern CWallet* pwalletMain;
void Shutdown(void* parg);
bool AppInit(int argc, char* argv[]);
bool AppInit2(int argc, char* argv[]);
+
+#endif
diff --git a/irc.cpp b/src/irc.cpp
index 5adaf11658..5278488dcd 100644
--- a/irc.cpp
+++ b/src/irc.cpp
@@ -1,8 +1,15 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "irc.h"
+#include "net.h"
+#include "strlcpy.h"
+
+using namespace std;
+using namespace boost;
int nGotIRCAddresses = 0;
bool fGotExternalIP = false;
@@ -41,7 +48,7 @@ bool DecodeAddress(string str, CAddress& addr)
return false;
memcpy(&tmp, &vch[0], sizeof(tmp));
- addr = CAddress(tmp.ip, tmp.port, NODE_NETWORK);
+ addr = CAddress(tmp.ip, ntohs(tmp.port), NODE_NETWORK);
return true;
}
@@ -215,25 +222,15 @@ bool GetIPFromIRC(SOCKET hSocket, string strMyName, unsigned int& ipRet)
return false;
string strHost = str.substr(str.rfind("@")+1);
- unsigned int a=0, b=0, c=0, d=0;
- if (sscanf(strHost.c_str(), "%u.%u.%u.%u", &a, &b, &c, &d) == 4 &&
- inet_addr(strHost.c_str()) != INADDR_NONE)
- {
- printf("GetIPFromIRC() userhost is IP %s\n", strHost.c_str());
- ipRet = CAddress(strHost).ip;
- }
- else
- {
- // Hybrid IRC used by lfnet always returns IP when you userhost yourself,
- // but in case another IRC is ever used this should work.
- printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
- if (fUseProxy)
- return false;
- struct hostent* phostent = gethostbyname(strHost.c_str());
- if (!phostent || !phostent->h_addr_list || !phostent->h_addr_list[0])
- return false;
- ipRet = *(u_long*)phostent->h_addr_list[0];
- }
+ // Hybrid IRC used by lfnet always returns IP when you userhost yourself,
+ // but in case another IRC is ever used this should work.
+ printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
+ if (fUseProxy)
+ return false;
+ CAddress addr(strHost, 0, true);
+ if (!addr.IsValid())
+ return false;
+ ipRet = addr.ip;
return true;
}
@@ -272,13 +269,13 @@ void ThreadIRCSeed2(void* parg)
while (!fShutdown)
{
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
- CAddress addrConnect("92.243.23.21:6667"); // irc.lfnet.org
+ CAddress addrConnect("92.243.23.21", 6667); // irc.lfnet.org
if (!fTOR)
{
//struct hostent* phostent = gethostbyname("chat.freenode.net");
- struct hostent* phostent = gethostbyname("irc.lfnet.org");
- if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
- addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(6667));
+ CAddress addrIRC("irc.lfnet.org", 6667, true);
+ if (addrIRC.IsValid())
+ addrConnect = addrIRC;
}
SOCKET hSocket;
@@ -346,9 +343,16 @@ void ThreadIRCSeed2(void* parg)
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
}
}
-
- Send(hSocket, fTestNet ? "JOIN #bitcoinTEST\r" : "JOIN #bitcoin\r");
- Send(hSocket, fTestNet ? "WHO #bitcoinTEST\r" : "WHO #bitcoin\r");
+
+ if (fTestNet) {
+ Send(hSocket, "JOIN #bitcoinTEST\r");
+ Send(hSocket, "WHO #bitcoinTEST\r");
+ } else {
+ // randomly join #bitcoin00-#bitcoin99
+ int channel_number = GetRandInt(100);
+ Send(hSocket, strprintf("JOIN #bitcoin%02d\r", channel_number).c_str());
+ Send(hSocket, strprintf("WHO #bitcoin%02d\r", channel_number).c_str());
+ }
int64 nStart = GetTime();
string strLine;
@@ -390,7 +394,7 @@ void ThreadIRCSeed2(void* parg)
{
addr.nTime = GetAdjustedTime();
if (AddAddress(addr, 51 * 60))
- printf("IRC got new address\n");
+ printf("IRC got new address: %s\n", addr.ToString().c_str());
nGotIRCAddresses++;
}
else
diff --git a/irc.h b/src/irc.h
index 4bc812902f..6945b2cecb 100644
--- a/irc.h
+++ b/src/irc.h
@@ -1,9 +1,14 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_IRC_H
+#define BITCOIN_IRC_H
-bool RecvLine(SOCKET hSocket, string& strLine);
+bool RecvLine(SOCKET hSocket, std::string& strLine);
void ThreadIRCSeed(void* parg);
extern int nGotIRCAddresses;
extern bool fGotExternalIP;
+
+#endif
diff --git a/json/LICENSE.txt b/src/json/LICENSE.txt
index 797d5363b3..797d5363b3 100644
--- a/json/LICENSE.txt
+++ b/src/json/LICENSE.txt
diff --git a/json/json_spirit.h b/src/json/json_spirit.h
index ac1879d5b3..ac1879d5b3 100644
--- a/json/json_spirit.h
+++ b/src/json/json_spirit.h
diff --git a/json/json_spirit_error_position.h b/src/json/json_spirit_error_position.h
index 17208507df..17208507df 100644
--- a/json/json_spirit_error_position.h
+++ b/src/json/json_spirit_error_position.h
diff --git a/json/json_spirit_reader.cpp b/src/json/json_spirit_reader.cpp
index aa4f637226..aa4f637226 100644
--- a/json/json_spirit_reader.cpp
+++ b/src/json/json_spirit_reader.cpp
diff --git a/json/json_spirit_reader.h b/src/json/json_spirit_reader.h
index 96494a9789..96494a9789 100644
--- a/json/json_spirit_reader.h
+++ b/src/json/json_spirit_reader.h
diff --git a/json/json_spirit_reader_template.h b/src/json/json_spirit_reader_template.h
index 4dec00e6c9..4dec00e6c9 100644
--- a/json/json_spirit_reader_template.h
+++ b/src/json/json_spirit_reader_template.h
diff --git a/json/json_spirit_stream_reader.h b/src/json/json_spirit_stream_reader.h
index 7e59c9adc2..7e59c9adc2 100644
--- a/json/json_spirit_stream_reader.h
+++ b/src/json/json_spirit_stream_reader.h
diff --git a/json/json_spirit_utils.h b/src/json/json_spirit_utils.h
index 553e3b96a4..553e3b96a4 100644
--- a/json/json_spirit_utils.h
+++ b/src/json/json_spirit_utils.h
diff --git a/json/json_spirit_value.cpp b/src/json/json_spirit_value.cpp
index 44d2f06a01..44d2f06a01 100644
--- a/json/json_spirit_value.cpp
+++ b/src/json/json_spirit_value.cpp
diff --git a/json/json_spirit_value.h b/src/json/json_spirit_value.h
index 7e83a2a7e3..7e83a2a7e3 100644
--- a/json/json_spirit_value.h
+++ b/src/json/json_spirit_value.h
diff --git a/json/json_spirit_writer.cpp b/src/json/json_spirit_writer.cpp
index d24a632cf3..d24a632cf3 100644
--- a/json/json_spirit_writer.cpp
+++ b/src/json/json_spirit_writer.cpp
diff --git a/json/json_spirit_writer.h b/src/json/json_spirit_writer.h
index 52e14068e7..52e14068e7 100644
--- a/json/json_spirit_writer.h
+++ b/src/json/json_spirit_writer.h
diff --git a/json/json_spirit_writer_template.h b/src/json/json_spirit_writer_template.h
index 28c49ddc64..28c49ddc64 100644
--- a/json/json_spirit_writer_template.h
+++ b/src/json/json_spirit_writer_template.h
diff --git a/key.h b/src/key.h
index 06f88cc907..d2e6689456 100644
--- a/key.h
+++ b/src/key.h
@@ -1,7 +1,20 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_KEY_H
+#define BITCOIN_KEY_H
+#include <stdexcept>
+#include <vector>
+
+#include <openssl/ec.h>
+#include <openssl/ecdsa.h>
+#include <openssl/obj_mac.h>
+
+#include "serialize.h"
+#include "uint256.h"
+#include "base58.h"
// secp160k1
// const unsigned int PRIVATE_KEY_SIZE = 192;
@@ -26,6 +39,41 @@
// see www.keylength.com
// script supports up to 75 for single byte push
+int static inline EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)
+{
+ int ok = 0;
+ BN_CTX *ctx = NULL;
+ EC_POINT *pub_key = NULL;
+
+ if (!eckey) return 0;
+
+ const EC_GROUP *group = EC_KEY_get0_group(eckey);
+
+ if ((ctx = BN_CTX_new()) == NULL)
+ goto err;
+
+ pub_key = EC_POINT_new(group);
+
+ if (pub_key == NULL)
+ goto err;
+
+ if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx))
+ goto err;
+
+ EC_KEY_set_private_key(eckey,priv_key);
+ EC_KEY_set_public_key(eckey,pub_key);
+
+ ok = 1;
+
+err:
+
+ if (pub_key)
+ EC_POINT_free(pub_key);
+ if (ctx != NULL)
+ BN_CTX_free(ctx);
+
+ return(ok);
+}
class key_error : public std::runtime_error
@@ -36,9 +84,8 @@ public:
// secure_allocator is defined in serialize.h
-typedef vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
-
-
+typedef std::vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
+typedef std::vector<unsigned char, secure_allocator<unsigned char> > CSecret;
class CKey
{
@@ -97,6 +144,38 @@ public:
return true;
}
+ bool SetSecret(const CSecret& vchSecret)
+ {
+ EC_KEY_free(pkey);
+ pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
+ if (pkey == NULL)
+ throw key_error("CKey::SetSecret() : EC_KEY_new_by_curve_name failed");
+ if (vchSecret.size() != 32)
+ throw key_error("CKey::SetSecret() : secret must be 32 bytes");
+ BIGNUM *bn = BN_bin2bn(&vchSecret[0],32,BN_new());
+ if (bn == NULL)
+ throw key_error("CKey::SetSecret() : BN_bin2bn failed");
+ if (!EC_KEY_regenerate_key(pkey,bn))
+ throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed");
+ BN_clear_free(bn);
+ fSet = true;
+ return true;
+ }
+
+ CSecret GetSecret() const
+ {
+ CSecret vchRet;
+ vchRet.resize(32);
+ const BIGNUM *bn = EC_KEY_get0_private_key(pkey);
+ int nBytes = BN_num_bytes(bn);
+ if (bn == NULL)
+ throw key_error("CKey::GetSecret() : EC_KEY_get0_private_key failed");
+ int n=BN_bn2bin(bn,&vchRet[32 - nBytes]);
+ if (n != nBytes)
+ throw key_error("CKey::GetSecret(): BN_bn2bin failed");
+ return vchRet;
+ }
+
CPrivKey GetPrivKey() const
{
unsigned int nSize = i2d_ECPrivateKey(pkey, NULL);
@@ -109,7 +188,7 @@ public:
return vchPrivKey;
}
- bool SetPubKey(const vector<unsigned char>& vchPubKey)
+ bool SetPubKey(const std::vector<unsigned char>& vchPubKey)
{
const unsigned char* pbegin = &vchPubKey[0];
if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.size()))
@@ -118,19 +197,19 @@ public:
return true;
}
- vector<unsigned char> GetPubKey() const
+ std::vector<unsigned char> GetPubKey() const
{
unsigned int nSize = i2o_ECPublicKey(pkey, NULL);
if (!nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed");
- vector<unsigned char> vchPubKey(nSize, 0);
+ std::vector<unsigned char> vchPubKey(nSize, 0);
unsigned char* pbegin = &vchPubKey[0];
if (i2o_ECPublicKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size");
return vchPubKey;
}
- bool Sign(uint256 hash, vector<unsigned char>& vchSig)
+ bool Sign(uint256 hash, std::vector<unsigned char>& vchSig)
{
vchSig.clear();
unsigned char pchSig[10000];
@@ -142,7 +221,7 @@ public:
return true;
}
- bool Verify(uint256 hash, const vector<unsigned char>& vchSig)
+ bool Verify(uint256 hash, const std::vector<unsigned char>& vchSig)
{
// -1 = error, 0 = bad sig, 1 = good
if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
@@ -150,19 +229,10 @@ public:
return true;
}
- static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, vector<unsigned char>& vchSig)
- {
- CKey key;
- if (!key.SetPrivKey(vchPrivKey))
- return false;
- return key.Sign(hash, vchSig);
- }
-
- static bool Verify(const vector<unsigned char>& vchPubKey, uint256 hash, const vector<unsigned char>& vchSig)
+ CBitcoinAddress GetAddress() const
{
- CKey key;
- if (!key.SetPubKey(vchPubKey))
- return false;
- return key.Verify(hash, vchSig);
+ return CBitcoinAddress(GetPubKey());
}
};
+
+#endif
diff --git a/src/keystore.cpp b/src/keystore.cpp
new file mode 100644
index 0000000000..4c6848b47a
--- /dev/null
+++ b/src/keystore.cpp
@@ -0,0 +1,170 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+
+#include "headers.h"
+#include "db.h"
+#include "crypter.h"
+
+std::vector<unsigned char> CKeyStore::GenerateNewKey()
+{
+ RandAddSeedPerfmon();
+ CKey key;
+ key.MakeNewKey();
+ if (!AddKey(key))
+ throw std::runtime_error("CKeyStore::GenerateNewKey() : AddKey failed");
+ return key.GetPubKey();
+}
+
+bool CKeyStore::GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char> &vchPubKeyOut) const
+{
+ CKey key;
+ if (!GetKey(address, key))
+ return false;
+ vchPubKeyOut = key.GetPubKey();
+ return true;
+}
+
+bool CBasicKeyStore::AddKey(const CKey& key)
+{
+ CRITICAL_BLOCK(cs_KeyStore)
+ mapKeys[key.GetAddress()] = key.GetSecret();
+ return true;
+}
+
+std::vector<unsigned char> CCryptoKeyStore::GenerateNewKey()
+{
+ RandAddSeedPerfmon();
+ CKey key;
+ key.MakeNewKey();
+ if (!AddKey(key))
+ throw std::runtime_error("CCryptoKeyStore::GenerateNewKey() : AddKey failed");
+ return key.GetPubKey();
+}
+
+bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
+{
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!SetCrypted())
+ return false;
+
+ CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin();
+ for (; mi != mapCryptedKeys.end(); ++mi)
+ {
+ const std::vector<unsigned char> &vchPubKey = (*mi).second.first;
+ const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;
+ CSecret vchSecret;
+ if(!DecryptSecret(vMasterKeyIn, vchCryptedSecret, Hash(vchPubKey.begin(), vchPubKey.end()), vchSecret))
+ return false;
+ CKey key;
+ key.SetSecret(vchSecret);
+ if (key.GetPubKey() == vchPubKey)
+ break;
+ return false;
+ }
+ vMasterKey = vMasterKeyIn;
+ }
+ return true;
+}
+
+bool CCryptoKeyStore::AddKey(const CKey& key)
+{
+ CRITICAL_BLOCK(cs_KeyStore)
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!IsCrypted())
+ return CBasicKeyStore::AddKey(key);
+
+ if (IsLocked())
+ return false;
+
+ std::vector<unsigned char> vchCryptedSecret;
+ std::vector<unsigned char> vchPubKey = key.GetPubKey();
+ if (!EncryptSecret(vMasterKey, key.GetSecret(), Hash(vchPubKey.begin(), vchPubKey.end()), vchCryptedSecret))
+ return false;
+
+ if (!AddCryptedKey(key.GetPubKey(), vchCryptedSecret))
+ return false;
+ }
+ return true;
+}
+
+
+bool CCryptoKeyStore::AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret)
+{
+ CRITICAL_BLOCK(cs_KeyStore)
+ {
+ if (!SetCrypted())
+ return false;
+
+ mapCryptedKeys[CBitcoinAddress(vchPubKey)] = make_pair(vchPubKey, vchCryptedSecret);
+ }
+ return true;
+}
+
+bool CCryptoKeyStore::GetKey(const CBitcoinAddress &address, CKey& keyOut) const
+{
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!IsCrypted())
+ return CBasicKeyStore::GetKey(address, keyOut);
+
+ CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address);
+ if (mi != mapCryptedKeys.end())
+ {
+ const std::vector<unsigned char> &vchPubKey = (*mi).second.first;
+ const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;
+ CSecret vchSecret;
+ if (!DecryptSecret(vMasterKey, vchCryptedSecret, Hash(vchPubKey.begin(), vchPubKey.end()), vchSecret))
+ return false;
+ keyOut.SetSecret(vchSecret);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CCryptoKeyStore::GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char>& vchPubKeyOut) const
+{
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!IsCrypted())
+ return CKeyStore::GetPubKey(address, vchPubKeyOut);
+
+ CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address);
+ if (mi != mapCryptedKeys.end())
+ {
+ vchPubKeyOut = (*mi).second.first;
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)
+{
+ CRITICAL_BLOCK(cs_KeyStore)
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!mapCryptedKeys.empty() || IsCrypted())
+ return false;
+
+ fUseCrypto = true;
+ CKey key;
+ BOOST_FOREACH(KeyMap::value_type& mKey, mapKeys)
+ {
+ if (!key.SetSecret(mKey.second))
+ return false;
+ const std::vector<unsigned char> vchPubKey = key.GetPubKey();
+ std::vector<unsigned char> vchCryptedSecret;
+ if (!EncryptSecret(vMasterKeyIn, key.GetSecret(), Hash(vchPubKey.begin(), vchPubKey.end()), vchCryptedSecret))
+ return false;
+ if (!AddCryptedKey(vchPubKey, vchCryptedSecret))
+ return false;
+ }
+ mapKeys.clear();
+ }
+ return true;
+}
diff --git a/src/keystore.h b/src/keystore.h
new file mode 100644
index 0000000000..0324cc6e1b
--- /dev/null
+++ b/src/keystore.h
@@ -0,0 +1,120 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_KEYSTORE_H
+#define BITCOIN_KEYSTORE_H
+
+#include "crypter.h"
+
+class CKeyStore
+{
+public:
+ mutable CCriticalSection cs_KeyStore;
+
+ virtual bool AddKey(const CKey& key) =0;
+ virtual bool HaveKey(const CBitcoinAddress &address) const =0;
+ virtual bool GetKey(const CBitcoinAddress &address, CKey& keyOut) const =0;
+ virtual bool GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char>& vchPubKeyOut) const;
+ virtual std::vector<unsigned char> GenerateNewKey();
+};
+
+typedef std::map<CBitcoinAddress, CSecret> KeyMap;
+
+class CBasicKeyStore : public CKeyStore
+{
+protected:
+ KeyMap mapKeys;
+
+public:
+ bool AddKey(const CKey& key);
+ bool HaveKey(const CBitcoinAddress &address) const
+ {
+ return (mapKeys.count(address) > 0);
+ }
+ bool GetKey(const CBitcoinAddress &address, CKey& keyOut) const
+ {
+ KeyMap::const_iterator mi = mapKeys.find(address);
+ if (mi != mapKeys.end())
+ {
+ keyOut.SetSecret((*mi).second);
+ return true;
+ }
+ return false;
+ }
+};
+
+typedef std::map<CBitcoinAddress, std::pair<std::vector<unsigned char>, std::vector<unsigned char> > > CryptedKeyMap;
+
+class CCryptoKeyStore : public CBasicKeyStore
+{
+private:
+ CryptedKeyMap mapCryptedKeys;
+
+ CKeyingMaterial vMasterKey;
+
+ // if fUseCrypto is true, mapKeys must be empty
+ // if fUseCrypto is false, vMasterKey must be empty
+ bool fUseCrypto;
+
+protected:
+ bool SetCrypted()
+ {
+ if (fUseCrypto)
+ return true;
+ if (!mapKeys.empty())
+ return false;
+ fUseCrypto = true;
+ return true;
+ }
+
+ // will encrypt previously unencrypted keys
+ bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
+
+ bool Unlock(const CKeyingMaterial& vMasterKeyIn);
+
+public:
+ mutable CCriticalSection cs_vMasterKey; //No guarantees master key wont get locked before you can use it, so lock this first
+
+ CCryptoKeyStore() : fUseCrypto(false)
+ {
+ }
+
+ bool IsCrypted() const
+ {
+ return fUseCrypto;
+ }
+
+ bool IsLocked() const
+ {
+ if (!IsCrypted())
+ return false;
+ return vMasterKey.empty();
+ }
+
+ bool Lock()
+ {
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!SetCrypted())
+ return false;
+
+ vMasterKey.clear();
+ }
+ return true;
+ }
+
+ virtual bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
+ std::vector<unsigned char> GenerateNewKey();
+ bool AddKey(const CKey& key);
+ bool HaveKey(const CBitcoinAddress &address) const
+ {
+ if (!IsCrypted())
+ return CBasicKeyStore::HaveKey(address);
+ return mapCryptedKeys.count(address) > 0;
+ }
+ bool GetKey(const CBitcoinAddress &address, CKey& keyOut) const;
+ bool GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char>& vchPubKeyOut) const;
+};
+
+#endif
diff --git a/main.cpp b/src/main.cpp
index d71d411644..480d2d8bbf 100644
--- a/main.cpp
+++ b/src/main.cpp
@@ -1,18 +1,25 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
#include "headers.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
#include "cryptopp/sha.h"
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
-
-
-
+using namespace std;
+using namespace boost;
//
// Global state
//
+CCriticalSection cs_setpwalletRegistered;
+set<CWallet*> setpwalletRegistered;
+
CCriticalSection cs_main;
map<uint256, CTransaction> mapTransactions;
@@ -23,6 +30,8 @@ map<COutPoint, CInPoint> mapNextTx;
map<uint256, CBlockIndex*> mapBlockIndex;
uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
+const int nTotalBlocksEstimate = 134444; // Conservative estimate of total nr of blocks on main chain
+const int nInitialBlockThreshold = 120; // Regard blocks up until N-threshold as "initial download"
CBlockIndex* pindexGenesisBlock = NULL;
int nBestHeight = -1;
CBigNum bnBestChainWork = 0;
@@ -37,22 +46,6 @@ multimap<uint256, CBlock*> mapOrphanBlocksByPrev;
map<uint256, CDataStream*> mapOrphanTransactions;
multimap<uint256, CDataStream*> mapOrphanTransactionsByPrev;
-map<uint256, CWalletTx> mapWallet;
-vector<uint256> vWalletUpdated;
-CCriticalSection cs_mapWallet;
-
-map<vector<unsigned char>, CPrivKey> mapKeys;
-map<uint160, vector<unsigned char> > mapPubKeys;
-CCriticalSection cs_mapKeys;
-CKey keyUser;
-
-map<uint256, int> mapRequestCount;
-CCriticalSection cs_mapRequestCount;
-
-map<string, string> mapAddressBook;
-CCriticalSection cs_mapAddressBook;
-
-vector<unsigned char> vchDefaultKey;
double dHashesPerSec;
int64 nHPSTimerStart;
@@ -60,18 +53,15 @@ int64 nHPSTimerStart;
// Settings
int fGenerateBitcoins = false;
int64 nTransactionFee = 0;
-CAddress addrIncoming;
int fLimitProcessors = false;
int nLimitProcessors = 1;
int fMinimizeToTray = true;
int fMinimizeOnClose = true;
-#ifdef USE_UPNP
#if USE_UPNP
int fUseUPnP = true;
#else
int fUseUPnP = false;
#endif
-#endif
@@ -81,151 +71,82 @@ int fUseUPnP = false;
//////////////////////////////////////////////////////////////////////////////
//
-// mapKeys
+// dispatching functions
//
-bool AddKey(const CKey& key)
+void RegisterWallet(CWallet* pwalletIn)
{
- CRITICAL_BLOCK(cs_mapKeys)
+ CRITICAL_BLOCK(cs_setpwalletRegistered)
{
- mapKeys[key.GetPubKey()] = key.GetPrivKey();
- mapPubKeys[Hash160(key.GetPubKey())] = key.GetPubKey();
+ setpwalletRegistered.insert(pwalletIn);
}
- return CWalletDB().WriteKey(key.GetPubKey(), key.GetPrivKey());
}
-vector<unsigned char> GenerateNewKey()
+void UnregisterWallet(CWallet* pwalletIn)
{
- RandAddSeedPerfmon();
- CKey key;
- key.MakeNewKey();
- if (!AddKey(key))
- throw runtime_error("GenerateNewKey() : AddKey failed");
- return key.GetPubKey();
+ CRITICAL_BLOCK(cs_setpwalletRegistered)
+ {
+ setpwalletRegistered.erase(pwalletIn);
+ }
}
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// mapWallet
-//
-
-bool AddToWallet(const CWalletTx& wtxIn)
+bool static IsFromMe(CTransaction& tx)
{
- uint256 hash = wtxIn.GetHash();
- CRITICAL_BLOCK(cs_mapWallet)
- {
- // Inserts only if not already there, returns tx inserted or tx found
- pair<map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(make_pair(hash, wtxIn));
- CWalletTx& wtx = (*ret.first).second;
- bool fInsertedNew = ret.second;
- if (fInsertedNew)
- wtx.nTimeReceived = GetAdjustedTime();
-
- bool fUpdated = false;
- if (!fInsertedNew)
- {
- // Merge
- if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock)
- {
- wtx.hashBlock = wtxIn.hashBlock;
- fUpdated = true;
- }
- if (wtxIn.nIndex != -1 && (wtxIn.vMerkleBranch != wtx.vMerkleBranch || wtxIn.nIndex != wtx.nIndex))
- {
- wtx.vMerkleBranch = wtxIn.vMerkleBranch;
- wtx.nIndex = wtxIn.nIndex;
- fUpdated = true;
- }
- if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe)
- {
- wtx.fFromMe = wtxIn.fFromMe;
- fUpdated = true;
- }
- fUpdated |= wtx.UpdateSpent(wtxIn.vfSpent);
- }
-
- //// debug print
- printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ if (pwallet->IsFromMe(tx))
+ return true;
+ return false;
+}
- // Write to disk
- if (fInsertedNew || fUpdated)
- if (!wtx.WriteToDisk())
- return false;
+bool static GetTransaction(const uint256& hashTx, CWalletTx& wtx)
+{
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ if (pwallet->GetTransaction(hashTx,wtx))
+ return true;
+ return false;
+}
- // If default receiving address gets used, replace it with a new one
- CScript scriptDefaultKey;
- scriptDefaultKey.SetBitcoinAddress(vchDefaultKey);
- foreach(const CTxOut& txout, wtx.vout)
- {
- if (txout.scriptPubKey == scriptDefaultKey)
- {
- CWalletDB walletdb;
- vchDefaultKey = GetKeyFromKeyPool();
- walletdb.WriteDefaultKey(vchDefaultKey);
- walletdb.WriteName(PubKeyToAddress(vchDefaultKey), "");
- }
- }
+void static EraseFromWallets(uint256 hash)
+{
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->EraseFromWallet(hash);
+}
- // Notify UI
- vWalletUpdated.push_back(hash);
- }
+void static SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false)
+{
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->AddToWalletIfInvolvingMe(tx, pblock, fUpdate);
+}
- // Refresh UI
- MainFrameRepaint();
- return true;
+void static SetBestChain(const CBlockLocator& loc)
+{
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->SetBestChain(loc);
}
-bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate = false)
+void static UpdatedTransaction(const uint256& hashTx)
{
- uint256 hash = tx.GetHash();
- bool fExisted = mapWallet.count(hash);
- if (fExisted && !fUpdate) return false;
- if (fExisted || tx.IsMine() || tx.IsFromMe())
- {
- CWalletTx wtx(tx);
- // Get merkle branch if transaction was found in a block
- if (pblock)
- wtx.SetMerkleBranch(pblock);
- return AddToWallet(wtx);
- }
- return false;
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->UpdatedTransaction(hashTx);
}
-bool EraseFromWallet(uint256 hash)
+void static PrintWallets(const CBlock& block)
{
- CRITICAL_BLOCK(cs_mapWallet)
- {
- if (mapWallet.erase(hash))
- CWalletDB().EraseTx(hash);
- }
- return true;
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->PrintWallet(block);
}
-void WalletUpdateSpent(const COutPoint& prevout)
+void static Inventory(const uint256& hash)
{
- // Anytime a signature is successfully verified, it's proof the outpoint is spent.
- // Update the wallet spent flag if it doesn't know due to wallet.dat being
- // restored from backup or the user making copies of wallet.dat.
- CRITICAL_BLOCK(cs_mapWallet)
- {
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(prevout.hash);
- if (mi != mapWallet.end())
- {
- CWalletTx& wtx = (*mi).second;
- if (!wtx.IsSpent(prevout.n) && wtx.vout[prevout.n].IsMine())
- {
- printf("WalletUpdateSpent found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
- wtx.MarkSpent(prevout.n);
- wtx.WriteToDisk();
- vWalletUpdated.push_back(prevout.hash);
- }
- }
- }
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->Inventory(hash);
}
+void static ResendWalletTransactions()
+{
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ pwallet->ResendWalletTransactions();
+}
@@ -238,7 +159,7 @@ void WalletUpdateSpent(const COutPoint& prevout)
// mapOrphanTransactions
//
-void AddOrphanTx(const CDataStream& vMsg)
+void static AddOrphanTx(const CDataStream& vMsg)
{
CTransaction tx;
CDataStream(vMsg) >> tx;
@@ -246,18 +167,18 @@ void AddOrphanTx(const CDataStream& vMsg)
if (mapOrphanTransactions.count(hash))
return;
CDataStream* pvMsg = mapOrphanTransactions[hash] = new CDataStream(vMsg);
- foreach(const CTxIn& txin, tx.vin)
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev.insert(make_pair(txin.prevout.hash, pvMsg));
}
-void EraseOrphanTx(uint256 hash)
+void static EraseOrphanTx(uint256 hash)
{
if (!mapOrphanTransactions.count(hash))
return;
const CDataStream* pvMsg = mapOrphanTransactions[hash];
CTransaction tx;
CDataStream(*pvMsg) >> tx;
- foreach(const CTxIn& txin, tx.vin)
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
for (multimap<uint256, CDataStream*>::iterator mi = mapOrphanTransactionsByPrev.lower_bound(txin.prevout.hash);
mi != mapOrphanTransactionsByPrev.upper_bound(txin.prevout.hash);)
@@ -312,190 +233,6 @@ bool CTransaction::ReadFromDisk(COutPoint prevout)
return ReadFromDisk(txdb, prevout, txindex);
}
-bool CTxIn::IsMine() const
-{
- CRITICAL_BLOCK(cs_mapWallet)
- {
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(prevout.hash);
- if (mi != mapWallet.end())
- {
- const CWalletTx& prev = (*mi).second;
- if (prevout.n < prev.vout.size())
- if (prev.vout[prevout.n].IsMine())
- return true;
- }
- }
- return false;
-}
-
-int64 CTxIn::GetDebit() const
-{
- CRITICAL_BLOCK(cs_mapWallet)
- {
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(prevout.hash);
- if (mi != mapWallet.end())
- {
- const CWalletTx& prev = (*mi).second;
- if (prevout.n < prev.vout.size())
- if (prev.vout[prevout.n].IsMine())
- return prev.vout[prevout.n].nValue;
- }
- }
- return 0;
-}
-
-int64 CWalletTx::GetTxTime() const
-{
- if (!fTimeReceivedIsTxTime && hashBlock != 0)
- {
- // If we did not receive the transaction directly, we rely on the block's
- // time to figure out when it happened. We use the median over a range
- // of blocks to try to filter out inaccurate block times.
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
- if (mi != mapBlockIndex.end())
- {
- CBlockIndex* pindex = (*mi).second;
- if (pindex)
- return pindex->GetMedianTime();
- }
- }
- return nTimeReceived;
-}
-
-int CWalletTx::GetRequestCount() const
-{
- // Returns -1 if it wasn't being tracked
- int nRequests = -1;
- CRITICAL_BLOCK(cs_mapRequestCount)
- {
- if (IsCoinBase())
- {
- // Generated block
- if (hashBlock != 0)
- {
- map<uint256, int>::iterator mi = mapRequestCount.find(hashBlock);
- if (mi != mapRequestCount.end())
- nRequests = (*mi).second;
- }
- }
- else
- {
- // Did anyone request this transaction?
- map<uint256, int>::iterator mi = mapRequestCount.find(GetHash());
- if (mi != mapRequestCount.end())
- {
- nRequests = (*mi).second;
-
- // How about the block it's in?
- if (nRequests == 0 && hashBlock != 0)
- {
- map<uint256, int>::iterator mi = mapRequestCount.find(hashBlock);
- if (mi != mapRequestCount.end())
- nRequests = (*mi).second;
- else
- nRequests = 1; // If it's in someone else's block it must have got out
- }
- }
- }
- }
- return nRequests;
-}
-
-void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<string, int64> >& listReceived,
- list<pair<string, int64> >& listSent, int64& nFee, string& strSentAccount) const
-{
- nGeneratedImmature = nGeneratedMature = nFee = 0;
- listReceived.clear();
- listSent.clear();
- strSentAccount = strFromAccount;
-
- if (IsCoinBase())
- {
- if (GetBlocksToMaturity() > 0)
- nGeneratedImmature = CTransaction::GetCredit();
- else
- nGeneratedMature = GetCredit();
- return;
- }
-
- // Compute fee:
- int64 nDebit = GetDebit();
- if (nDebit > 0) // debit>0 means we signed/sent this transaction
- {
- int64 nValueOut = GetValueOut();
- nFee = nDebit - nValueOut;
- }
-
- // Sent/received. Standard client will never generate a send-to-multiple-recipients,
- // but non-standard clients might (so return a list of address/amount pairs)
- foreach(const CTxOut& txout, vout)
- {
- string address;
- uint160 hash160;
- vector<unsigned char> vchPubKey;
- if (ExtractHash160(txout.scriptPubKey, hash160))
- address = Hash160ToAddress(hash160);
- else if (ExtractPubKey(txout.scriptPubKey, false, vchPubKey))
- address = PubKeyToAddress(vchPubKey);
- else
- {
- printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
- this->GetHash().ToString().c_str());
- address = " unknown ";
- }
-
- // Don't report 'change' txouts
- if (nDebit > 0 && txout.IsChange())
- continue;
-
- if (nDebit > 0)
- listSent.push_back(make_pair(address, txout.nValue));
-
- if (txout.IsMine())
- listReceived.push_back(make_pair(address, txout.nValue));
- }
-
-}
-
-void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
- int64& nSent, int64& nFee) const
-{
- nGenerated = nReceived = nSent = nFee = 0;
-
- int64 allGeneratedImmature, allGeneratedMature, allFee;
- allGeneratedImmature = allGeneratedMature = allFee = 0;
- string strSentAccount;
- list<pair<string, int64> > listReceived;
- list<pair<string, int64> > listSent;
- GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
-
- if (strAccount == "")
- nGenerated = allGeneratedMature;
- if (strAccount == strSentAccount)
- {
- foreach(const PAIRTYPE(string,int64)& s, listSent)
- nSent += s.second;
- nFee = allFee;
- }
- CRITICAL_BLOCK(cs_mapAddressBook)
- {
- foreach(const PAIRTYPE(string,int64)& r, listReceived)
- {
- if (mapAddressBook.count(r.first))
- {
- if (mapAddressBook[r.first] == strAccount)
- {
- nReceived += r.second;
- }
- }
- else if (strAccount.empty())
- {
- nReceived += r.second;
- }
- }
- }
-}
-
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
@@ -551,69 +288,6 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
-void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
-{
- vtxPrev.clear();
-
- const int COPY_DEPTH = 3;
- if (SetMerkleBranch() < COPY_DEPTH)
- {
- vector<uint256> vWorkQueue;
- foreach(const CTxIn& txin, vin)
- vWorkQueue.push_back(txin.prevout.hash);
-
- // This critsect is OK because txdb is already open
- CRITICAL_BLOCK(cs_mapWallet)
- {
- map<uint256, const CMerkleTx*> mapWalletPrev;
- set<uint256> setAlreadyDone;
- for (int i = 0; i < vWorkQueue.size(); i++)
- {
- uint256 hash = vWorkQueue[i];
- if (setAlreadyDone.count(hash))
- continue;
- setAlreadyDone.insert(hash);
-
- CMerkleTx tx;
- if (mapWallet.count(hash))
- {
- tx = mapWallet[hash];
- foreach(const CMerkleTx& txWalletPrev, mapWallet[hash].vtxPrev)
- mapWalletPrev[txWalletPrev.GetHash()] = &txWalletPrev;
- }
- else if (mapWalletPrev.count(hash))
- {
- tx = *mapWalletPrev[hash];
- }
- else if (!fClient && txdb.ReadDiskTx(hash, tx))
- {
- ;
- }
- else
- {
- printf("ERROR: AddSupportingTransactions() : unsupported transaction\n");
- continue;
- }
-
- int nDepth = tx.SetMerkleBranch();
- vtxPrev.push_back(tx);
-
- if (nDepth < COPY_DEPTH)
- foreach(const CTxIn& txin, tx.vin)
- vWorkQueue.push_back(txin.prevout.hash);
- }
- }
- }
-
- reverse(vtxPrev.begin(), vtxPrev.end());
-}
-
-
-
-
-
-
-
@@ -630,7 +304,7 @@ bool CTransaction::CheckTransaction() const
// Check for negative or overflow output values
int64 nValueOut = 0;
- foreach(const CTxOut& txout, vout)
+ BOOST_FOREACH(const CTxOut& txout, vout)
{
if (txout.nValue < 0)
return error("CTransaction::CheckTransaction() : txout.nValue negative");
@@ -641,6 +315,15 @@ bool CTransaction::CheckTransaction() const
return error("CTransaction::CheckTransaction() : txout total out of range");
}
+ // Check for duplicate inputs
+ set<COutPoint> vInOutPoints;
+ BOOST_FOREACH(const CTxIn& txin, vin)
+ {
+ if (vInOutPoints.count(txin.prevout))
+ return false;
+ vInOutPoints.insert(txin.prevout);
+ }
+
if (IsCoinBase())
{
if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100)
@@ -648,7 +331,7 @@ bool CTransaction::CheckTransaction() const
}
else
{
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
if (txin.prevout.IsNull())
return error("CTransaction::CheckTransaction() : prevout is null");
}
@@ -681,8 +364,8 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
if (GetSigOpCount() > nSize / 34 || nSize < 100)
return error("AcceptToMemoryPool() : nonstandard transaction");
- // Rather not work on nonstandard transactions
- if (!IsStandard())
+ // Rather not work on nonstandard transactions (unless -testnet)
+ if (!fTestNet && !IsStandard())
return error("AcceptToMemoryPool() : nonstandard transaction type");
// Do we already have it?
@@ -735,13 +418,13 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
}
// Don't accept it if it can't get into a block
- if (nFees < GetMinFee(1000))
+ if (nFees < GetMinFee(1000, true, true))
return error("AcceptToMemoryPool() : not enough fees");
// Continuously rate-limit free transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make other's transactions take longer to confirm.
- if (nFees < CENT)
+ if (nFees < MIN_RELAY_TX_FEE)
{
static CCriticalSection cs;
static double dFreeCount;
@@ -755,7 +438,7 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
nLastTime = nNow;
// -limitfreerelay unit is thousand-bytes-per-minute
// At default rate it would take over a month to fill 1GB
- if (dFreeCount > GetArg("-limitfreerelay", 15)*10*1000 && !IsFromMe())
+ if (dFreeCount > GetArg("-limitfreerelay", 15)*10*1000 && !IsFromMe(*this))
return error("AcceptToMemoryPool() : free transaction rejected by rate limiter");
if (fDebug)
printf("Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize);
@@ -778,12 +461,17 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
///// are we sure this is ok when loading transactions or restoring block txes
// If updated, erase old tx from wallet
if (ptxOld)
- EraseFromWallet(ptxOld->GetHash());
+ EraseFromWallets(ptxOld->GetHash());
printf("AcceptToMemoryPool(): accepted %s\n", hash.ToString().substr(0,10).c_str());
return true;
}
+bool CTransaction::AcceptToMemoryPool(bool fCheckInputs, bool* pfMissingInputs)
+{
+ CTxDB txdb("r");
+ return AcceptToMemoryPool(txdb, fCheckInputs, pfMissingInputs);
+}
bool CTransaction::AddToMemoryPoolUnchecked()
{
@@ -806,7 +494,7 @@ bool CTransaction::RemoveFromMemoryPool()
// Remove transaction from memory pool
CRITICAL_BLOCK(cs_mapTransactions)
{
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
mapNextTx.erase(txin.prevout);
mapTransactions.erase(GetHash());
nTransactionsUpdated++;
@@ -867,6 +555,12 @@ bool CMerkleTx::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs)
}
}
+bool CMerkleTx::AcceptToMemoryPool()
+{
+ CTxDB txdb("r");
+ return AcceptToMemoryPool(txdb);
+}
+
bool CWalletTx::AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs)
@@ -874,7 +568,7 @@ bool CWalletTx::AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs)
CRITICAL_BLOCK(cs_mapTransactions)
{
// Add previous supporting transactions first
- foreach(CMerkleTx& tx, vtxPrev)
+ BOOST_FOREACH(CMerkleTx& tx, vtxPrev)
{
if (!tx.IsCoinBase())
{
@@ -888,148 +582,10 @@ bool CWalletTx::AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs)
return false;
}
-int ScanForWalletTransactions(CBlockIndex* pindexStart)
+bool CWalletTx::AcceptWalletTransaction()
{
- int ret = 0;
-
- CBlockIndex* pindex = pindexStart;
- CRITICAL_BLOCK(cs_mapWallet)
- {
- while (pindex)
- {
- CBlock block;
- block.ReadFromDisk(pindex, true);
- foreach(CTransaction& tx, block.vtx)
- {
- if (AddToWalletIfInvolvingMe(tx, &block))
- ret++;
- }
- pindex = pindex->pnext;
- }
- }
- return ret;
-}
-
-void ReacceptWalletTransactions()
-{
- CTxDB txdb("r");
- bool fRepeat = true;
- while (fRepeat) CRITICAL_BLOCK(cs_mapWallet)
- {
- fRepeat = false;
- vector<CDiskTxPos> vMissingTx;
- foreach(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
- {
- CWalletTx& wtx = item.second;
- if (wtx.IsCoinBase() && wtx.IsSpent(0))
- continue;
-
- CTxIndex txindex;
- bool fUpdated = false;
- if (txdb.ReadTxIndex(wtx.GetHash(), txindex))
- {
- // 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());
- continue;
- }
- for (int i = 0; i < txindex.vSpent.size(); i++)
- {
- if (wtx.IsSpent(i))
- continue;
- if (!txindex.vSpent[i].IsNull() && wtx.vout[i].IsMine())
- {
- wtx.MarkSpent(i);
- fUpdated = true;
- vMissingTx.push_back(txindex.vSpent[i]);
- }
- }
- if (fUpdated)
- {
- printf("ReacceptWalletTransactions found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
- wtx.MarkDirty();
- wtx.WriteToDisk();
- }
- }
- else
- {
- // Reaccept any txes of ours that aren't already in a block
- if (!wtx.IsCoinBase())
- wtx.AcceptWalletTransaction(txdb, false);
- }
- }
- if (!vMissingTx.empty())
- {
- // TODO: optimize this to scan just part of the block chain?
- if (ScanForWalletTransactions(pindexGenesisBlock))
- fRepeat = true; // Found missing transactions: re-do Reaccept.
- }
- }
-}
-
-
-void CWalletTx::RelayWalletTransaction(CTxDB& txdb)
-{
- foreach(const CMerkleTx& tx, vtxPrev)
- {
- if (!tx.IsCoinBase())
- {
- uint256 hash = tx.GetHash();
- if (!txdb.ContainsTx(hash))
- RelayMessage(CInv(MSG_TX, hash), (CTransaction)tx);
- }
- }
- if (!IsCoinBase())
- {
- uint256 hash = GetHash();
- if (!txdb.ContainsTx(hash))
- {
- printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str());
- RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this);
- }
- }
-}
-
-void ResendWalletTransactions()
-{
- // Do this infrequently and randomly to avoid giving away
- // that these are our transactions.
- static int64 nNextTime;
- if (GetTime() < nNextTime)
- return;
- bool fFirst = (nNextTime == 0);
- nNextTime = GetTime() + GetRand(30 * 60);
- if (fFirst)
- return;
-
- // Only do it if there's been a new block since last time
- static int64 nLastTime;
- if (nTimeBestReceived < nLastTime)
- return;
- nLastTime = GetTime();
-
- // Rebroadcast any of our txes that aren't in a block yet
- printf("ResendWalletTransactions()\n");
CTxDB txdb("r");
- CRITICAL_BLOCK(cs_mapWallet)
- {
- // Sort them in chronological order
- multimap<unsigned int, CWalletTx*> mapSorted;
- foreach(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
- {
- CWalletTx& wtx = item.second;
- // Don't rebroadcast until it's had plenty of time that
- // it should have gotten in already by now.
- if (nTimeBestReceived - (int64)wtx.nTimeReceived > 5 * 60)
- mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
- }
- foreach(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted)
- {
- CWalletTx& wtx = *item.second;
- wtx.RelayWalletTransaction(txdb);
- }
- }
+ return AcceptWalletTransaction(txdb);
}
int CTxIndex::GetDepthInMainChain() const
@@ -1076,7 +632,7 @@ bool CBlock::ReadFromDisk(const CBlockIndex* pindex, bool fReadTransactions)
return true;
}
-uint256 GetOrphanRoot(const CBlock* pblock)
+uint256 static GetOrphanRoot(const CBlock* pblock)
{
// Work back to the first block in the orphan chain
while (mapOrphanBlocks.count(pblock->hashPrevBlock))
@@ -1084,7 +640,7 @@ uint256 GetOrphanRoot(const CBlock* pblock)
return pblock->GetHash();
}
-int64 GetBlockValue(int nHeight, int64 nFees)
+int64 static GetBlockValue(int nHeight, int64 nFees)
{
int64 nSubsidy = 50 * COIN;
@@ -1094,7 +650,7 @@ int64 GetBlockValue(int nHeight, int64 nFees)
return nSubsidy + nFees;
}
-unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
+unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast)
{
const int64 nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
const int64 nTargetSpacing = 10 * 60;
@@ -1156,9 +712,22 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
return true;
}
+// Return conservative estimate of total number of blocks, 0 if unknown
+int GetTotalBlocksEstimate()
+{
+ if(fTestNet)
+ {
+ return 0;
+ }
+ else
+ {
+ return nTotalBlocksEstimate;
+ }
+}
+
bool IsInitialBlockDownload()
{
- if (pindexBest == NULL || (!fTestNet && nBestHeight < 118000))
+ if (pindexBest == NULL || nBestHeight < (GetTotalBlocksEstimate()-nInitialBlockThreshold))
return true;
static int64 nLastUpdate;
static CBlockIndex* pindexLastBest;
@@ -1171,7 +740,7 @@ bool IsInitialBlockDownload()
pindexBest->GetBlockTime() < GetTime() - 24 * 60 * 60);
}
-void InvalidChainFound(CBlockIndex* pindexNew)
+void static InvalidChainFound(CBlockIndex* pindexNew)
{
if (pindexNew->bnChainWork > bnBestInvalidWork)
{
@@ -1200,7 +769,7 @@ bool CTransaction::DisconnectInputs(CTxDB& txdb)
// Relinquish previous transactions' spent pointers
if (!IsCoinBase())
{
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
{
COutPoint prevout = txin.prevout;
@@ -1423,7 +992,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
map<uint256, CTxIndex> mapUnused;
int64 nFees = 0;
- foreach(CTransaction& tx, vtx)
+ BOOST_FOREACH(CTransaction& tx, vtx)
{
CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos);
nTxPos += ::GetSerializeSize(tx, SER_DISK);
@@ -1446,13 +1015,13 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
}
// Watch for transactions paying to me
- foreach(CTransaction& tx, vtx)
- AddToWalletIfInvolvingMe(tx, this, true);
+ BOOST_FOREACH(CTransaction& tx, vtx)
+ SyncWithWallets(tx, this, true);
return true;
}
-bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
+bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
{
printf("REORGANIZE\n");
@@ -1483,7 +1052,7 @@ bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
// Disconnect shorter branch
vector<CTransaction> vResurrect;
- foreach(CBlockIndex* pindex, vDisconnect)
+ BOOST_FOREACH(CBlockIndex* pindex, vDisconnect)
{
CBlock block;
if (!block.ReadFromDisk(pindex))
@@ -1492,7 +1061,7 @@ bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
return error("Reorganize() : DisconnectBlock failed");
// Queue memory transactions to resurrect
- foreach(const CTransaction& tx, block.vtx)
+ BOOST_FOREACH(const CTransaction& tx, block.vtx)
if (!tx.IsCoinBase())
vResurrect.push_back(tx);
}
@@ -1513,7 +1082,7 @@ bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
}
// Queue memory transactions to delete
- foreach(const CTransaction& tx, block.vtx)
+ BOOST_FOREACH(const CTransaction& tx, block.vtx)
vDelete.push_back(tx);
}
if (!txdb.WriteHashBestChain(pindexNew->GetBlockHash()))
@@ -1524,21 +1093,21 @@ bool Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
return error("Reorganize() : TxnCommit failed");
// Disconnect shorter branch
- foreach(CBlockIndex* pindex, vDisconnect)
+ BOOST_FOREACH(CBlockIndex* pindex, vDisconnect)
if (pindex->pprev)
pindex->pprev->pnext = NULL;
// Connect longer branch
- foreach(CBlockIndex* pindex, vConnect)
+ BOOST_FOREACH(CBlockIndex* pindex, vConnect)
if (pindex->pprev)
pindex->pprev->pnext = pindex;
// Resurrect memory transactions that were in the disconnected branch
- foreach(CTransaction& tx, vResurrect)
+ BOOST_FOREACH(CTransaction& tx, vResurrect)
tx.AcceptToMemoryPool(txdb, false);
// Delete redundant memory transactions that are in the connected branch
- foreach(CTransaction& tx, vDelete)
+ BOOST_FOREACH(CTransaction& tx, vDelete)
tx.RemoveFromMemoryPool();
return true;
@@ -1573,7 +1142,7 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
pindexNew->pprev->pnext = pindexNew;
// Delete redundant memory transactions
- foreach(CTransaction& tx, vtx)
+ BOOST_FOREACH(CTransaction& tx, vtx)
tx.RemoveFromMemoryPool();
}
else
@@ -1590,10 +1159,8 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
// Update best block in wallet (so we can detect restored wallets)
if (!IsInitialBlockDownload())
{
- CWalletDB walletdb;
const CBlockLocator locator(pindexNew);
- if (!walletdb.WriteBestBlock(locator))
- return error("SetBestChain() : WriteWalletBest failed");
+ ::SetBestChain(locator);
}
// New best block
@@ -1647,8 +1214,7 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos)
{
// Notify UI to display prev block's coinbase if it was ours
static uint256 hashPrevBestCoinBase;
- CRITICAL_BLOCK(cs_mapWallet)
- vWalletUpdated.push_back(hashPrevBestCoinBase);
+ UpdatedTransaction(hashPrevBestCoinBase);
hashPrevBestCoinBase = vtx[0].GetHash();
}
@@ -1684,7 +1250,7 @@ bool CBlock::CheckBlock() const
return error("CheckBlock() : more than one coinbase");
// Check transactions
- foreach(const CTransaction& tx, vtx)
+ BOOST_FOREACH(const CTransaction& tx, vtx)
if (!tx.CheckTransaction())
return error("CheckBlock() : CheckTransaction failed");
@@ -1722,7 +1288,7 @@ bool CBlock::AcceptBlock()
return error("AcceptBlock() : block's timestamp is too early");
// Check that all transactions are finalized
- foreach(const CTransaction& tx, vtx)
+ BOOST_FOREACH(const CTransaction& tx, vtx)
if (!tx.IsFinal(nHeight, GetBlockTime()))
return error("AcceptBlock() : contains a non-final transaction");
@@ -1734,7 +1300,8 @@ bool CBlock::AcceptBlock()
(nHeight == 70567 && hash != uint256("0x00000000006a49b14bcf27462068f1264c961f11fa2e0eddd2be0791e1d4124a")) ||
(nHeight == 74000 && hash != uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) ||
(nHeight == 105000 && hash != uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) ||
- (nHeight == 118000 && hash != uint256("0x000000000000774a7f8a7a12dc906ddb9e17e75d684f15e00f8767f9e8f36553")))
+ (nHeight == 118000 && hash != uint256("0x000000000000774a7f8a7a12dc906ddb9e17e75d684f15e00f8767f9e8f36553")) ||
+ (nHeight == 134444 && hash != uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")))
return error("AcceptBlock() : rejected by checkpoint lockin at %d", nHeight);
// Write block to history file
@@ -1750,14 +1317,14 @@ bool CBlock::AcceptBlock()
// Relay inventory, but don't relay old inventory during initial block download
if (hashBestChain == hash)
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
- if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 118000))
+ BOOST_FOREACH(CNode* pnode, vNodes)
+ if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 134444))
pnode->PushInventory(CInv(MSG_BLOCK, hash));
return true;
}
-bool ProcessBlock(CNode* pfrom, CBlock* pblock)
+bool static ProcessBlock(CNode* pfrom, CBlock* pblock)
{
// Check for duplicate
uint256 hash = pblock->GetHash();
@@ -1818,47 +1385,6 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
-template<typename Stream>
-bool ScanMessageStart(Stream& s)
-{
- // Scan ahead to the next pchMessageStart, which should normally be immediately
- // at the file pointer. Leaves file pointer at end of pchMessageStart.
- s.clear(0);
- short prevmask = s.exceptions(0);
- const char* p = BEGIN(pchMessageStart);
- try
- {
- loop
- {
- char c;
- s.read(&c, 1);
- if (s.fail())
- {
- s.clear(0);
- s.exceptions(prevmask);
- return false;
- }
- if (*p != c)
- p = BEGIN(pchMessageStart);
- if (*p == c)
- {
- if (++p == END(pchMessageStart))
- {
- s.clear(0);
- s.exceptions(prevmask);
- return true;
- }
- }
- }
- }
- catch (...)
- {
- s.clear(0);
- s.exceptions(prevmask);
- return false;
- }
-}
-
bool CheckDiskSpace(uint64 nAdditionalBytes)
{
uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available;
@@ -2034,7 +1560,7 @@ void PrintBlockTree()
for (int i = 0; i < nCol; i++)
printf("| ");
printf("|\n");
- }
+ }
nPrevCol = nCol;
// print columns
@@ -2052,16 +1578,7 @@ void PrintBlockTree()
DateTimeStrFormat("%x %H:%M:%S", block.GetBlockTime()).c_str(),
block.vtx.size());
- CRITICAL_BLOCK(cs_mapWallet)
- {
- 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("\n");
-
+ PrintWallets(block);
// put the main timechain first
vector<CBlockIndex*>& vNext = mapNext[pindex];
@@ -2122,7 +1639,7 @@ string GetWarnings(string strFor)
// Alerts
CRITICAL_BLOCK(cs_mapAlerts)
{
- foreach(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
+ BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.AppliesToMe() && alert.nPriority > nPriority)
@@ -2137,7 +1654,7 @@ string GetWarnings(string strFor)
return strStatusBar;
else if (strFor == "rpc")
return strRPC;
- assert(("GetWarnings() : invalid parameter", false));
+ assert(!"GetWarnings() : invalid parameter");
return "error";
}
@@ -2169,7 +1686,7 @@ bool CAlert::ProcessAlert()
}
// Check if this alert has been cancelled
- foreach(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
+ BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.Cancels(*this))
@@ -2201,7 +1718,7 @@ bool CAlert::ProcessAlert()
//
-bool AlreadyHave(CTxDB& txdb, const CInv& inv)
+bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
{
switch (inv.type)
{
@@ -2218,131 +1735,10 @@ bool AlreadyHave(CTxDB& txdb, const CInv& inv)
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ascii, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
-char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
-
-
-bool ProcessMessages(CNode* pfrom)
-{
- CDataStream& vRecv = pfrom->vRecv;
- if (vRecv.empty())
- return true;
- //if (fDebug)
- // printf("ProcessMessages(%u bytes)\n", vRecv.size());
-
- //
- // Message format
- // (4) message start
- // (12) command
- // (4) size
- // (4) checksum
- // (x) data
- //
-
- loop
- {
- // Scan for message start
- CDataStream::iterator pstart = search(vRecv.begin(), vRecv.end(), BEGIN(pchMessageStart), END(pchMessageStart));
- int nHeaderSize = vRecv.GetSerializeSize(CMessageHeader());
- if (vRecv.end() - pstart < nHeaderSize)
- {
- if (vRecv.size() > nHeaderSize)
- {
- printf("\n\nPROCESSMESSAGE MESSAGESTART NOT FOUND\n\n");
- vRecv.erase(vRecv.begin(), vRecv.end() - nHeaderSize);
- }
- break;
- }
- if (pstart - vRecv.begin() > 0)
- printf("\n\nPROCESSMESSAGE SKIPPED %d BYTES\n\n", pstart - vRecv.begin());
- vRecv.erase(vRecv.begin(), pstart);
-
- // Read header
- vector<char> vHeaderSave(vRecv.begin(), vRecv.begin() + nHeaderSize);
- CMessageHeader hdr;
- vRecv >> hdr;
- if (!hdr.IsValid())
- {
- printf("\n\nPROCESSMESSAGE: ERRORS IN HEADER %s\n\n\n", hdr.GetCommand().c_str());
- continue;
- }
- string strCommand = hdr.GetCommand();
-
- // Message size
- unsigned int nMessageSize = hdr.nMessageSize;
- if (nMessageSize > MAX_SIZE)
- {
- printf("ProcessMessage(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize);
- continue;
- }
- if (nMessageSize > vRecv.size())
- {
- // Rewind and wait for rest of message
- vRecv.insert(vRecv.begin(), vHeaderSave.begin(), vHeaderSave.end());
- break;
- }
-
- // Checksum
- if (vRecv.GetVersion() >= 209)
- {
- uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
- unsigned int nChecksum = 0;
- memcpy(&nChecksum, &hash, sizeof(nChecksum));
- if (nChecksum != hdr.nChecksum)
- {
- printf("ProcessMessage(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
- strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
- continue;
- }
- }
-
- // Copy message to its own buffer
- CDataStream vMsg(vRecv.begin(), vRecv.begin() + nMessageSize, vRecv.nType, vRecv.nVersion);
- vRecv.ignore(nMessageSize);
-
- // Process message
- bool fRet = false;
- try
- {
- CRITICAL_BLOCK(cs_main)
- fRet = ProcessMessage(pfrom, strCommand, vMsg);
- if (fShutdown)
- return true;
- }
- catch (std::ios_base::failure& e)
- {
- if (strstr(e.what(), "end of data"))
- {
- // Allow exceptions from underlength message on vRecv
- printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what());
- }
- else if (strstr(e.what(), "size too large"))
- {
- // Allow exceptions from overlong size
- printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what());
- }
- else
- {
- PrintExceptionContinue(&e, "ProcessMessage()");
- }
- }
- catch (std::exception& e) {
- PrintExceptionContinue(&e, "ProcessMessage()");
- } catch (...) {
- PrintExceptionContinue(NULL, "ProcessMessage()");
- }
+unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
- if (!fRet)
- printf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
- }
- vRecv.Compact();
- return true;
-}
-
-
-
-
-bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
+bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
static map<unsigned int, vector<unsigned char> > mapReuseKey;
RandAddSeedPerfmon();
@@ -2433,7 +1829,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Relay alerts
CRITICAL_BLOCK(cs_mapAlerts)
- foreach(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
+ BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
item.second.RelayTo(pfrom);
pfrom->fSuccessfullyConnected = true;
@@ -2469,9 +1865,11 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
return error("message addr size() = %d", vAddr.size());
// Store the new addresses
+ CAddrDB addrDB;
+ addrDB.TxnBegin();
int64 nNow = GetAdjustedTime();
int64 nSince = nNow - 10 * 60;
- foreach(CAddress& addr, vAddr)
+ BOOST_FOREACH(CAddress& addr, vAddr)
{
if (fShutdown)
return true;
@@ -2480,7 +1878,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
continue;
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60;
- AddAddress(addr, 2 * 60 * 60);
+ AddAddress(addr, 2 * 60 * 60, &addrDB);
pfrom->AddAddressKnown(addr);
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
{
@@ -2495,7 +1893,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
uint256 hashRand = hashSalt ^ (((int64)addr.ip)<<32) ^ ((GetTime()+addr.ip)/(24*60*60));
hashRand = Hash(BEGIN(hashRand), END(hashRand));
multimap<uint256, CNode*> mapMix;
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
{
if (pnode->nVersion < 31402)
continue;
@@ -2511,6 +1909,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
}
}
+ addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
if (vAddr.size() < 1000)
pfrom->fGetAddr = false;
}
@@ -2524,7 +1923,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
return error("message inv size() = %d", vInv.size());
CTxDB txdb("r");
- foreach(const CInv& inv, vInv)
+ BOOST_FOREACH(const CInv& inv, vInv)
{
if (fShutdown)
return true;
@@ -2539,12 +1938,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(mapOrphanBlocks[inv.hash]));
// Track requests for our stuff
- CRITICAL_BLOCK(cs_mapRequestCount)
- {
- map<uint256, int>::iterator mi = mapRequestCount.find(inv.hash);
- if (mi != mapRequestCount.end())
- (*mi).second++;
- }
+ Inventory(inv.hash);
}
}
@@ -2556,7 +1950,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > 50000)
return error("message getdata size() = %d", vInv.size());
- foreach(const CInv& inv, vInv)
+ BOOST_FOREACH(const CInv& inv, vInv)
{
if (fShutdown)
return true;
@@ -2597,12 +1991,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
// Track requests for our stuff
- CRITICAL_BLOCK(cs_mapRequestCount)
- {
- map<uint256, int>::iterator mi = mapRequestCount.find(inv.hash);
- if (mi != mapRequestCount.end())
- (*mi).second++;
- }
+ Inventory(inv.hash);
}
}
@@ -2620,20 +2009,24 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (pindex)
pindex = pindex->pnext;
int nLimit = 500 + locator.GetDistanceBack();
+ unsigned int nBytes = 0;
printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,20).c_str(), nLimit);
for (; pindex; pindex = pindex->pnext)
{
if (pindex->GetBlockHash() == hashStop)
{
- printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str());
+ printf(" getblocks stopping at %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes);
break;
}
pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash()));
- if (--nLimit <= 0)
+ CBlock block;
+ block.ReadFromDisk(pindex, true);
+ nBytes += block.GetSerializeSize(SER_NETWORK);
+ if (--nLimit <= 0 || nBytes >= SendBufferSize()/2)
{
// When this block is requested, we'll send an inv that'll make them
// getblocks the next batch of inventory.
- printf(" getblocks stopping at limit %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str());
+ printf(" getblocks stopping at limit %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes);
pfrom->hashContinue = pindex->GetBlockHash();
break;
}
@@ -2690,7 +2083,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
bool fMissingInputs = false;
if (tx.AcceptToMemoryPool(true, &fMissingInputs))
{
- AddToWalletIfInvolvingMe(tx, NULL, true);
+ SyncWithWallets(tx, NULL, true);
RelayMessage(inv, vMsg);
mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash);
@@ -2711,7 +2104,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (tx.AcceptToMemoryPool(true))
{
printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
- AddToWalletIfInvolvingMe(tx, NULL, true);
+ SyncWithWallets(tx, NULL, true);
RelayMessage(inv, vMsg);
mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash);
@@ -2719,7 +2112,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
}
- foreach(uint256 hash, vWorkQueue)
+ BOOST_FOREACH(uint256 hash, vWorkQueue)
EraseOrphanTx(hash);
}
else if (fMissingInputs)
@@ -2754,13 +2147,13 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CRITICAL_BLOCK(cs_mapAddresses)
{
unsigned int nCount = 0;
- foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
+ BOOST_FOREACH(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
{
const CAddress& addr = item.second;
if (addr.nTime > nSince)
nCount++;
}
- foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
+ BOOST_FOREACH(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
{
const CAddress& addr = item.second;
if (addr.nTime > nSince && GetRand(nCount) < 2500)
@@ -2788,7 +2181,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Keep giving the same key to the same ip until they use it
if (!mapReuseKey.count(pfrom->addr.ip))
- mapReuseKey[pfrom->addr.ip] = GetKeyFromKeyPool();
+ mapReuseKey[pfrom->addr.ip] = pwalletMain->GetOrReuseKeyFromPool();
// Send back approval of order and pubkey to use
CScript scriptPubKey;
@@ -2797,37 +2190,6 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
- else if (strCommand == "submitorder")
- {
- uint256 hashReply;
- vRecv >> hashReply;
-
- if (!GetBoolArg("-allowreceivebyip"))
- {
- pfrom->PushMessage("reply", hashReply, (int)2);
- return true;
- }
-
- CWalletTx wtxNew;
- vRecv >> wtxNew;
- wtxNew.fFromMe = false;
-
- // Broadcast
- if (!wtxNew.AcceptWalletTransaction())
- {
- pfrom->PushMessage("reply", hashReply, (int)1);
- return error("submitorder AcceptWalletTransaction() failed, returning error 1");
- }
- wtxNew.fTimeReceivedIsTxTime = true;
- AddToWallet(wtxNew);
- wtxNew.RelayWalletTransaction();
- mapReuseKey.erase(pfrom->addr.ip);
-
- // Send back confirmation
- pfrom->PushMessage("reply", hashReply, (int)0);
- }
-
-
else if (strCommand == "reply")
{
uint256 hashReply;
@@ -2863,7 +2225,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Relay
pfrom->setKnown.insert(alert.GetHash());
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
alert.RelayTo(pnode);
}
}
@@ -2884,12 +2246,123 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
return true;
}
+bool ProcessMessages(CNode* pfrom)
+{
+ CDataStream& vRecv = pfrom->vRecv;
+ if (vRecv.empty())
+ return true;
+ //if (fDebug)
+ // printf("ProcessMessages(%u bytes)\n", vRecv.size());
+
+ //
+ // Message format
+ // (4) message start
+ // (12) command
+ // (4) size
+ // (4) checksum
+ // (x) data
+ //
+
+ loop
+ {
+ // Scan for message start
+ CDataStream::iterator pstart = search(vRecv.begin(), vRecv.end(), BEGIN(pchMessageStart), END(pchMessageStart));
+ int nHeaderSize = vRecv.GetSerializeSize(CMessageHeader());
+ if (vRecv.end() - pstart < nHeaderSize)
+ {
+ if (vRecv.size() > nHeaderSize)
+ {
+ printf("\n\nPROCESSMESSAGE MESSAGESTART NOT FOUND\n\n");
+ vRecv.erase(vRecv.begin(), vRecv.end() - nHeaderSize);
+ }
+ break;
+ }
+ if (pstart - vRecv.begin() > 0)
+ printf("\n\nPROCESSMESSAGE SKIPPED %d BYTES\n\n", pstart - vRecv.begin());
+ vRecv.erase(vRecv.begin(), pstart);
+
+ // Read header
+ vector<char> vHeaderSave(vRecv.begin(), vRecv.begin() + nHeaderSize);
+ CMessageHeader hdr;
+ vRecv >> hdr;
+ if (!hdr.IsValid())
+ {
+ printf("\n\nPROCESSMESSAGE: ERRORS IN HEADER %s\n\n\n", hdr.GetCommand().c_str());
+ continue;
+ }
+ string strCommand = hdr.GetCommand();
+ // Message size
+ unsigned int nMessageSize = hdr.nMessageSize;
+ if (nMessageSize > MAX_SIZE)
+ {
+ printf("ProcessMessage(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize);
+ continue;
+ }
+ if (nMessageSize > vRecv.size())
+ {
+ // Rewind and wait for rest of message
+ vRecv.insert(vRecv.begin(), vHeaderSave.begin(), vHeaderSave.end());
+ break;
+ }
+ // Checksum
+ if (vRecv.GetVersion() >= 209)
+ {
+ uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
+ unsigned int nChecksum = 0;
+ memcpy(&nChecksum, &hash, sizeof(nChecksum));
+ if (nChecksum != hdr.nChecksum)
+ {
+ printf("ProcessMessage(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",
+ strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);
+ continue;
+ }
+ }
+ // Copy message to its own buffer
+ CDataStream vMsg(vRecv.begin(), vRecv.begin() + nMessageSize, vRecv.nType, vRecv.nVersion);
+ vRecv.ignore(nMessageSize);
+ // Process message
+ bool fRet = false;
+ try
+ {
+ CRITICAL_BLOCK(cs_main)
+ fRet = ProcessMessage(pfrom, strCommand, vMsg);
+ if (fShutdown)
+ return true;
+ }
+ catch (std::ios_base::failure& e)
+ {
+ if (strstr(e.what(), "end of data"))
+ {
+ // Allow exceptions from underlength message on vRecv
+ printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what());
+ }
+ else if (strstr(e.what(), "size too large"))
+ {
+ // Allow exceptions from overlong size
+ printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what());
+ }
+ else
+ {
+ PrintExceptionContinue(&e, "ProcessMessage()");
+ }
+ }
+ catch (std::exception& e) {
+ PrintExceptionContinue(&e, "ProcessMessage()");
+ } catch (...) {
+ PrintExceptionContinue(NULL, "ProcessMessage()");
+ }
+ if (!fRet)
+ printf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
+ }
+ vRecv.Compact();
+ return true;
+}
bool SendMessages(CNode* pto, bool fSendTrickle)
@@ -2914,7 +2387,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
nLastRebroadcast = GetTime();
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
{
// Periodically clear setAddrKnown to allow refresh broadcasts
pnode->setAddrKnown.clear();
@@ -2966,7 +2439,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
{
vector<CAddress> vAddr;
vAddr.reserve(pto->vAddrToSend.size());
- foreach(const CAddress& addr, pto->vAddrToSend)
+ BOOST_FOREACH(const CAddress& addr, pto->vAddrToSend)
{
// returns true if wasn't already contained in the set
if (pto->setAddrKnown.insert(addr).second)
@@ -2995,7 +2468,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
{
vInv.reserve(pto->vInventoryToSend.size());
vInvWait.reserve(pto->vInventoryToSend.size());
- foreach(const CInv& inv, pto->vInventoryToSend)
+ BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)
{
if (pto->setInventoryKnown.count(inv))
continue;
@@ -3014,16 +2487,10 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// always trickle our own transactions
if (!fTrickleWait)
{
- TRY_CRITICAL_BLOCK(cs_mapWallet)
- {
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(inv.hash);
- if (mi != mapWallet.end())
- {
- CWalletTx& wtx = (*mi).second;
- if (wtx.fFromMe)
- fTrickleWait = true;
- }
- }
+ CWalletTx wtx;
+ if (GetTransaction(inv.hash, wtx))
+ if (wtx.fFromMe)
+ fTrickleWait = true;
}
if (fTrickleWait)
@@ -3069,6 +2536,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
vGetData.clear();
}
}
+ mapAlreadyAskedFor[inv] = nNow;
pto->mapAskFor.erase(pto->mapAskFor.begin());
}
if (!vGetData.empty())
@@ -3096,122 +2564,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// BitcoinMiner
//
-void GenerateBitcoins(bool fGenerate)
-{
- if (fGenerateBitcoins != fGenerate)
- {
- fGenerateBitcoins = fGenerate;
- CWalletDB().WriteSetting("fGenerateBitcoins", fGenerateBitcoins);
- MainFrameRepaint();
- }
- if (fGenerateBitcoins)
- {
- int nProcessors = boost::thread::hardware_concurrency();
- printf("%d processors\n", nProcessors);
- if (nProcessors < 1)
- nProcessors = 1;
- if (fLimitProcessors && nProcessors > nLimitProcessors)
- nProcessors = nLimitProcessors;
- int nAddThreads = nProcessors - vnThreadsRunning[3];
- printf("Starting %d BitcoinMiner threads\n", nAddThreads);
- for (int i = 0; i < nAddThreads; i++)
- {
- if (!CreateThread(ThreadBitcoinMiner, NULL))
- printf("Error: CreateThread(ThreadBitcoinMiner) failed\n");
- Sleep(10);
- }
- }
-}
-
-void ThreadBitcoinMiner(void* parg)
-{
- try
- {
- vnThreadsRunning[3]++;
- BitcoinMiner();
- vnThreadsRunning[3]--;
- }
- catch (std::exception& e) {
- vnThreadsRunning[3]--;
- PrintException(&e, "ThreadBitcoinMiner()");
- } catch (...) {
- vnThreadsRunning[3]--;
- PrintException(NULL, "ThreadBitcoinMiner()");
- }
- UIThreadCall(boost::bind(CalledSetStatusBar, "", 0));
- nHPSTimerStart = 0;
- if (vnThreadsRunning[3] == 0)
- dHashesPerSec = 0;
- printf("ThreadBitcoinMiner exiting, %d threads remaining\n", vnThreadsRunning[3]);
-}
-
-#if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE)
-void CallCPUID(int in, int& aret, int& cret)
-{
- int a, c;
- asm (
- "mov %2, %%eax; " // in into eax
- "cpuid;"
- "mov %%eax, %0;" // eax into a
- "mov %%ecx, %1;" // ecx into c
- :"=r"(a),"=r"(c) /* output */
- :"r"(in) /* input */
- :"%eax","%ebx","%ecx","%edx" /* clobbered register */
- );
- aret = a;
- cret = c;
-}
-
-bool Detect128BitSSE2()
-{
- int a, c, nBrand;
- CallCPUID(0, a, nBrand);
- bool fIntel = (nBrand == 0x6c65746e); // ntel
- bool fAMD = (nBrand == 0x444d4163); // cAMD
-
- struct
- {
- unsigned int nStepping : 4;
- unsigned int nModel : 4;
- unsigned int nFamily : 4;
- unsigned int nProcessorType : 2;
- unsigned int nUnused : 2;
- unsigned int nExtendedModel : 4;
- unsigned int nExtendedFamily : 8;
- }
- cpu;
- CallCPUID(1, a, c);
- memcpy(&cpu, &a, sizeof(cpu));
- int nFamily = cpu.nExtendedFamily + cpu.nFamily;
- int nModel = cpu.nExtendedModel*16 + cpu.nModel;
-
- // We need Intel Nehalem or AMD K10 or better for 128bit SSE2
- // Nehalem = i3/i5/i7 and some Xeon
- // K10 = Opterons with 4 or more cores, Phenom, Phenom II, Athlon II
- // Intel Core i5 family 6, model 26 or 30
- // Intel Core i7 family 6, model 26 or 30
- // Intel Core i3 family 6, model 37
- // AMD Phenom family 16, model 10
- bool fUseSSE2 = ((fIntel && nFamily * 10000 + nModel >= 60026) ||
- (fAMD && nFamily * 10000 + nModel >= 160010));
-
- // AMD reports a lower model number in 64-bit mode
- if (fAMD && sizeof(void*) > 4 && nFamily * 10000 + nModel >= 160000)
- fUseSSE2 = true;
-
- static bool fPrinted;
- if (!fPrinted)
- {
- fPrinted = true;
- printf("CPUID %08x family %d, model %d, stepping %d, fUseSSE2=%d\n", nBrand, nFamily, nModel, cpu.nStepping, fUseSSE2);
- }
- return fUseSSE2;
-}
-#else
-bool Detect128BitSSE2() { return false; }
-#endif
-
-int FormatHashBlocks(void* pbuffer, unsigned int len)
+int static FormatHashBlocks(void* pbuffer, unsigned int len)
{
unsigned char* pdata = (unsigned char*)pbuffer;
unsigned int blocks = 1 + ((len + 8) / 64);
@@ -3244,7 +2597,7 @@ inline void SHA256Transform(void* pstate, void* pinput, const void* pinit)
// between calls, but periodically or if nNonce is 0xffff0000 or above,
// the block is rebuilt and nNonce starts over at zero.
//
-unsigned int ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
+unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
{
unsigned int& nNonce = *(unsigned int*)(pdata + 12);
for (;;)
@@ -3270,9 +2623,6 @@ unsigned int ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char*
}
}
-extern unsigned int ScanHash_4WaySSE2(char* pmidstate, char* pblock, char* phash1, char* phash, unsigned int& nHashesDone);
-
-
class COrphan
{
@@ -3290,7 +2640,7 @@ public:
void print() const
{
printf("COrphan(hash=%s, dPriority=%.1f)\n", ptx->GetHash().ToString().substr(0,10).c_str(), dPriority);
- foreach(uint256 hash, setDependsOn)
+ BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str());
}
};
@@ -3334,7 +2684,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
COrphan* porphan = NULL;
double dPriority = 0;
- foreach(const CTxIn& txin, tx.vin)
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
CTransaction txPrev;
@@ -3401,7 +2751,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
// Transaction fee required depends on block size
bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
- int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree);
+ int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, true);
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency
@@ -3419,7 +2769,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
uint256 hash = tx.GetHash();
if (mapDependers.count(hash))
{
- foreach(COrphan* porphan, mapDependers[hash])
+ BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
{
if (!porphan->setDependsOn.empty())
{
@@ -3505,7 +2855,7 @@ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash
}
-bool CheckWork(CBlock* pblock, CReserveKey& reservekey)
+bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hash = pblock->GetHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
@@ -3530,8 +2880,8 @@ bool CheckWork(CBlock* pblock, CReserveKey& reservekey)
reservekey.KeepKey();
// Track how many getdata requests this block gets
- CRITICAL_BLOCK(cs_mapRequestCount)
- mapRequestCount[pblock->GetHash()] = 0;
+ CRITICAL_BLOCK(wallet.cs_mapRequestCount)
+ wallet.mapRequestCount[pblock->GetHash()] = 0;
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
@@ -3542,17 +2892,15 @@ bool CheckWork(CBlock* pblock, CReserveKey& reservekey)
return true;
}
+void static ThreadBitcoinMiner(void* parg);
-void BitcoinMiner()
+void static BitcoinMiner(CWallet *pwallet)
{
printf("BitcoinMiner started\n");
SetThreadPriority(THREAD_PRIORITY_LOWEST);
- bool f4WaySSE2 = Detect128BitSSE2();
- if (mapArgs.count("-4way"))
- f4WaySSE2 = GetBoolArg("-4way");
// Each thread has its own key and counter
- CReserveKey reservekey;
+ CReserveKey reservekey(pwallet);
unsigned int nExtraNonce = 0;
int64 nPrevTime = 0;
@@ -3611,14 +2959,9 @@ void BitcoinMiner()
unsigned int nHashesDone = 0;
unsigned int nNonceFound;
-#ifdef FOURWAYSSE2
- if (f4WaySSE2)
- // tcatm's 4-way 128-bit SSE2 SHA-256
- nNonceFound = ScanHash_4WaySSE2(pmidstate, pdata + 64, phash1, (char*)&hash, nHashesDone);
- else
-#endif
- // Crypto++ SHA-256
- nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1, (char*)&hash, nHashesDone);
+ // Crypto++ SHA-256
+ nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1,
+ (char*)&hash, nHashesDone);
// Check if something found
if (nNonceFound != -1)
@@ -3633,7 +2976,7 @@ void BitcoinMiner()
assert(hash == pblock->GetHash());
SetThreadPriority(THREAD_PRIORITY_NORMAL);
- CheckWork(pblock.get(), reservekey);
+ CheckWork(pblock.get(), *pwalletMain, reservekey);
SetThreadPriority(THREAD_PRIORITY_LOWEST);
break;
}
@@ -3694,412 +3037,53 @@ void BitcoinMiner()
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Actions
-//
-
-
-int64 GetBalance()
-{
- int64 nStart = GetTimeMillis();
-
- int64 nTotal = 0;
- CRITICAL_BLOCK(cs_mapWallet)
- {
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
- {
- CWalletTx* pcoin = &(*it).second;
- if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
- continue;
- nTotal += pcoin->GetAvailableCredit();
- }
- }
-
- //printf("GetBalance() %"PRI64d"ms\n", GetTimeMillis() - nStart);
- return nTotal;
-}
-
-
-bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, set<pair<CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet)
+void static ThreadBitcoinMiner(void* parg)
{
- setCoinsRet.clear();
- nValueRet = 0;
-
- // List of values less than target
- pair<int64, pair<CWalletTx*,unsigned int> > coinLowestLarger;
- coinLowestLarger.first = INT64_MAX;
- coinLowestLarger.second.first = NULL;
- vector<pair<int64, pair<CWalletTx*,unsigned int> > > vValue;
- int64 nTotalLower = 0;
-
- CRITICAL_BLOCK(cs_mapWallet)
- {
- vector<CWalletTx*> vCoins;
- vCoins.reserve(mapWallet.size());
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
- vCoins.push_back(&(*it).second);
- random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
-
- foreach(CWalletTx* pcoin, vCoins)
- {
- if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
- continue;
-
- if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
- continue;
-
- int nDepth = pcoin->GetDepthInMainChain();
- if (nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
- continue;
-
- for (int i = 0; i < pcoin->vout.size(); i++)
- {
- if (pcoin->IsSpent(i) || !pcoin->vout[i].IsMine())
- continue;
-
- int64 n = pcoin->vout[i].nValue;
-
- if (n <= 0)
- continue;
-
- pair<int64,pair<CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin,i));
-
- if (n == nTargetValue)
- {
- setCoinsRet.insert(coin.second);
- nValueRet += coin.first;
- return true;
- }
- else if (n < nTargetValue + CENT)
- {
- vValue.push_back(coin);
- nTotalLower += n;
- }
- else if (n < coinLowestLarger.first)
- {
- coinLowestLarger = coin;
- }
- }
- }
- }
-
- if (nTotalLower == nTargetValue || nTotalLower == nTargetValue + CENT)
- {
- for (int i = 0; i < vValue.size(); ++i)
- {
- setCoinsRet.insert(vValue[i].second);
- nValueRet += vValue[i].first;
- }
- return true;
- }
-
- if (nTotalLower < nTargetValue + (coinLowestLarger.second.first ? CENT : 0))
- {
- if (coinLowestLarger.second.first == NULL)
- return false;
- setCoinsRet.insert(coinLowestLarger.second);
- nValueRet += coinLowestLarger.first;
- return true;
- }
-
- if (nTotalLower >= nTargetValue + CENT)
- nTargetValue += CENT;
-
- // Solve subset sum by stochastic approximation
- sort(vValue.rbegin(), vValue.rend());
- vector<char> vfIncluded;
- vector<char> vfBest(vValue.size(), true);
- int64 nBest = nTotalLower;
-
- for (int nRep = 0; nRep < 1000 && nBest != nTargetValue; nRep++)
- {
- vfIncluded.assign(vValue.size(), false);
- int64 nTotal = 0;
- bool fReachedTarget = false;
- for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++)
- {
- for (int i = 0; i < vValue.size(); i++)
- {
- if (nPass == 0 ? rand() % 2 : !vfIncluded[i])
- {
- nTotal += vValue[i].first;
- vfIncluded[i] = true;
- if (nTotal >= nTargetValue)
- {
- fReachedTarget = true;
- if (nTotal < nBest)
- {
- nBest = nTotal;
- vfBest = vfIncluded;
- }
- nTotal -= vValue[i].first;
- vfIncluded[i] = false;
- }
- }
- }
- }
- }
-
- // If the next larger is still closer, return it
- if (coinLowestLarger.second.first && coinLowestLarger.first - nTargetValue <= nBest - nTargetValue)
+ CWallet* pwallet = (CWallet*)parg;
+ try
{
- setCoinsRet.insert(coinLowestLarger.second);
- nValueRet += coinLowestLarger.first;
+ vnThreadsRunning[3]++;
+ BitcoinMiner(pwallet);
+ vnThreadsRunning[3]--;
}
- else {
- for (int i = 0; i < vValue.size(); i++)
- if (vfBest[i])
- {
- setCoinsRet.insert(vValue[i].second);
- nValueRet += vValue[i].first;
- }
-
- //// debug print
- printf("SelectCoins() best subset: ");
- for (int i = 0; i < vValue.size(); i++)
- if (vfBest[i])
- printf("%s ", FormatMoney(vValue[i].first).c_str());
- printf("total %s\n", FormatMoney(nBest).c_str());
+ catch (std::exception& e) {
+ vnThreadsRunning[3]--;
+ PrintException(&e, "ThreadBitcoinMiner()");
+ } catch (...) {
+ vnThreadsRunning[3]--;
+ PrintException(NULL, "ThreadBitcoinMiner()");
}
-
- return true;
-}
-
-bool SelectCoins(int64 nTargetValue, set<pair<CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet)
-{
- return (SelectCoinsMinConf(nTargetValue, 1, 6, setCoinsRet, nValueRet) ||
- SelectCoinsMinConf(nTargetValue, 1, 1, setCoinsRet, nValueRet) ||
- SelectCoinsMinConf(nTargetValue, 0, 1, setCoinsRet, nValueRet));
+ UIThreadCall(boost::bind(CalledSetStatusBar, "", 0));
+ nHPSTimerStart = 0;
+ if (vnThreadsRunning[3] == 0)
+ dHashesPerSec = 0;
+ printf("ThreadBitcoinMiner exiting, %d threads remaining\n", vnThreadsRunning[3]);
}
-
-
-bool CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
+void GenerateBitcoins(bool fGenerate, CWallet* pwallet)
{
- int64 nValue = 0;
- foreach (const PAIRTYPE(CScript, int64)& s, vecSend)
- {
- if (nValue < 0)
- return false;
- nValue += s.second;
- }
- if (vecSend.empty() || nValue < 0)
- return false;
-
- CRITICAL_BLOCK(cs_main)
+ if (fGenerateBitcoins != fGenerate)
{
- // txdb must be opened before the mapWallet lock
- CTxDB txdb("r");
- CRITICAL_BLOCK(cs_mapWallet)
- {
- nFeeRet = nTransactionFee;
- loop
- {
- wtxNew.vin.clear();
- wtxNew.vout.clear();
- wtxNew.fFromMe = true;
-
- int64 nTotalValue = nValue + nFeeRet;
- double dPriority = 0;
- // vouts to the payees
- foreach (const PAIRTYPE(CScript, int64)& s, vecSend)
- wtxNew.vout.push_back(CTxOut(s.second, s.first));
-
- // Choose coins to use
- set<pair<CWalletTx*,unsigned int> > setCoins;
- int64 nValueIn = 0;
- if (!SelectCoins(nTotalValue, setCoins, nValueIn))
- return false;
- foreach(PAIRTYPE(CWalletTx*, unsigned int) pcoin, setCoins)
- {
- int64 nCredit = pcoin.first->vout[pcoin.second].nValue;
- dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain();
- }
-
- // Fill a vout back to self with any change
- int64 nChange = nValueIn - nTotalValue;
- if (nChange >= CENT)
- {
- // Note: We use a new key here to keep it from being obvious which side is the change.
- // The drawback is that by not reusing a previous key, the change may be lost if a
- // backup is restored, if the backup doesn't have the new private key for the change.
- // If we reused the old key, it would be possible to add code to look for and
- // rediscover unknown transactions that were written with keys of ours to recover
- // post-backup change.
-
- // Reserve a new key pair from key pool
- vector<unsigned char> vchPubKey = reservekey.GetReservedKey();
- assert(mapKeys.count(vchPubKey));
-
- // Fill a vout to ourself, using same address type as the payment
- CScript scriptChange;
- if (vecSend[0].first.GetBitcoinAddressHash160() != 0)
- scriptChange.SetBitcoinAddress(vchPubKey);
- else
- scriptChange << vchPubKey << OP_CHECKSIG;
-
- // Insert change txn at random position:
- vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());
- wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
- }
- else
- reservekey.ReturnKey();
-
- // Fill vin
- foreach(const PAIRTYPE(CWalletTx*,unsigned int)& coin, setCoins)
- wtxNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second));
-
- // Sign
- int nIn = 0;
- foreach(const PAIRTYPE(CWalletTx*,unsigned int)& coin, setCoins)
- if (!SignSignature(*coin.first, wtxNew, nIn++))
- return false;
-
- // Limit size
- unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK);
- if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
- return false;
- dPriority /= nBytes;
-
- // Check that enough fee is included
- int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000);
- bool fAllowFree = CTransaction::AllowFree(dPriority);
- int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree);
- if (nFeeRet < max(nPayFee, nMinFee))
- {
- nFeeRet = max(nPayFee, nMinFee);
- continue;
- }
-
- // Fill vtxPrev by copying from previous transactions vtxPrev
- wtxNew.AddSupportingTransactions(txdb);
- wtxNew.fTimeReceivedIsTxTime = true;
-
- break;
- }
- }
+ fGenerateBitcoins = fGenerate;
+ WriteSetting("fGenerateBitcoins", fGenerateBitcoins);
+ MainFrameRepaint();
}
- return true;
-}
-
-bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
-{
- vector< pair<CScript, int64> > vecSend;
- vecSend.push_back(make_pair(scriptPubKey, nValue));
- return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet);
-}
-
-// Call after CreateTransaction unless you want to abort
-bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
-{
- CRITICAL_BLOCK(cs_main)
+ if (fGenerateBitcoins)
{
- printf("CommitTransaction:\n%s", wtxNew.ToString().c_str());
- CRITICAL_BLOCK(cs_mapWallet)
- {
- // This is only to keep the database open to defeat the auto-flush for the
- // duration of this scope. This is the only place where this optimization
- // maybe makes sense; please don't do it anywhere else.
- CWalletDB walletdb("r");
-
- // Take key pair from key pool so it won't be used again
- reservekey.KeepKey();
-
- // Add tx to wallet, because if it has change it's also ours,
- // otherwise just for transaction history.
- AddToWallet(wtxNew);
-
- // Mark old coins as spent
- set<CWalletTx*> setCoins;
- foreach(const CTxIn& txin, wtxNew.vin)
- {
- CWalletTx &pcoin = mapWallet[txin.prevout.hash];
- pcoin.MarkSpent(txin.prevout.n);
- pcoin.WriteToDisk();
- vWalletUpdated.push_back(pcoin.GetHash());
- }
- }
-
- // Track how many getdata requests our transaction gets
- CRITICAL_BLOCK(cs_mapRequestCount)
- mapRequestCount[wtxNew.GetHash()] = 0;
-
- // Broadcast
- if (!wtxNew.AcceptToMemoryPool())
+ int nProcessors = boost::thread::hardware_concurrency();
+ printf("%d processors\n", nProcessors);
+ if (nProcessors < 1)
+ nProcessors = 1;
+ if (fLimitProcessors && nProcessors > nLimitProcessors)
+ nProcessors = nLimitProcessors;
+ int nAddThreads = nProcessors - vnThreadsRunning[3];
+ printf("Starting %d BitcoinMiner threads\n", nAddThreads);
+ for (int i = 0; i < nAddThreads; i++)
{
- // This must not fail. The transaction has already been signed and recorded.
- printf("CommitTransaction() : Error: Transaction not valid");
- return false;
+ if (!CreateThread(ThreadBitcoinMiner, pwallet))
+ printf("Error: CreateThread(ThreadBitcoinMiner) failed\n");
+ Sleep(10);
}
- wtxNew.RelayWalletTransaction();
- }
- MainFrameRepaint();
- return true;
-}
-
-
-
-
-// requires cs_main lock
-string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
-{
- CReserveKey reservekey;
- int64 nFeeRequired;
- if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired))
- {
- string strError;
- if (nValue + nFeeRequired > GetBalance())
- strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "), FormatMoney(nFeeRequired).c_str());
- else
- strError = _("Error: Transaction creation failed ");
- printf("SendMoney() : %s", strError.c_str());
- return strError;
}
-
- if (fAskFee && !ThreadSafeAskFee(nFeeRequired, _("Sending..."), NULL))
- return "ABORTED";
-
- if (!CommitTransaction(wtxNew, reservekey))
- return _("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.");
-
- MainFrameRepaint();
- return "";
-}
-
-
-
-// requires cs_main lock
-string SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
-{
- // Check amount
- if (nValue <= 0)
- return _("Invalid amount");
- if (nValue + nTransactionFee > GetBalance())
- return _("Insufficient funds");
-
- // Parse bitcoin address
- CScript scriptPubKey;
- if (!scriptPubKey.SetBitcoinAddress(strAddress))
- return _("Invalid bitcoin address");
-
- return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee);
}
diff --git a/main.h b/src/main.h
index 355ef5313f..97a40d3ec9 100644
--- a/main.h
+++ b/src/main.h
@@ -1,27 +1,45 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_MAIN_H
+#define BITCOIN_MAIN_H
+
+#include "bignum.h"
+#include "net.h"
+#include "key.h"
+#include "script.h"
+#include "db.h"
+
+#include <list>
-class COutPoint;
-class CInPoint;
-class CDiskTxPos;
-class CCoinBase;
-class CTxIn;
-class CTxOut;
-class CTransaction;
class CBlock;
class CBlockIndex;
class CWalletTx;
+class CWallet;
class CKeyItem;
+class CReserveKey;
+class CWalletDB;
+
+class CMessageHeader;
+class CAddress;
+class CInv;
+class CRequestTracker;
+class CNode;
+class CBlockIndex;
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
static const int64 COIN = 100000000;
static const int64 CENT = 1000000;
+static const int64 MIN_TX_FEE = 50000;
+static const int64 MIN_RELAY_TX_FEE = 10000;
static const int64 MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
static const int COINBASE_MATURITY = 100;
+// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
+static const int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
#ifdef USE_UPNP
static const int fHaveUPnP = true;
#else
@@ -34,7 +52,7 @@ static const int fHaveUPnP = false;
extern CCriticalSection cs_main;
-extern map<uint256, CBlockIndex*> mapBlockIndex;
+extern std::map<uint256, CBlockIndex*> mapBlockIndex;
extern uint256 hashGenesisBlock;
extern CBigNum bnProofOfWorkLimit;
extern CBlockIndex* pindexGenesisBlock;
@@ -44,18 +62,15 @@ extern CBigNum bnBestInvalidWork;
extern uint256 hashBestChain;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
-extern map<uint256, int> mapRequestCount;
-extern CCriticalSection cs_mapRequestCount;
-extern map<string, string> mapAddressBook;
-extern CCriticalSection cs_mapAddressBook;
-extern vector<unsigned char> vchDefaultKey;
extern double dHashesPerSec;
extern int64 nHPSTimerStart;
+extern int64 nTimeBestReceived;
+extern CCriticalSection cs_setpwalletRegistered;
+extern std::set<CWallet*> setpwalletRegistered;
// Settings
extern int fGenerateBitcoins;
extern int64 nTransactionFee;
-extern CAddress addrIncoming;
extern int fLimitProcessors;
extern int nLimitProcessors;
extern int fMinimizeToTray;
@@ -66,39 +81,28 @@ extern int fUseUPnP;
+class CReserveKey;
+class CTxDB;
+class CTxIndex;
-
+void RegisterWallet(CWallet* pwalletIn);
+void UnregisterWallet(CWallet* pwalletIn);
bool CheckDiskSpace(uint64 nAdditionalBytes=0);
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);
-bool AddKey(const CKey& key);
-vector<unsigned char> GenerateNewKey();
-bool AddToWallet(const CWalletTx& wtxIn);
-void WalletUpdateSpent(const COutPoint& prevout);
-int ScanForWalletTransactions(CBlockIndex* pindexStart);
-void ReacceptWalletTransactions();
bool LoadBlockIndex(bool fAllowNew=true);
void PrintBlockTree();
bool ProcessMessages(CNode* pfrom);
-bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv);
bool SendMessages(CNode* pto, bool fSendTrickle);
-int64 GetBalance();
-bool CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
-bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
-bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
-bool BroadcastTransaction(CWalletTx& wtxNew);
-string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
-string SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
-void GenerateBitcoins(bool fGenerate);
-void ThreadBitcoinMiner(void* parg);
+void GenerateBitcoins(bool fGenerate, CWallet* pwallet);
CBlock* CreateNewBlock(CReserveKey& reservekey);
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce, int64& nPrevTime);
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
-bool CheckWork(CBlock* pblock, CReserveKey& reservekey);
-void BitcoinMiner();
+bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
+int GetTotalBlocksEstimate();
bool IsInitialBlockDownload();
-string GetWarnings(string strFor);
+std::string GetWarnings(std::string strFor);
@@ -111,6 +115,23 @@ string GetWarnings(string strFor);
+bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
+
+template<typename T>
+bool WriteSetting(const std::string& strKey, const T& value)
+{
+ bool fOk = false;
+ BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
+ {
+ std::string strWalletFile;
+ if (!GetWalletFile(pwallet, strWalletFile))
+ continue;
+ fOk |= CWalletDB(strWalletFile).WriteSetting(strKey, value);
+ }
+ return fOk;
+}
+
+
class CDiskTxPos
{
public:
@@ -146,7 +167,7 @@ public:
return !(a == b);
}
- string ToString() const
+ std::string ToString() const
{
if (IsNull())
return strprintf("null");
@@ -205,7 +226,7 @@ public:
return !(a == b);
}
- string ToString() const
+ std::string ToString() const
{
return strprintf("COutPoint(%s, %d)", hash.ToString().substr(0,10).c_str(), n);
}
@@ -274,9 +295,9 @@ public:
return !(a == b);
}
- string ToString() const
+ std::string ToString() const
{
- string str;
+ std::string str;
str += strprintf("CTxIn(");
str += prevout.ToString();
if (prevout.IsNull())
@@ -293,9 +314,6 @@ public:
{
printf("%s\n", ToString().c_str());
}
-
- bool IsMine() const;
- int64 GetDebit() const;
};
@@ -344,36 +362,6 @@ public:
return SerializeHash(*this);
}
- bool IsMine() const
- {
- return ::IsMine(scriptPubKey);
- }
-
- int64 GetCredit() const
- {
- if (!MoneyRange(nValue))
- throw runtime_error("CTxOut::GetCredit() : value out of range");
- return (IsMine() ? nValue : 0);
- }
-
- bool IsChange() const
- {
- // On a debit transaction, a txout that's mine but isn't in the address book is change
- vector<unsigned char> vchPubKey;
- if (ExtractPubKey(scriptPubKey, true, vchPubKey))
- CRITICAL_BLOCK(cs_mapAddressBook)
- if (!mapAddressBook.count(PubKeyToAddress(vchPubKey)))
- return true;
- return false;
- }
-
- int64 GetChange() const
- {
- if (!MoneyRange(nValue))
- throw runtime_error("CTxOut::GetChange() : value out of range");
- return (IsChange() ? nValue : 0);
- }
-
friend bool operator==(const CTxOut& a, const CTxOut& b)
{
return (a.nValue == b.nValue &&
@@ -385,7 +373,7 @@ public:
return !(a == b);
}
- string ToString() const
+ std::string ToString() const
{
if (scriptPubKey.size() < 6)
return "CTxOut(error)";
@@ -409,8 +397,8 @@ class CTransaction
{
public:
int nVersion;
- vector<CTxIn> vin;
- vector<CTxOut> vout;
+ std::vector<CTxIn> vin;
+ std::vector<CTxOut> vout;
unsigned int nLockTime;
@@ -455,9 +443,9 @@ public:
nBlockHeight = nBestHeight;
if (nBlockTime == 0)
nBlockTime = GetAdjustedTime();
- if ((int64)nLockTime < (nLockTime < 500000000 ? (int64)nBlockHeight : nBlockTime))
+ if ((int64)nLockTime < (nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime))
return true;
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
if (!txin.IsFinal())
return false;
return true;
@@ -500,83 +488,32 @@ public:
int GetSigOpCount() const
{
int n = 0;
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
n += txin.scriptSig.GetSigOpCount();
- foreach(const CTxOut& txout, vout)
+ BOOST_FOREACH(const CTxOut& txout, vout)
n += txout.scriptPubKey.GetSigOpCount();
return n;
}
bool IsStandard() const
{
- foreach(const CTxIn& txin, vin)
+ BOOST_FOREACH(const CTxIn& txin, vin)
if (!txin.scriptSig.IsPushOnly())
return error("nonstandard txin: %s", txin.scriptSig.ToString().c_str());
- foreach(const CTxOut& txout, vout)
+ BOOST_FOREACH(const CTxOut& txout, vout)
if (!::IsStandard(txout.scriptPubKey))
return error("nonstandard txout: %s", txout.scriptPubKey.ToString().c_str());
return true;
}
- bool IsMine() const
- {
- foreach(const CTxOut& txout, vout)
- if (txout.IsMine())
- return true;
- return false;
- }
-
- bool IsFromMe() const
- {
- return (GetDebit() > 0);
- }
-
- int64 GetDebit() const
- {
- int64 nDebit = 0;
- foreach(const CTxIn& txin, vin)
- {
- nDebit += txin.GetDebit();
- if (!MoneyRange(nDebit))
- throw runtime_error("CTransaction::GetDebit() : value out of range");
- }
- return nDebit;
- }
-
- int64 GetCredit() const
- {
- int64 nCredit = 0;
- foreach(const CTxOut& txout, vout)
- {
- nCredit += txout.GetCredit();
- if (!MoneyRange(nCredit))
- throw runtime_error("CTransaction::GetCredit() : value out of range");
- }
- return nCredit;
- }
-
- int64 GetChange() const
- {
- if (IsCoinBase())
- return 0;
- int64 nChange = 0;
- foreach(const CTxOut& txout, vout)
- {
- nChange += txout.GetChange();
- if (!MoneyRange(nChange))
- throw runtime_error("CTransaction::GetChange() : value out of range");
- }
- return nChange;
- }
-
int64 GetValueOut() const
{
int64 nValueOut = 0;
- foreach(const CTxOut& txout, vout)
+ BOOST_FOREACH(const CTxOut& txout, vout)
{
nValueOut += txout.nValue;
if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
- throw runtime_error("CTransaction::GetValueOut() : value out of range");
+ throw std::runtime_error("CTransaction::GetValueOut() : value out of range");
}
return nValueOut;
}
@@ -588,12 +525,14 @@ public:
return dPriority > COIN * 144 / 250;
}
- int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true) const
+ int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true, bool fForRelay=false) const
{
- // Base fee is 1 cent per kilobyte
+ // Base fee is either MIN_TX_FEE or MIN_RELAY_TX_FEE
+ int64 nBaseFee = fForRelay ? MIN_RELAY_TX_FEE : MIN_TX_FEE;
+
unsigned int nBytes = ::GetSerializeSize(*this, SER_NETWORK);
unsigned int nNewBlockSize = nBlockSize + nBytes;
- int64 nMinFee = (1 + (int64)nBytes / 1000) * CENT;
+ int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;
if (fAllowFree)
{
@@ -612,11 +551,11 @@ public:
}
}
- // To limit dust spam, require a 0.01 fee if any output is less than 0.01
- if (nMinFee < CENT)
- foreach(const CTxOut& txout, vout)
+ // To limit dust spam, require MIN_TX_FEE/MIN_RELAY_TX_FEE if any output is less than 0.01
+ if (nMinFee < nBaseFee)
+ BOOST_FOREACH(const CTxOut& txout, vout)
if (txout.nValue < CENT)
- nMinFee = CENT;
+ nMinFee = nBaseFee;
// Raise the price as the block approaches full
if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)
@@ -667,9 +606,9 @@ public:
}
- string ToString() const
+ std::string ToString() const
{
- string str;
+ std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%d, vout.size=%d, nLockTime=%d)\n",
GetHash().ToString().substr(0,10).c_str(),
nVersion,
@@ -693,16 +632,12 @@ public:
bool ReadFromDisk(CTxDB& txdb, COutPoint prevout);
bool ReadFromDisk(COutPoint prevout);
bool DisconnectInputs(CTxDB& txdb);
- bool ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
+ bool ConnectInputs(CTxDB& txdb, std::map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee=0);
bool ClientConnectInputs();
bool CheckTransaction() const;
bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);
- bool AcceptToMemoryPool(bool fCheckInputs=true, bool* pfMissingInputs=NULL)
- {
- CTxDB txdb("r");
- return AcceptToMemoryPool(txdb, fCheckInputs, pfMissingInputs);
- }
+ bool AcceptToMemoryPool(bool fCheckInputs=true, bool* pfMissingInputs=NULL);
protected:
bool AddToMemoryPoolUnchecked();
public:
@@ -720,7 +655,7 @@ class CMerkleTx : public CTransaction
{
public:
uint256 hashBlock;
- vector<uint256> vMerkleBranch;
+ std::vector<uint256> vMerkleBranch;
int nIndex;
// memory only
@@ -761,307 +696,7 @@ public:
bool IsInMainChain() const { return GetDepthInMainChain() > 0; }
int GetBlocksToMaturity() const;
bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true);
- bool AcceptToMemoryPool() { CTxDB txdb("r"); return AcceptToMemoryPool(txdb); }
-};
-
-
-
-
-//
-// A transaction with a bunch of additional info that only the owner cares
-// about. It includes any unrecorded transactions needed to link it back
-// to the block chain.
-//
-class CWalletTx : public CMerkleTx
-{
-public:
- vector<CMerkleTx> vtxPrev;
- map<string, string> mapValue;
- vector<pair<string, string> > vOrderForm;
- unsigned int fTimeReceivedIsTxTime;
- unsigned int nTimeReceived; // time received by this node
- char fFromMe;
- string strFromAccount;
- vector<char> vfSpent;
-
- // memory only
- mutable char fDebitCached;
- mutable char fCreditCached;
- mutable char fAvailableCreditCached;
- mutable char fChangeCached;
- mutable int64 nDebitCached;
- mutable int64 nCreditCached;
- mutable int64 nAvailableCreditCached;
- mutable int64 nChangeCached;
-
- // memory only UI hints
- mutable unsigned int nTimeDisplayed;
- mutable int nLinesDisplayed;
- mutable char fConfirmedDisplayed;
-
-
- CWalletTx()
- {
- Init();
- }
-
- CWalletTx(const CMerkleTx& txIn) : CMerkleTx(txIn)
- {
- Init();
- }
-
- CWalletTx(const CTransaction& txIn) : CMerkleTx(txIn)
- {
- Init();
- }
-
- void Init()
- {
- vtxPrev.clear();
- mapValue.clear();
- vOrderForm.clear();
- fTimeReceivedIsTxTime = false;
- nTimeReceived = 0;
- fFromMe = false;
- strFromAccount.clear();
- vfSpent.clear();
- fDebitCached = false;
- fCreditCached = false;
- fAvailableCreditCached = false;
- fChangeCached = false;
- nDebitCached = 0;
- nCreditCached = 0;
- nAvailableCreditCached = 0;
- nChangeCached = 0;
- nTimeDisplayed = 0;
- nLinesDisplayed = 0;
- fConfirmedDisplayed = false;
- }
-
- IMPLEMENT_SERIALIZE
- (
- CWalletTx* pthis = const_cast<CWalletTx*>(this);
- if (fRead)
- pthis->Init();
- char fSpent = false;
-
- if (!fRead)
- {
- pthis->mapValue["fromaccount"] = pthis->strFromAccount;
-
- string str;
- foreach(char f, vfSpent)
- {
- str += (f ? '1' : '0');
- if (f)
- fSpent = true;
- }
- pthis->mapValue["spent"] = str;
- }
-
- nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action);
- READWRITE(vtxPrev);
- READWRITE(mapValue);
- READWRITE(vOrderForm);
- READWRITE(fTimeReceivedIsTxTime);
- READWRITE(nTimeReceived);
- READWRITE(fFromMe);
- READWRITE(fSpent);
-
- if (fRead)
- {
- pthis->strFromAccount = pthis->mapValue["fromaccount"];
-
- if (mapValue.count("spent"))
- foreach(char c, pthis->mapValue["spent"])
- pthis->vfSpent.push_back(c != '0');
- else
- pthis->vfSpent.assign(vout.size(), fSpent);
- }
-
- pthis->mapValue.erase("fromaccount");
- pthis->mapValue.erase("version");
- pthis->mapValue.erase("spent");
- )
-
- // marks certain txout's as spent
- // returns true if any update took place
- bool UpdateSpent(const vector<char>& vfNewSpent)
- {
- bool fReturn = false;
- for (int i=0; i < vfNewSpent.size(); i++)
- {
- if (i == vfSpent.size())
- break;
-
- if (vfNewSpent[i] && !vfSpent[i])
- {
- vfSpent[i] = true;
- fReturn = true;
- fAvailableCreditCached = false;
- }
- }
- return fReturn;
- }
-
- void MarkDirty()
- {
- fCreditCached = false;
- fAvailableCreditCached = false;
- fDebitCached = false;
- fChangeCached = false;
- }
-
- void MarkSpent(unsigned int nOut)
- {
- if (nOut >= vout.size())
- throw runtime_error("CWalletTx::MarkSpent() : nOut out of range");
- vfSpent.resize(vout.size());
- if (!vfSpent[nOut])
- {
- vfSpent[nOut] = true;
- fAvailableCreditCached = false;
- }
- }
-
- bool IsSpent(unsigned int nOut) const
- {
- if (nOut >= vout.size())
- throw runtime_error("CWalletTx::IsSpent() : nOut out of range");
- if (nOut >= vfSpent.size())
- return false;
- return (!!vfSpent[nOut]);
- }
-
- int64 GetDebit() const
- {
- if (vin.empty())
- return 0;
- if (fDebitCached)
- return nDebitCached;
- nDebitCached = CTransaction::GetDebit();
- fDebitCached = true;
- return nDebitCached;
- }
-
- int64 GetCredit(bool fUseCache=true) const
- {
- // Must wait until coinbase is safely deep enough in the chain before valuing it
- if (IsCoinBase() && GetBlocksToMaturity() > 0)
- return 0;
-
- // GetBalance can assume transactions in mapWallet won't change
- if (fUseCache && fCreditCached)
- return nCreditCached;
- nCreditCached = CTransaction::GetCredit();
- fCreditCached = true;
- return nCreditCached;
- }
-
- int64 GetAvailableCredit(bool fUseCache=true) const
- {
- // Must wait until coinbase is safely deep enough in the chain before valuing it
- if (IsCoinBase() && GetBlocksToMaturity() > 0)
- return 0;
-
- if (fUseCache && fAvailableCreditCached)
- return nAvailableCreditCached;
-
- int64 nCredit = 0;
- for (int i = 0; i < vout.size(); i++)
- {
- if (!IsSpent(i))
- {
- const CTxOut &txout = vout[i];
- nCredit += txout.GetCredit();
- if (!MoneyRange(nCredit))
- throw runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
- }
- }
-
- nAvailableCreditCached = nCredit;
- fAvailableCreditCached = true;
- return nCredit;
- }
-
-
- int64 GetChange() const
- {
- if (fChangeCached)
- return nChangeCached;
- nChangeCached = CTransaction::GetChange();
- fChangeCached = true;
- return nChangeCached;
- }
-
- void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<string /* address */, int64> >& listReceived,
- list<pair<string /* address */, int64> >& listSent, int64& nFee, string& strSentAccount) const;
-
- void GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
- int64& nSent, int64& nFee) const;
-
- bool IsFromMe() const
- {
- return (GetDebit() > 0);
- }
-
- bool IsConfirmed() const
- {
- // Quick answer in most cases
- if (!IsFinal())
- return false;
- if (GetDepthInMainChain() >= 1)
- return true;
- if (!IsFromMe()) // using wtx's cached debit
- return false;
-
- // If no confirmations but it's from us, we can still
- // consider it confirmed if all dependencies are confirmed
- map<uint256, const CMerkleTx*> mapPrev;
- vector<const CMerkleTx*> vWorkQueue;
- vWorkQueue.reserve(vtxPrev.size()+1);
- vWorkQueue.push_back(this);
- for (int i = 0; i < vWorkQueue.size(); i++)
- {
- const CMerkleTx* ptx = vWorkQueue[i];
-
- if (!ptx->IsFinal())
- return false;
- if (ptx->GetDepthInMainChain() >= 1)
- return true;
- if (!ptx->IsFromMe())
- return false;
-
- if (mapPrev.empty())
- foreach(const CMerkleTx& tx, vtxPrev)
- mapPrev[tx.GetHash()] = &tx;
-
- foreach(const CTxIn& txin, ptx->vin)
- {
- if (!mapPrev.count(txin.prevout.hash))
- return false;
- vWorkQueue.push_back(mapPrev[txin.prevout.hash]);
- }
- }
- return true;
- }
-
- bool WriteToDisk()
- {
- return CWalletDB().WriteTx(GetHash(), *this);
- }
-
-
- int64 GetTxTime() const;
- int GetRequestCount() const;
-
- void AddSupportingTransactions(CTxDB& txdb);
-
- bool AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs=true);
- bool AcceptWalletTransaction() { CTxDB txdb("r"); return AcceptWalletTransaction(txdb); }
-
- void RelayWalletTransaction(CTxDB& txdb);
- void RelayWalletTransaction() { CTxDB txdb("r"); RelayWalletTransaction(txdb); }
+ bool AcceptToMemoryPool();
};
@@ -1076,7 +711,7 @@ class CTxIndex
{
public:
CDiskTxPos pos;
- vector<CDiskTxPos> vSpent;
+ std::vector<CDiskTxPos> vSpent;
CTxIndex()
{
@@ -1148,10 +783,10 @@ public:
unsigned int nNonce;
// network and disk
- vector<CTransaction> vtx;
+ std::vector<CTransaction> vtx;
// memory only
- mutable vector<uint256> vMerkleTree;
+ mutable std::vector<uint256> vMerkleTree;
CBlock()
@@ -1206,7 +841,7 @@ public:
int GetSigOpCount() const
{
int n = 0;
- foreach(const CTransaction& tx, vtx)
+ BOOST_FOREACH(const CTransaction& tx, vtx)
n += tx.GetSigOpCount();
return n;
}
@@ -1215,14 +850,14 @@ public:
uint256 BuildMerkleTree() const
{
vMerkleTree.clear();
- foreach(const CTransaction& tx, vtx)
+ BOOST_FOREACH(const CTransaction& tx, vtx)
vMerkleTree.push_back(tx.GetHash());
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
for (int i = 0; i < nSize; i += 2)
{
- int i2 = min(i+1, nSize-1);
+ int i2 = std::min(i+1, nSize-1);
vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]), END(vMerkleTree[j+i]),
BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2])));
}
@@ -1231,15 +866,15 @@ public:
return (vMerkleTree.empty() ? 0 : vMerkleTree.back());
}
- vector<uint256> GetMerkleBranch(int nIndex) const
+ std::vector<uint256> GetMerkleBranch(int nIndex) const
{
if (vMerkleTree.empty())
BuildMerkleTree();
- vector<uint256> vMerkleBranch;
+ std::vector<uint256> vMerkleBranch;
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
- int i = min(nIndex^1, nSize-1);
+ int i = std::min(nIndex^1, nSize-1);
vMerkleBranch.push_back(vMerkleTree[j+i]);
nIndex >>= 1;
j += nSize;
@@ -1247,11 +882,11 @@ public:
return vMerkleBranch;
}
- static uint256 CheckMerkleBranch(uint256 hash, const vector<uint256>& vMerkleBranch, int nIndex)
+ static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex)
{
if (nIndex == -1)
return 0;
- foreach(const uint256& otherside, vMerkleBranch)
+ BOOST_FOREACH(const uint256& otherside, vMerkleBranch)
{
if (nIndex & 1)
hash = Hash(BEGIN(otherside), END(otherside), BEGIN(hash), END(hash));
@@ -1482,7 +1117,7 @@ public:
for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
*(--pbegin) = pindex->GetBlockTime();
- sort(pbegin, pend);
+ std::sort(pbegin, pend);
return pbegin[(pend - pbegin)/2];
}
@@ -1500,7 +1135,7 @@ public:
- string ToString() const
+ std::string ToString() const
{
return strprintf("CBlockIndex(nprev=%08x, pnext=%08x, nFile=%d, nBlockPos=%-6d nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, pnext, nFile, nBlockPos, nHeight,
@@ -1569,9 +1204,9 @@ public:
}
- string ToString() const
+ std::string ToString() const
{
- string str = "CDiskBlockIndex(";
+ std::string str = "CDiskBlockIndex(";
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s, hashNext=%s)",
GetBlockHash().ToString().c_str(),
@@ -1601,7 +1236,7 @@ public:
class CBlockLocator
{
protected:
- vector<uint256> vHave;
+ std::vector<uint256> vHave;
public:
CBlockLocator()
@@ -1615,7 +1250,7 @@ public:
explicit CBlockLocator(uint256 hashBlock)
{
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
+ std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end())
Set((*mi).second);
}
@@ -1659,9 +1294,9 @@ public:
// Retrace how far back it was in the sender's branch
int nDistance = 0;
int nStep = 1;
- foreach(const uint256& hash, vHave)
+ BOOST_FOREACH(const uint256& hash, vHave)
{
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
+ std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
@@ -1678,9 +1313,9 @@ public:
CBlockIndex* GetBlockIndex()
{
// Find the first block the caller has in the main chain
- foreach(const uint256& hash, vHave)
+ BOOST_FOREACH(const uint256& hash, vHave)
{
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
+ std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
@@ -1694,9 +1329,9 @@ public:
uint256 GetBlockHash()
{
// Find the first block the caller has in the main chain
- foreach(const uint256& hash, vHave)
+ BOOST_FOREACH(const uint256& hash, vHave)
{
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
+ std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
@@ -1721,114 +1356,6 @@ public:
-//
-// Private key that includes an expiration date in case it never gets used.
-//
-class CWalletKey
-{
-public:
- CPrivKey vchPrivKey;
- int64 nTimeCreated;
- int64 nTimeExpires;
- string strComment;
- //// todo: add something to note what created it (user, getnewaddress, change)
- //// maybe should have a map<string, string> property map
-
- CWalletKey(int64 nExpires=0)
- {
- nTimeCreated = (nExpires ? GetTime() : 0);
- nTimeExpires = nExpires;
- }
-
- IMPLEMENT_SERIALIZE
- (
- if (!(nType & SER_GETHASH))
- READWRITE(nVersion);
- READWRITE(vchPrivKey);
- READWRITE(nTimeCreated);
- READWRITE(nTimeExpires);
- READWRITE(strComment);
- )
-};
-
-
-
-
-
-
-//
-// Account information.
-// Stored in wallet with key "acc"+string account name
-//
-class CAccount
-{
-public:
- vector<unsigned char> vchPubKey;
-
- CAccount()
- {
- SetNull();
- }
-
- void SetNull()
- {
- vchPubKey.clear();
- }
-
- IMPLEMENT_SERIALIZE
- (
- if (!(nType & SER_GETHASH))
- READWRITE(nVersion);
- READWRITE(vchPubKey);
- )
-};
-
-
-
-//
-// Internal transfers.
-// Database key is acentry<account><counter>
-//
-class CAccountingEntry
-{
-public:
- string strAccount;
- int64 nCreditDebit;
- int64 nTime;
- string strOtherAccount;
- string strComment;
-
- CAccountingEntry()
- {
- SetNull();
- }
-
- void SetNull()
- {
- nCreditDebit = 0;
- nTime = 0;
- strAccount.clear();
- strOtherAccount.clear();
- strComment.clear();
- }
-
- IMPLEMENT_SERIALIZE
- (
- if (!(nType & SER_GETHASH))
- READWRITE(nVersion);
- // Note: strAccount is serialized as part of the key, not here.
- READWRITE(nCreditDebit);
- READWRITE(nTime);
- READWRITE(strOtherAccount);
- READWRITE(strComment);
- )
-};
-
-
-
-
-
-
@@ -1847,16 +1374,16 @@ public:
int64 nExpiration;
int nID;
int nCancel;
- set<int> setCancel;
+ std::set<int> setCancel;
int nMinVer; // lowest version inclusive
int nMaxVer; // highest version inclusive
- set<string> setSubVer; // empty matches all
+ std::set<std::string> setSubVer; // empty matches all
int nPriority;
// Actions
- string strComment;
- string strStatusBar;
- string strReserved;
+ std::string strComment;
+ std::string strStatusBar;
+ std::string strReserved;
IMPLEMENT_SERIALIZE
(
@@ -1895,13 +1422,13 @@ public:
strReserved.clear();
}
- string ToString() const
+ std::string ToString() const
{
- string strSetCancel;
- foreach(int n, setCancel)
+ std::string strSetCancel;
+ BOOST_FOREACH(int n, setCancel)
strSetCancel += strprintf("%d ", n);
- string strSetSubVer;
- foreach(string str, setSubVer)
+ std::string strSetSubVer;
+ BOOST_FOREACH(std::string str, setSubVer)
strSetSubVer += "\"" + str + "\" ";
return strprintf(
"CAlert(\n"
@@ -1941,8 +1468,8 @@ public:
class CAlert : public CUnsignedAlert
{
public:
- vector<unsigned char> vchMsg;
- vector<unsigned char> vchSig;
+ std::vector<unsigned char> vchMsg;
+ std::vector<unsigned char> vchSig;
CAlert()
{
@@ -1984,7 +1511,7 @@ public:
return (alert.nID <= nCancel || setCancel.count(alert.nID));
}
- bool AppliesTo(int nVersion, string strSubVerIn) const
+ bool AppliesTo(int nVersion, std::string strSubVerIn) const
{
return (IsInEffect() &&
nMinVer <= nVersion && nVersion <= nMaxVer &&
@@ -2040,11 +1567,7 @@ public:
-extern map<uint256, CTransaction> mapTransactions;
-extern map<uint256, CWalletTx> mapWallet;
-extern vector<uint256> vWalletUpdated;
-extern CCriticalSection cs_mapWallet;
-extern map<vector<unsigned char>, CPrivKey> mapKeys;
-extern map<uint160, vector<unsigned char> > mapPubKeys;
-extern CCriticalSection cs_mapKeys;
-extern CKey keyUser;
+
+extern std::map<uint256, CTransaction> mapTransactions;
+
+#endif
diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw
new file mode 100644
index 0000000000..e2ef4213aa
--- /dev/null
+++ b/src/makefile.linux-mingw
@@ -0,0 +1,106 @@
+# Copyright (c) 2009-2010 Satoshi Nakamoto
+# Distributed under the MIT/X11 software license, see the accompanying
+# file license.txt or http://www.opensource.org/licenses/mit-license.php.
+
+DEPSDIR:=/usr/i586-mingw32msvc
+
+USE_UPNP:=0
+
+INCLUDEPATHS= \
+ -I"$(DEPSDIR)/boost_1_43_0" \
+ -I"$(DEPSDIR)/db-4.7.25.NC/build_unix" \
+ -I"$(DEPSDIR)/openssl-1.0.0d/include" \
+ -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/gcc_lib/mswud" \
+ -I"$(DEPSDIR)/wxWidgets-2.9.1/include" \
+ -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \
+ -I"$(DEPSDIR)"
+
+LIBPATHS= \
+ -L"$(DEPSDIR)/boost_1_43_0/stage/lib" \
+ -L"$(DEPSDIR)/db-4.7.25.NC/build_unix" \
+ -L"$(DEPSDIR)/openssl-1.0.0d" \
+ -L"$(DEPSDIR)/wxWidgets-2.9.1/lib"
+
+WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc
+
+LIBS= \
+ -l boost_system-mt-s \
+ -l boost_filesystem-mt-s \
+ -l boost_program_options-mt-s \
+ -l boost_thread_win32-mt-s \
+ -l db_cxx \
+ -l ssl \
+ -l crypto
+
+DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
+DEBUGFLAGS=-g -D__WXDEBUG__
+CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
+HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
+ script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h \
+ crypter.h init.h
+
+ifdef USE_UPNP
+ INCLUDEPATHS += -I"$(DEPSDIR)/upnpc-exe-win32-20110215"
+ LIBPATHS += -L"$(DEPSDIR)/upnpc-exe-win32-20110215"
+ LIBS += -l miniupnpc -l iphlpapi
+ DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
+endif
+
+LIBS += -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
+
+OBJS= \
+ obj/util.o \
+ obj/script.o \
+ obj/db.o \
+ obj/net.o \
+ obj/irc.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/wallet.o \
+ obj/rpc.o \
+ obj/init.o \
+ obj/crypter.o \
+ cryptopp/obj/sha.o \
+ cryptopp/obj/cpu.o
+
+
+all: bitcoin.exe
+
+
+obj/%.o: %.cpp $(HEADERS)
+ i586-mingw32msvc-g++ -c $(CFLAGS) -DGUI -o $@ $<
+
+cryptopp/obj/%.o: cryptopp/%.cpp
+ i586-mingw32msvc-g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
+
+obj/ui_res.o: ../share/ui.rc ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
+ i586-mingw32msvc-windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
+
+bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
+ i586-mingw32msvc-g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
+
+
+obj/nogui/%.o: %.cpp $(HEADERS)
+ i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
+
+bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
+ i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
+
+
+obj/test/%.o: obj/test/%.cpp $(HEADERS)
+ i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
+
+test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+ i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
+
+
+clean:
+ -rm -f obj/*.o
+ -rm -f obj/nogui/*.o
+ -rm -f obj/test/*.o
+ -rm -f cryptopp/obj/*.o
+ -rm -f test/*.o
+ -rm -f headers.h.gch
+ -rm -f bitcoin.exe
+ -rm -f bitcoind.exe
+ -rm -f test_bitcoin.exe
diff --git a/makefile.mingw b/src/makefile.mingw
index 1969ecc971..d630fe235f 100644
--- a/makefile.mingw
+++ b/src/makefile.mingw
@@ -7,14 +7,14 @@ USE_UPNP:=0
INCLUDEPATHS= \
-I"C:\boost-1.43.0-mgw" \
-I"C:\db-4.7.25.NC-mgw\build_unix" \
- -I"C:\openssl-1.0.0c-mgw\include" \
+ -I"C:\openssl-1.0.0d-mgw\include" \
-I"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib\mswud" \
-I"C:\wxWidgets-2.9.1-mgw\include"
LIBPATHS= \
-L"C:\boost-1.43.0-mgw\stage\lib" \
-L"C:\db-4.7.25.NC-mgw\build_unix" \
- -L"C:\openssl-1.0.0c-mgw" \
+ -L"C:\openssl-1.0.0d-mgw" \
-L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib"
WXLIBS= \
@@ -26,13 +26,15 @@ LIBS= \
-l boost_program_options-mgw45-mt-s-1_43 \
-l boost_thread-mgw45-mt-s-1_43 \
-l db_cxx \
- -l eay32
+ -l ssl \
+ -l crypto
-DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH
+DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
- script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
+ script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h \
+ init.h crypter.h
ifdef USE_UPNP
INCLUDEPATHS += -I"C:\upnpc-exe-win32-20110215"
@@ -49,9 +51,12 @@ OBJS= \
obj/db.o \
obj/net.o \
obj/irc.o \
+ obj/keystore.o \
obj/main.o \
+ obj/wallet.o \
obj/rpc.o \
obj/init.o \
+ obj/crypter.o \
cryptopp/obj/sha.o \
cryptopp/obj/cpu.o
@@ -65,7 +70,7 @@ obj/%.o: %.cpp $(HEADERS)
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -o $@ $<
-obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
+obj/ui_res.o: ../share/ui.rc ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
@@ -78,9 +83,17 @@ obj/nogui/%.o: %.cpp $(HEADERS)
bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+ g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
+
+test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+ g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
clean:
+ -del /Q bitcoin bitcoind test_bitcoin
-del /Q obj\*
-del /Q obj\nogui\*
+ -del /Q obj\test\*
-del /Q cryptopp\obj\*
+ -del /Q test\*.o
-del /Q headers.h.gch
diff --git a/makefile.osx b/src/makefile.osx
index 4836ea3f4f..363a85fc7b 100644
--- a/makefile.osx
+++ b/src/makefile.osx
@@ -33,7 +33,8 @@ DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O3 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
- script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
+ script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h \
+ init.h crypter.h
OBJS= \
obj/util.o \
@@ -41,9 +42,12 @@ OBJS= \
obj/db.o \
obj/net.o \
obj/irc.o \
+ obj/keystore.o \
obj/main.o \
+ obj/wallet.o \
obj/rpc.o \
obj/init.o \
+ obj/crypter.o \
cryptopp/obj/sha.o \
cryptopp/obj/cpu.o
@@ -72,9 +76,15 @@ obj/nogui/%.o: %.cpp $(HEADERS)
bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+ $(CXX) -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
+
+test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+ $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
clean:
- -rm -f bitcoin bitcoind
+ -rm -f bitcoin bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
+ -rm -f obj/test/*.o
-rm -f cryptopp/obj/*.o
diff --git a/makefile.unix b/src/makefile.unix
index 61b925e3bc..597eea0dc8 100644
--- a/makefile.unix
+++ b/src/makefile.unix
@@ -10,7 +10,7 @@ WXLIBS=$(shell wx-config --libs)
USE_UPNP:=0
-DEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
+DEFS=-DNOPCH -DUSE_SSL
# for boost 1.37, add -mt to the boost libraries
LIBS= \
@@ -32,13 +32,15 @@ LIBS+= \
-Wl,-Bdynamic \
-l gthread-2.0 \
-l z \
- -l dl
+ -l dl \
+ -l pthread
DEBUGFLAGS=-g -D__WXDEBUG__
CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
- script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
+ script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h \
+ init.h crypter.h
OBJS= \
obj/util.o \
@@ -46,9 +48,12 @@ OBJS= \
obj/db.o \
obj/net.o \
obj/irc.o \
+ obj/keystore.o \
obj/main.o \
+ obj/wallet.o \
obj/rpc.o \
obj/init.o \
+ obj/crypter.o \
cryptopp/obj/sha.o \
cryptopp/obj/cpu.o
@@ -62,24 +67,26 @@ obj/%.o: %.cpp $(HEADERS)
cryptopp/obj/%.o: cryptopp/%.cpp
$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
-obj/sha256.o: sha256.cpp
- $(CXX) -c $(CXXFLAGS) -msse2 -O3 -march=amdfam10 -o $@ $<
-
-bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
+bitcoin: $(OBJS) obj/ui.o obj/uibase.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
$(CXX) -c $(CXXFLAGS) -o $@ $<
-bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha256.o
+bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+ $(CXX) -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
+
+test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+ $(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LIBS)
clean:
+ -rm -f bitcoin bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
+ -rm -f obj/test/*.o
-rm -f cryptopp/obj/*.o
-rm -f headers.h.gch
- -rm -f bitcoin
- -rm -f bitcoind
diff --git a/makefile.vc b/src/makefile.vc
index 18ced0236e..c050deb6ed 100644
--- a/makefile.vc
+++ b/src/makefile.vc
@@ -8,33 +8,45 @@ INCLUDEPATHS= \
/I"/db/build_windows" \
/I"/openssl/include" \
/I"/wxwidgets/lib/vc_lib/mswu" \
- /I"/wxwidgets/include"
+ /I"/wxwidgets/include" /
+ /I"/miniupnpc"
LIBPATHS= \
/LIBPATH:"/boost/stage/lib" \
/LIBPATH:"/db/build_windows/Release" \
/LIBPATH:"/openssl/lib" \
/LIBPATH:"/wxwidgets/lib/vc_lib" \
+ /LIBPATH:"/miniupnpc/msvc/Release" \
/NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib \
/NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib \
/NODEFAULTLIB:msvcrtd.lib
WXLIBS=wxmsw29u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib
+USE_UPNP=0
+
+DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH /DNOMINMAX
+
LIBS= \
libboost_system-vc100-mt.lib \
libboost_filesystem-vc100-mt.lib \
libboost_program_options-vc100-mt.lib \
libboost_thread-vc100-mt.lib \
libdb47s.lib \
- libeay32.lib \
- kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
+ libeay32.lib
+
+!IFDEF USE_UPNP
+LIBS=$(LIBS) miniupnpc.lib
+DEFS=$(DEFS) /DUSE_UPNP=$(USE_UPNP)
+!ENDIF
+
+LIBS=$(LIBS) \
+ kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib iphlpapi.lib
-DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH
DEBUGFLAGS=/Os
CFLAGS=/MD /c /nologo /EHsc /GR /Zm300 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
- script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
+ script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h wallet.h keystore.h crypter.h
OBJS= \
obj\util.obj \
@@ -42,12 +54,19 @@ OBJS= \
obj\db.obj \
obj\net.obj \
obj\irc.obj \
+ obj\keystore.obj \
obj\main.obj \
+ obj\wallet.obj \
obj\rpc.obj \
obj\init.obj \
+ obj\crypter.obj
+
+CRYPTOPP_OBJS= \
cryptopp\obj\sha.obj \
cryptopp\obj\cpu.obj
+RC=../share
+
all: bitcoin.exe
@@ -65,12 +84,18 @@ obj\net.obj: $(HEADERS)
obj\irc.obj: $(HEADERS)
+obj\keystore.obj: $(HEADERS)
+
obj\main.obj: $(HEADERS)
+obj\wallet.obj: $(HEADERS)
+
obj\rpc.obj: $(HEADERS)
obj\init.obj: $(HEADERS)
+obj\crypter.obj: $(HEADERS)
+
obj\ui.obj: $(HEADERS)
obj\uibase.obj: $(HEADERS)
@@ -81,13 +106,13 @@ cryptopp\obj\sha.obj: cryptopp\sha.cpp
cryptopp\obj\cpu.obj: cryptopp\cpu.cpp
cl $(CFLAGS) /O2 /DCRYPTOPP_DISABLE_ASM /Fo$@ %s
-obj\ui.res: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
+obj\ui.res: $(RC)/ui.rc $(RC)/pixmaps/bitcoin.ico $(RC)/pixmaps/check.ico $(RC)/pixmaps/send16.bmp $(RC)/pixmaps/send16mask.bmp $(RC)/pixmaps/send16masknoshadow.bmp $(RC)/pixmaps/send20.bmp $(RC)/pixmaps/send20mask.bmp $(RC)/pixmaps/addressbook16.bmp $(RC)/pixmaps/addressbook16mask.bmp $(RC)/pixmaps/addressbook20.bmp $(RC)/pixmaps/addressbook20mask.bmp
rc $(INCLUDEPATHS) $(DEFS) /Fo$@ %s
-bitcoin.exe: $(OBJS) obj\ui.obj obj\uibase.obj obj\ui.res
+bitcoin.exe: $(OBJS) $(CRYPTOPP_OBJS) obj\ui.obj obj\uibase.obj obj\ui.res
link /nologo /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(WXLIBS) $(LIBS)
-
+
.cpp{obj\nogui}.obj:
cl $(CFLAGS) /Fo$@ %s
@@ -101,13 +126,17 @@ obj\nogui\net.obj: $(HEADERS)
obj\nogui\irc.obj: $(HEADERS)
+obj\nogui\keystore.obj: $(HEADERS)
+
obj\nogui\main.obj: $(HEADERS)
+obj\nogui\wallet.obj: $(HEADERS)
+
obj\nogui\rpc.obj: $(HEADERS)
obj\nogui\init.obj: $(HEADERS)
-bitcoind.exe: $(OBJS:obj\=obj\nogui\) obj\ui.res
+bitcoind.exe: $(OBJS:obj\=obj\nogui\) $(CRYPTOPP_OBJS) obj\ui.res
link /nologo /OUT:$@ $(LIBPATHS) $** $(LIBS)
diff --git a/net.cpp b/src/net.cpp
index a403655660..3953f021e9 100644
--- a/net.cpp
+++ b/src/net.cpp
@@ -1,8 +1,23 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "irc.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
+#include "strlcpy.h"
+
+#ifdef __WXMSW__
+#include <string.h>
+// This file can be downloaded as a part of the Windows Platform SDK
+// and is required for Bitcoin binaries to work properly on versions
+// of Windows before XP. If you are doing builds of Bitcoin for
+// public release, you should uncomment this line.
+//#include <WSPiApi.h>
+#endif
#ifdef USE_UPNP
#include <miniupnpc/miniwget.h>
@@ -11,6 +26,9 @@
#include <miniupnpc/upnperrors.h>
#endif
+using namespace std;
+using namespace boost;
+
static const int MAX_OUTBOUND_CONNECTIONS = 8;
void ThreadMessageHandler2(void* parg);
@@ -29,8 +47,9 @@ bool OpenNetworkConnection(const CAddress& addrConnect);
// Global state variables
//
bool fClient = false;
+bool fAllowDNS = false;
uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
-CAddress addrLocalHost(0, 0, nLocalServices);
+CAddress addrLocalHost("0.0.0.0", 0, false, nLocalServices);
CNode* pnodeLocalHost = NULL;
uint64 nLocalHostNonce = 0;
array<int, 10> vnThreadsRunning;
@@ -47,11 +66,16 @@ map<CInv, int64> mapAlreadyAskedFor;
// Settings
int fUseProxy = false;
-CAddress addrProxy("127.0.0.1:9050");
+int nConnectTimeout = 5000;
+CAddress addrProxy("127.0.0.1",9050);
+unsigned short GetListenPort()
+{
+ return (unsigned short)(GetArg("-port", GetDefaultPort()));
+}
void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd)
{
@@ -68,31 +92,109 @@ void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd)
-bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
+bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout)
{
hSocketRet = INVALID_SOCKET;
SOCKET hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (hSocket == INVALID_SOCKET)
return false;
-#ifdef BSD
+#ifdef SO_NOSIGPIPE
int set = 1;
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
#endif
- bool fRoutable = !(addrConnect.GetByte(3) == 10 || (addrConnect.GetByte(3) == 192 && addrConnect.GetByte(2) == 168));
- bool fProxy = (fUseProxy && fRoutable);
+ bool fProxy = (fUseProxy && addrConnect.IsRoutable());
struct sockaddr_in sockaddr = (fProxy ? addrProxy.GetSockAddr() : addrConnect.GetSockAddr());
+#ifdef __WXMSW__
+ u_long fNonblock = 1;
+ if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR)
+#else
+ int fFlags = fcntl(hSocket, F_GETFL, 0);
+ if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == -1)
+#endif
+ {
+ closesocket(hSocket);
+ return false;
+ }
+
+
if (connect(hSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
{
+ // WSAEINVAL is here because some legacy version of winsock uses it
+ if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL)
+ {
+ struct timeval timeout;
+ timeout.tv_sec = nTimeout / 1000;
+ timeout.tv_usec = (nTimeout % 1000) * 1000;
+
+ fd_set fdset;
+ FD_ZERO(&fdset);
+ FD_SET(hSocket, &fdset);
+ int nRet = select(hSocket + 1, NULL, &fdset, NULL, &timeout);
+ if (nRet == 0)
+ {
+ printf("connection timeout\n");
+ closesocket(hSocket);
+ return false;
+ }
+ if (nRet == SOCKET_ERROR)
+ {
+ printf("select() for connection failed: %i\n",WSAGetLastError());
+ closesocket(hSocket);
+ return false;
+ }
+ socklen_t nRetSize = sizeof(nRet);
+#ifdef __WXMSW__
+ if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, (char*)(&nRet), &nRetSize) == SOCKET_ERROR)
+#else
+ if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR)
+#endif
+ {
+ printf("getsockopt() for connection failed: %i\n",WSAGetLastError());
+ closesocket(hSocket);
+ return false;
+ }
+ if (nRet != 0)
+ {
+ printf("connect() failed after select(): %s\n",strerror(nRet));
+ closesocket(hSocket);
+ return false;
+ }
+ }
+#ifdef __WXMSW__
+ else if (WSAGetLastError() != WSAEISCONN)
+#else
+ else
+#endif
+ {
+ printf("connect() failed: %i\n",WSAGetLastError());
+ closesocket(hSocket);
+ return false;
+ }
+ }
+
+ /*
+ this isn't even strictly necessary
+ CNode::ConnectNode immediately turns the socket back to non-blocking
+ but we'll turn it back to blocking just in case
+ */
+#ifdef __WXMSW__
+ fNonblock = 0;
+ if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR)
+#else
+ fFlags = fcntl(hSocket, F_GETFL, 0);
+ if (fcntl(hSocket, F_SETFL, fFlags & !O_NONBLOCK) == SOCKET_ERROR)
+#endif
+ {
closesocket(hSocket);
return false;
}
if (fProxy)
{
- printf("proxy connecting %s\n", addrConnect.ToStringLog().c_str());
+ printf("proxy connecting %s\n", addrConnect.ToString().c_str());
char pszSocks4IP[] = "\4\1\0\0\0\0\0\0user";
memcpy(pszSocks4IP + 2, &addrConnect.port, 2);
memcpy(pszSocks4IP + 4, &addrConnect.ip, 4);
@@ -118,14 +220,83 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
printf("ERROR: Proxy returned error %d\n", pchRet[1]);
return false;
}
- printf("proxy connected %s\n", addrConnect.ToStringLog().c_str());
+ printf("proxy connected %s\n", addrConnect.ToString().c_str());
}
hSocketRet = hSocket;
return true;
}
+// portDefault is in host order
+bool Lookup(const char *pszName, vector<CAddress>& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup, int portDefault, bool fAllowPort)
+{
+ vaddr.clear();
+ if (pszName[0] == 0)
+ return false;
+ int port = portDefault;
+ char psz[256];
+ char *pszHost = psz;
+ strlcpy(psz, pszName, sizeof(psz));
+ if (fAllowPort)
+ {
+ char* pszColon = strrchr(psz+1,':');
+ char *pszPortEnd = NULL;
+ int portParsed = pszColon ? strtoul(pszColon+1, &pszPortEnd, 10) : 0;
+ if (pszColon && pszPortEnd && pszPortEnd[0] == 0)
+ {
+ if (psz[0] == '[' && pszColon[-1] == ']')
+ {
+ // Future: enable IPv6 colon-notation inside []
+ pszHost = psz+1;
+ pszColon[-1] = 0;
+ }
+ else
+ pszColon[0] = 0;
+ port = portParsed;
+ if (port < 0 || port > USHRT_MAX)
+ port = USHRT_MAX;
+ }
+ }
+
+ unsigned int addrIP = inet_addr(pszHost);
+ if (addrIP != INADDR_NONE)
+ {
+ // valid IP address passed
+ vaddr.push_back(CAddress(addrIP, port, nServices));
+ return true;
+ }
+ if (!fAllowLookup)
+ return false;
+
+ struct hostent* phostent = gethostbyname(pszHost);
+ if (!phostent)
+ return false;
+
+ if (phostent->h_addrtype != AF_INET)
+ return false;
+
+ char** ppAddr = phostent->h_addr_list;
+ while (*ppAddr != NULL && vaddr.size() != nMaxSolutions)
+ {
+ CAddress addr(((struct in_addr*)ppAddr[0])->s_addr, port, nServices);
+ if (addr.IsValid())
+ vaddr.push_back(addr);
+ ppAddr++;
+ }
+
+ return (vaddr.size() > 0);
+}
+
+// portDefault is in host order
+bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup, int portDefault, bool fAllowPort)
+{
+ vector<CAddress> vaddr;
+ bool fRet = Lookup(pszName, vaddr, nServices, 1, fAllowLookup, portDefault, fAllowPort);
+ if (fRet)
+ addr = vaddr[0];
+ return fRet;
+}
bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const char* pszKeyword, unsigned int& ipRet)
{
@@ -161,7 +332,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r"));
while (strLine.size() > 0 && isspace(strLine[strLine.size()-1]))
strLine.resize(strLine.size()-1);
- CAddress addr(strLine.c_str());
+ CAddress addr(strLine,0,true);
printf("GetMyExternalIP() received [%s] %s\n", strLine.c_str(), addr.ToString().c_str());
if (addr.ip == 0 || addr.ip == INADDR_NONE || !addr.IsRoutable())
return false;
@@ -192,13 +363,13 @@ bool GetMyExternalIP(unsigned int& ipRet)
// <?php echo $_SERVER["REMOTE_ADDR"]; ?>
if (nHost == 1)
{
- addrConnect = CAddress("91.198.22.70:80"); // checkip.dyndns.org
+ addrConnect = CAddress("91.198.22.70",80); // checkip.dyndns.org
if (nLookup == 1)
{
- struct hostent* phostent = gethostbyname("checkip.dyndns.org");
- if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
- addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
+ CAddress addrIP("checkip.dyndns.org", 80, true);
+ if (addrIP.IsValid())
+ addrConnect = addrIP;
}
pszGet = "GET / HTTP/1.1\r\n"
@@ -211,13 +382,13 @@ bool GetMyExternalIP(unsigned int& ipRet)
}
else if (nHost == 2)
{
- addrConnect = CAddress("74.208.43.192:80"); // www.showmyip.com
+ addrConnect = CAddress("74.208.43.192", 80); // www.showmyip.com
if (nLookup == 1)
{
- struct hostent* phostent = gethostbyname("www.showmyip.com");
- if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
- addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
+ CAddress addrIP("www.showmyip.com", 80, true);
+ if (addrIP.IsValid())
+ addrConnect = addrIP;
}
pszGet = "GET /simple/ HTTP/1.1\r\n"
@@ -260,7 +431,7 @@ void ThreadGetMyExternalIP(void* parg)
CAddress addr(addrLocalHost);
addr.nTime = GetAdjustedTime();
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushAddress(addr);
}
}
@@ -270,7 +441,7 @@ void ThreadGetMyExternalIP(void* parg)
-bool AddAddress(CAddress addr, int64 nTimePenalty)
+bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
{
if (!addr.IsRoutable())
return false;
@@ -283,9 +454,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
if (it == mapAddresses.end())
{
// New address
- printf("AddAddress(%s)\n", addr.ToStringLog().c_str());
+ printf("AddAddress(%s)\n", addr.ToString().c_str());
mapAddresses.insert(make_pair(addr.GetKey(), addr));
- CAddrDB().WriteAddress(addr);
+ if (pAddrDB)
+ pAddrDB->WriteAddress(addr);
+ else
+ CAddrDB().WriteAddress(addr);
return true;
}
else
@@ -307,7 +481,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
fUpdated = true;
}
if (fUpdated)
- CAddrDB().WriteAddress(addrFound);
+ {
+ if (pAddrDB)
+ pAddrDB->WriteAddress(addrFound);
+ else
+ CAddrDB().WriteAddress(addrFound);
+ }
}
}
return false;
@@ -344,7 +523,7 @@ void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1)
// call this in the destructor so it doesn't get called after it's deleted.
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
{
CRITICAL_BLOCK(pnode->cs_mapRequests)
{
@@ -381,7 +560,7 @@ bool AnySubscribed(unsigned int nChannel)
if (pnodeLocalHost->IsSubscribed(nChannel))
return true;
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->IsSubscribed(nChannel))
return true;
return false;
@@ -403,7 +582,7 @@ void CNode::Subscribe(unsigned int nChannel, unsigned int nHops)
{
// Relay subscribe
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode != this)
pnode->PushMessage("subscribe", nChannel, nHops);
}
@@ -425,7 +604,7 @@ void CNode::CancelSubscribe(unsigned int nChannel)
{
// Relay subscription cancel
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode != this)
pnode->PushMessage("sub-cancel", nChannel);
}
@@ -443,7 +622,7 @@ CNode* FindNode(unsigned int ip)
{
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->addr.ip == ip)
return (pnode);
}
@@ -454,7 +633,7 @@ CNode* FindNode(CAddress addr)
{
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->addr == addr)
return (pnode);
}
@@ -479,7 +658,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout)
/// debug print
printf("trying connection %s lastseen=%.1fhrs lasttry=%.1fhrs\n",
- addrConnect.ToStringLog().c_str(),
+ addrConnect.ToString().c_str(),
(double)(addrConnect.nTime - GetAdjustedTime())/3600.0,
(double)(addrConnect.nLastTry - GetAdjustedTime())/3600.0);
@@ -491,7 +670,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout)
if (ConnectSocket(addrConnect, hSocket))
{
/// debug print
- printf("connected %s\n", addrConnect.ToStringLog().c_str());
+ printf("connected %s\n", addrConnect.ToString().c_str());
// Set to nonblocking
#ifdef __WXMSW__
@@ -528,7 +707,7 @@ void CNode::CloseSocketDisconnect()
{
if (fDebug)
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
- printf("disconnecting node %s\n", addr.ToStringLog().c_str());
+ printf("disconnecting node %s\n", addr.ToString().c_str());
closesocket(hSocket);
hSocket = INVALID_SOCKET;
}
@@ -591,7 +770,7 @@ void ThreadSocketHandler2(void* parg)
{
// Disconnect unused nodes
vector<CNode*> vNodesCopy = vNodes;
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
{
if (pnode->fDisconnect ||
(pnode->GetRefCount() <= 0 && pnode->vRecv.empty() && pnode->vSend.empty()))
@@ -613,7 +792,7 @@ void ThreadSocketHandler2(void* parg)
// Delete disconnected nodes
list<CNode*> vNodesDisconnectedCopy = vNodesDisconnected;
- foreach(CNode* pnode, vNodesDisconnectedCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesDisconnectedCopy)
{
// wait until threads are done using it
if (pnode->GetRefCount() <= 0)
@@ -659,9 +838,9 @@ void ThreadSocketHandler2(void* parg)
hSocketMax = max(hSocketMax, hListenSocket);
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
{
- if (pnode->hSocket == INVALID_SOCKET || pnode->hSocket < 0)
+ if (pnode->hSocket == INVALID_SOCKET)
continue;
FD_SET(pnode->hSocket, &fdsetRecv);
FD_SET(pnode->hSocket, &fdsetError);
@@ -680,9 +859,12 @@ void ThreadSocketHandler2(void* parg)
if (nSelect == SOCKET_ERROR)
{
int nErr = WSAGetLastError();
- printf("socket select error %d\n", nErr);
- for (int i = 0; i <= hSocketMax; i++)
- FD_SET(i, &fdsetRecv);
+ if (hSocketMax > -1)
+ {
+ printf("socket select error %d\n", nErr);
+ for (int i = 0; i <= hSocketMax; i++)
+ FD_SET(i, &fdsetRecv);
+ }
FD_ZERO(&fdsetSend);
FD_ZERO(&fdsetError);
Sleep(timeout.tv_usec/1000);
@@ -701,7 +883,7 @@ void ThreadSocketHandler2(void* parg)
int nInbound = 0;
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->fInbound)
nInbound++;
if (hSocket == INVALID_SOCKET)
@@ -715,7 +897,7 @@ void ThreadSocketHandler2(void* parg)
}
else
{
- printf("accepted connection %s\n", addr.ToStringLog().c_str());
+ printf("accepted connection %s\n", addr.ToString().c_str());
CNode* pnode = new CNode(hSocket, addr, true);
pnode->AddRef();
CRITICAL_BLOCK(cs_vNodes)
@@ -731,10 +913,10 @@ void ThreadSocketHandler2(void* parg)
CRITICAL_BLOCK(cs_vNodes)
{
vNodesCopy = vNodes;
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
pnode->AddRef();
}
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
{
if (fShutdown)
return;
@@ -751,7 +933,7 @@ void ThreadSocketHandler2(void* parg)
CDataStream& vRecv = pnode->vRecv;
unsigned int nPos = vRecv.size();
- if (nPos > 1000*GetArg("-maxreceivebuffer", 10*1000)) {
+ if (nPos > ReceiveBufferSize()) {
if (!pnode->fDisconnect)
printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size());
pnode->CloseSocketDisconnect();
@@ -816,7 +998,7 @@ void ThreadSocketHandler2(void* parg)
pnode->CloseSocketDisconnect();
}
}
- if (vSend.size() > 1000*GetArg("-maxsendbuffer", 10*1000)) {
+ if (vSend.size() > SendBufferSize()) {
if (!pnode->fDisconnect)
printf("socket send flood control disconnect (%d bytes)\n", vSend.size());
pnode->CloseSocketDisconnect();
@@ -851,7 +1033,7 @@ void ThreadSocketHandler2(void* parg)
}
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
pnode->Release();
}
@@ -892,7 +1074,7 @@ void ThreadMapPort2(void* parg)
printf("ThreadMapPort started\n");
char port[6];
- sprintf(port, "%d", ntohs(GetDefaultPort()));
+ sprintf(port, "%d", GetListenPort());
const char * rootdescurl = 0;
const char * multicastif = 0;
@@ -911,13 +1093,14 @@ void ThreadMapPort2(void* parg)
{
char intClient[16];
char intPort[6];
+ string strDesc = "Bitcoin " + FormatFullVersion();
#ifndef __WXMSW__
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
- port, port, lanaddr, 0, "TCP", 0);
+ port, port, lanaddr, strDesc.c_str(), "TCP", 0);
#else
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
- port, port, lanaddr, 0, "TCP", 0, "0");
+ port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
#endif
if(r!=UPNPCOMMAND_SUCCESS)
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
@@ -953,7 +1136,7 @@ void MapPort(bool fMapPort)
if (fUseUPnP != fMapPort)
{
fUseUPnP = fMapPort;
- CWalletDB().WriteSetting("fUseUPnP", fUseUPnP);
+ WriteSetting("fUseUPnP", fUseUPnP);
}
if (fUseUPnP && vnThreadsRunning[5] < 1)
{
@@ -961,6 +1144,11 @@ void MapPort(bool fMapPort)
printf("Error: ThreadMapPort(ThreadMapPort) failed\n");
}
}
+#else
+void MapPort(bool /* unused fMapPort */)
+{
+ // Intentionally left blank.
+}
#endif
@@ -975,28 +1163,36 @@ void MapPort(bool fMapPort)
static const char *strDNSSeed[] = {
"bitseed.xf2.org",
"bitseed.bitcoin.org.uk",
+ "dnsseed.bluematt.me",
};
void DNSAddressSeed()
{
int found = 0;
- printf("Loading addresses from DNS seeds (could take a while)\n");
-
- for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
- struct hostent* phostent = gethostbyname(strDNSSeed[seed_idx]);
- if (!phostent)
- continue;
+ if (!fTestNet)
+ {
+ printf("Loading addresses from DNS seeds (could take a while)\n");
+ CAddrDB addrDB;
+ addrDB.TxnBegin();
- for (int host = 0; phostent->h_addr_list[host] != NULL; host++) {
- CAddress addr(*(unsigned int*)phostent->h_addr_list[host],
- GetDefaultPort(), NODE_NETWORK);
- addr.nTime = 0;
- if (addr.IsValid() && addr.GetByte(3) != 127) {
- AddAddress(addr);
- found++;
+ for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
+ vector<CAddress> vaddr;
+ if (Lookup(strDNSSeed[seed_idx], vaddr, NODE_NETWORK, -1, true))
+ {
+ BOOST_FOREACH (CAddress& addr, vaddr)
+ {
+ if (addr.GetByte(3) != 127)
+ {
+ addr.nTime = 0;
+ AddAddress(addr, 0, &addrDB);
+ found++;
+ }
+ }
}
}
+
+ addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
}
printf("%d addresses found from DNS seeds\n", found);
@@ -1078,9 +1274,9 @@ void ThreadOpenConnections2(void* parg)
{
for (int64 nLoop = 0;; nLoop++)
{
- foreach(string strAddr, mapMultiArgs["-connect"])
+ BOOST_FOREACH(string strAddr, mapMultiArgs["-connect"])
{
- CAddress addr(strAddr, NODE_NETWORK);
+ CAddress addr(strAddr, fAllowDNS);
if (addr.IsValid())
OpenNetworkConnection(addr);
for (int i = 0; i < 10 && i < nLoop; i++)
@@ -1096,9 +1292,9 @@ void ThreadOpenConnections2(void* parg)
// Connect to manually added nodes first
if (mapArgs.count("-addnode"))
{
- foreach(string strAddr, mapMultiArgs["-addnode"])
+ BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
{
- CAddress addr(strAddr, NODE_NETWORK);
+ CAddress addr(strAddr, fAllowDNS);
if (addr.IsValid())
{
OpenNetworkConnection(addr);
@@ -1120,7 +1316,7 @@ void ThreadOpenConnections2(void* parg)
{
int nOutbound = 0;
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (!pnode->fInbound)
nOutbound++;
int nMaxOutboundConnections = MAX_OUTBOUND_CONNECTIONS;
@@ -1163,7 +1359,7 @@ void ThreadOpenConnections2(void* parg)
{
nSeedDisconnected = GetTime();
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (setSeed.count(pnode->addr.ip))
pnode->fDisconnect = true;
}
@@ -1171,7 +1367,7 @@ void ThreadOpenConnections2(void* parg)
// Keep setting timestamps to 0 so they won't reconnect
if (GetTime() - nSeedDisconnected < 60 * 60)
{
- foreach(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
+ BOOST_FOREACH(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
{
if (setSeed.count(item.second.ip) && item.second.nTime != 0)
{
@@ -1194,12 +1390,12 @@ void ThreadOpenConnections2(void* parg)
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.
set<unsigned int> setConnected;
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
setConnected.insert(pnode->addr.ip & 0x0000ffff);
CRITICAL_BLOCK(cs_mapAddresses)
{
- foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
+ BOOST_FOREACH(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
{
const CAddress& addr = item.second;
if (!addr.IsIPv4() || !addr.IsValid() || setConnected.count(addr.ip & 0x0000ffff))
@@ -1209,7 +1405,7 @@ void ThreadOpenConnections2(void* parg)
// Randomize the order in a deterministic way, putting the standard port first
int64 nRandomizer = (uint64)(nStart * 4951 + addr.nLastTry * 9567851 + addr.ip * 7789) % (2 * 60 * 60);
- if (addr.port != GetDefaultPort())
+ if (addr.port != htons(GetDefaultPort()))
nRandomizer += 2 * 60 * 60;
// Last seen Base retry frequency
@@ -1315,7 +1511,7 @@ void ThreadMessageHandler2(void* parg)
CRITICAL_BLOCK(cs_vNodes)
{
vNodesCopy = vNodes;
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
pnode->AddRef();
}
@@ -1323,7 +1519,7 @@ void ThreadMessageHandler2(void* parg)
CNode* pnodeTrickle = NULL;
if (!vNodesCopy.empty())
pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())];
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
{
// Receive messages
TRY_CRITICAL_BLOCK(pnode->cs_vRecv)
@@ -1340,7 +1536,7 @@ void ThreadMessageHandler2(void* parg)
CRITICAL_BLOCK(cs_vNodes)
{
- foreach(CNode* pnode, vNodesCopy)
+ BOOST_FOREACH(CNode* pnode, vNodesCopy)
pnode->Release();
}
@@ -1362,14 +1558,11 @@ void ThreadMessageHandler2(void* parg)
-
-
-
bool BindListenPort(string& strError)
{
strError = "";
int nOne = 1;
- addrLocalHost.port = GetDefaultPort();
+ addrLocalHost.port = htons(GetListenPort());
#ifdef __WXMSW__
// Initialize Windows Sockets
@@ -1392,7 +1585,7 @@ bool BindListenPort(string& strError)
return false;
}
-#ifdef BSD
+#ifdef SO_NOSIGPIPE
// Different way of disabling SIGPIPE on BSD
setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int));
#endif
@@ -1421,7 +1614,7 @@ bool BindListenPort(string& strError)
memset(&sockaddr, 0, sizeof(sockaddr));
sockaddr.sin_family = AF_INET;
sockaddr.sin_addr.s_addr = INADDR_ANY; // bind to all IPs on this computer
- sockaddr.sin_port = GetDefaultPort();
+ sockaddr.sin_port = htons(GetListenPort());
if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
{
int nErr = WSAGetLastError();
@@ -1448,29 +1641,21 @@ bool BindListenPort(string& strError)
void StartNode(void* parg)
{
if (pnodeLocalHost == NULL)
- pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", nLocalServices));
+ pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", 0, false, nLocalServices));
#ifdef __WXMSW__
// Get local host ip
char pszHostName[1000] = "";
if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)
{
- struct hostent* phostent = gethostbyname(pszHostName);
- if (phostent)
- {
- // Take the first IP that isn't loopback 127.x.x.x
- for (int i = 0; phostent->h_addr_list[i] != NULL; i++)
- printf("host ip %d: %s\n", i, CAddress(*(unsigned int*)phostent->h_addr_list[i]).ToStringIP().c_str());
- for (int i = 0; phostent->h_addr_list[i] != NULL; i++)
- {
- CAddress addr(*(unsigned int*)phostent->h_addr_list[i], GetDefaultPort(), nLocalServices);
- if (addr.IsValid() && addr.GetByte(3) != 127)
+ vector<CAddress> vaddr;
+ if (Lookup(pszHostName, vaddr, nLocalServices, -1, true))
+ BOOST_FOREACH (const CAddress &addr, vaddr)
+ if (addr.GetByte(3) != 127)
{
addrLocalHost = addr;
break;
}
- }
- }
}
#else
// Get local host ip
@@ -1491,7 +1676,7 @@ void StartNode(void* parg)
printf("ipv4 %s: %s\n", ifa->ifa_name, pszIP);
// Take the first IP that isn't loopback 127.x.x.x
- CAddress addr(*(unsigned int*)&s4->sin_addr, GetDefaultPort(), nLocalServices);
+ CAddress addr(*(unsigned int*)&s4->sin_addr, GetListenPort(), nLocalServices);
if (addr.IsValid() && addr.GetByte(3) != 127)
{
addrLocalHost = addr;
@@ -1534,7 +1719,7 @@ void StartNode(void* parg)
printf("Error: CreateThread(ThreadIRCSeed) failed\n");
// Send and receive from sockets, accept connections
- pthread_t hThreadSocketHandler = CreateThread(ThreadSocketHandler, NULL, true);
+ CreateThread(ThreadSocketHandler, NULL, true);
// Initiate outbound connections
if (!CreateThread(ThreadOpenConnections, NULL))
@@ -1545,7 +1730,7 @@ void StartNode(void* parg)
printf("Error: CreateThread(ThreadMessageHandler) failed\n");
// Generate coins in the background
- GenerateBitcoins(fGenerateBitcoins);
+ GenerateBitcoins(fGenerateBitcoins, pwalletMain);
}
bool StopNode()
@@ -1586,7 +1771,7 @@ public:
~CNetCleanup()
{
// Close sockets
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->hSocket != INVALID_SOCKET)
closesocket(pnode->hSocket);
if (hListenSocket != INVALID_SOCKET)
diff --git a/net.h b/src/net.h
index b3bd74da47..3b098e1a82 100644
--- a/net.h
+++ b/src/net.h
@@ -1,18 +1,34 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_NET_H
+#define BITCOIN_NET_H
+
+#include <deque>
+#include <boost/array.hpp>
+#include <boost/foreach.hpp>
+#include <openssl/rand.h>
+
+#ifndef __WXMSW__
+#include <arpa/inet.h>
+#endif
class CMessageHeader;
class CAddress;
+class CAddrDB;
class CInv;
class CRequestTracker;
class CNode;
class CBlockIndex;
extern int nBestHeight;
+extern int nConnectTimeout;
-inline unsigned short GetDefaultPort() { return fTestNet ? htons(18333) : htons(8333); }
+inline unsigned int ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 10*1000); }
+inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 10*1000); }
+inline unsigned short GetDefaultPort() { return fTestNet ? 18333 : 8333; }
static const unsigned int PUBLISH_HOPS = 5;
enum
{
@@ -22,9 +38,11 @@ enum
-bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet);
+bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout=nConnectTimeout);
+bool Lookup(const char *pszName, std::vector<CAddress>& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
+bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
bool GetMyExternalIP(unsigned int& ipRet);
-bool AddAddress(CAddress addr, int64 nTimePenalty=0);
+bool AddAddress(CAddress addr, int64 nTimePenalty=0, CAddrDB *pAddrDB=NULL);
void AddressCurrentlyConnected(const CAddress& addr);
CNode* FindNode(unsigned int ip);
CNode* ConnectNode(CAddress addrConnect, int64 nTimeout=0);
@@ -32,7 +50,7 @@ void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1);
bool AnySubscribed(unsigned int nChannel);
void MapPort(bool fMapPort);
void DNSAddressSeed();
-bool BindListenPort(string& strError=REF(string()));
+bool BindListenPort(std::string& strError=REF(std::string()));
void StartNode(void* parg);
bool StopNode();
@@ -50,7 +68,7 @@ bool StopNode();
// (4) size
// (4) checksum
-extern char pchMessageStart[4];
+extern unsigned char pchMessageStart[4];
class CMessageHeader
{
@@ -87,12 +105,12 @@ public:
READWRITE(nChecksum);
)
- string GetCommand()
+ std::string GetCommand()
{
if (pchCommand[COMMAND_SIZE-1] == 0)
- return string(pchCommand, pchCommand + strlen(pchCommand));
+ return std::string(pchCommand, pchCommand + strlen(pchCommand));
else
- return string(pchCommand, pchCommand + COMMAND_SIZE);
+ return std::string(pchCommand, pchCommand + COMMAND_SIZE);
}
bool IsValid()
@@ -156,7 +174,7 @@ public:
{
Init();
ip = ipIn;
- port = (portIn == 0 ? GetDefaultPort() : portIn);
+ port = htons(portIn == 0 ? GetDefaultPort() : portIn);
nServices = nServicesIn;
}
@@ -168,54 +186,38 @@ public:
nServices = nServicesIn;
}
- explicit CAddress(const char* pszIn, uint64 nServicesIn=NODE_NETWORK)
+ explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
{
Init();
- SetAddress(pszIn);
- nServices = nServicesIn;
+ Lookup(pszIn, *this, nServicesIn, fNameLookup, portIn);
}
- explicit CAddress(string strIn, uint64 nServicesIn=NODE_NETWORK)
+ explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
{
Init();
- SetAddress(strIn.c_str());
- nServices = nServicesIn;
+ Lookup(pszIn, *this, nServicesIn, fNameLookup, 0, true);
}
- void Init()
+ explicit CAddress(std::string strIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
{
- nServices = NODE_NETWORK;
- memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
- ip = INADDR_NONE;
- port = GetDefaultPort();
- nTime = 100000000;
- nLastTry = 0;
+ Init();
+ Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, portIn);
}
- bool SetAddress(const char* pszIn)
+ explicit CAddress(std::string strIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
{
- ip = INADDR_NONE;
- port = GetDefaultPort();
- char psz[100];
- strlcpy(psz, pszIn, sizeof(psz));
- unsigned int a=0, b=0, c=0, d=0, e=0;
- if (sscanf(psz, "%u.%u.%u.%u:%u", &a, &b, &c, &d, &e) < 4)
- return false;
- char* pszPort = strchr(psz, ':');
- if (pszPort)
- {
- *pszPort++ = '\0';
- port = htons(atoi(pszPort));
- if (atoi(pszPort) < 0 || atoi(pszPort) > USHRT_MAX)
- port = htons(USHRT_MAX);
- }
- ip = inet_addr(psz);
- return IsValid();
+ Init();
+ Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, 0, true);
}
- bool SetAddress(string strIn)
+ void Init()
{
- return SetAddress(strIn.c_str());
+ nServices = NODE_NETWORK;
+ memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
+ ip = INADDR_NONE;
+ port = htons(GetDefaultPort());
+ nTime = 100000000;
+ nLastTry = 0;
}
IMPLEMENT_SERIALIZE
@@ -259,16 +261,16 @@ public:
return false;
}
- vector<unsigned char> GetKey() const
+ std::vector<unsigned char> GetKey() const
{
CDataStream ss;
ss.reserve(18);
ss << FLATDATA(pchReserved) << ip << port;
#if defined(_MSC_VER) && _MSC_VER < 1300
- return vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
+ return std::vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
#else
- return vector<unsigned char>(ss.begin(), ss.end());
+ return std::vector<unsigned char>(ss.begin(), ss.end());
#endif
}
@@ -287,13 +289,29 @@ public:
return (memcmp(pchReserved, pchIPv4, sizeof(pchIPv4)) == 0);
}
+ bool IsRFC1918() const
+ {
+ return IsIPv4() && (GetByte(3) == 10 ||
+ (GetByte(3) == 192 && GetByte(2) == 168) ||
+ (GetByte(3) == 172 &&
+ (GetByte(2) >= 16 && GetByte(2) <= 31)));
+ }
+
+ bool IsRFC3927() const
+ {
+ return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254);
+ }
+
+ bool IsLocal() const
+ {
+ return IsIPv4() && (GetByte(3) == 127 ||
+ GetByte(3) == 0);
+ }
+
bool IsRoutable() const
{
return IsValid() &&
- !(GetByte(3) == 10 ||
- (GetByte(3) == 192 && GetByte(2) == 168) ||
- GetByte(3) == 127 ||
- GetByte(3) == 0);
+ !(IsRFC1918() || IsRFC3927() || IsLocal());
}
bool IsValid() const
@@ -315,27 +333,22 @@ public:
return ((unsigned char*)&ip)[3-n];
}
- string ToStringIPPort() const
+ std::string ToStringIPPort() const
{
return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
}
- string ToStringIP() const
+ std::string ToStringIP() const
{
return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0));
}
- string ToStringPort() const
+ std::string ToStringPort() const
{
return strprintf("%u", ntohs(port));
}
- string ToStringLog() const
- {
- return "";
- }
-
- string ToString() const
+ std::string ToString() const
{
return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
}
@@ -383,7 +396,7 @@ public:
hash = hashIn;
}
- CInv(const string& strType, const uint256& hashIn)
+ CInv(const std::string& strType, const uint256& hashIn)
{
int i;
for (i = 1; i < ARRAYLEN(ppszTypeName); i++)
@@ -422,7 +435,7 @@ public:
return ppszTypeName[type];
}
- string ToString() const
+ std::string ToString() const
{
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
}
@@ -460,21 +473,22 @@ public:
extern bool fClient;
+extern bool fAllowDNS;
extern uint64 nLocalServices;
extern CAddress addrLocalHost;
extern CNode* pnodeLocalHost;
extern uint64 nLocalHostNonce;
-extern array<int, 10> vnThreadsRunning;
+extern boost::array<int, 10> vnThreadsRunning;
extern SOCKET hListenSocket;
-extern vector<CNode*> vNodes;
+extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
-extern map<vector<unsigned char>, CAddress> mapAddresses;
+extern std::map<std::vector<unsigned char>, CAddress> mapAddresses;
extern CCriticalSection cs_mapAddresses;
-extern map<CInv, CDataStream> mapRelay;
-extern deque<pair<int64, CInv> > vRelayExpiration;
+extern std::map<CInv, CDataStream> mapRelay;
+extern std::deque<std::pair<int64, CInv> > vRelayExpiration;
extern CCriticalSection cs_mapRelay;
-extern map<CInv, int64> mapAlreadyAskedFor;
+extern std::map<CInv, int64> mapAlreadyAskedFor;
// Settings
extern int fUseProxy;
@@ -503,7 +517,7 @@ public:
unsigned int nMessageStart;
CAddress addr;
int nVersion;
- string strSubVer;
+ std::string strSubVer;
bool fClient;
bool fInbound;
bool fNetworkNode;
@@ -513,7 +527,7 @@ protected:
int nRefCount;
public:
int64 nReleaseTime;
- map<uint256, CRequestTracker> mapRequests;
+ std::map<uint256, CRequestTracker> mapRequests;
CCriticalSection cs_mapRequests;
uint256 hashContinue;
CBlockIndex* pindexLastGetBlocksBegin;
@@ -521,19 +535,19 @@ public:
int nStartingHeight;
// flood relay
- vector<CAddress> vAddrToSend;
- set<CAddress> setAddrKnown;
+ std::vector<CAddress> vAddrToSend;
+ std::set<CAddress> setAddrKnown;
bool fGetAddr;
- set<uint256> setKnown;
+ std::set<uint256> setKnown;
// inventory based relay
- set<CInv> setInventoryKnown;
- vector<CInv> vInventoryToSend;
+ std::set<CInv> setInventoryKnown;
+ std::vector<CInv> vInventoryToSend;
CCriticalSection cs_inventory;
- multimap<int64, CInv> mapAskFor;
+ std::multimap<int64, CInv> mapAskFor;
// publish and subscription
- vector<char> vfSubscribe;
+ std::vector<char> vfSubscribe;
CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false)
@@ -595,13 +609,13 @@ public:
int GetRefCount()
{
- return max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
+ return std::max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
}
CNode* AddRef(int64 nTimeout=0)
{
if (nTimeout != 0)
- nReleaseTime = max(nReleaseTime, GetTime() + nTimeout);
+ nReleaseTime = std::max(nReleaseTime, GetTime() + nTimeout);
else
nRefCount++;
return this;
@@ -652,18 +666,18 @@ public:
// Make sure not to reuse time indexes to keep things in the same order
int64 nNow = (GetTime() - 1) * 1000000;
static int64 nLastTime;
- nLastTime = nNow = max(nNow, ++nLastTime);
+ nLastTime = nNow = std::max(nNow, ++nLastTime);
// Each retry is 2 minutes after the last
- nRequestTime = max(nRequestTime + 2 * 60 * 1000000, nNow);
- mapAskFor.insert(make_pair(nRequestTime, inv));
+ nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);
+ mapAskFor.insert(std::make_pair(nRequestTime, inv));
}
void BeginMessage(const char* pszCommand)
{
- cs_vSend.Enter();
+ cs_vSend.Enter("cs_vSend", __FILE__, __LINE__);
if (nHeaderStart != -1)
AbortMessage();
nHeaderStart = vSend.size();
@@ -740,7 +754,7 @@ public:
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
- nLocalHostNonce, string(pszSubVer), nBestHeight);
+ nLocalHostNonce, std::string(pszSubVer), nBestHeight);
}
@@ -966,7 +980,7 @@ inline void RelayInventory(const CInv& inv)
{
// Put on lists to offer to the other nodes
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushInventory(inv);
}
@@ -993,7 +1007,7 @@ inline void RelayMessage<>(const CInv& inv, const CDataStream& ss)
// Save original serialized message so newer versions are preserved
mapRelay[inv] = ss;
- vRelayExpiration.push_back(make_pair(GetTime() + 15 * 60, inv));
+ vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv));
}
RelayInventory(inv);
@@ -1025,7 +1039,7 @@ void AdvertStartPublish(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
// Relay
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode != pfrom && (nHops < PUBLISH_HOPS || pnode->IsSubscribed(nChannel)))
pnode->PushMessage("publish", nChannel, nHops, obj);
}
@@ -1036,7 +1050,7 @@ void AdvertStopPublish(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
uint256 hash = obj.GetHash();
CRITICAL_BLOCK(cs_vNodes)
- foreach(CNode* pnode, vNodes)
+ BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode != pfrom && (nHops < PUBLISH_HOPS || pnode->IsSubscribed(nChannel)))
pnode->PushMessage("pub-cancel", nChannel, nHops, hash);
@@ -1053,3 +1067,5 @@ void AdvertRemoveSource(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
if (obj.setSources.empty())
AdvertStopPublish(pfrom, nChannel, nHops, obj);
}
+
+#endif
diff --git a/noui.h b/src/noui.h
index d108184dea..cbe6fa4c7b 100644
--- a/noui.h
+++ b/src/noui.h
@@ -1,7 +1,13 @@
// Copyright (c) 2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_NOUI_H
+#define BITCOIN_NOUI_H
+#include <string>
+#include <boost/function.hpp>
+#include "wallet.h"
typedef void wxWindow;
#define wxYES 0x00000002
@@ -31,7 +37,7 @@ typedef void wxWindow;
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
-inline int MyMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
+inline int MyMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
printf("%s: %s\n", caption.c_str(), message.c_str());
fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str());
@@ -39,17 +45,17 @@ inline int MyMessageBox(const string& message, const string& caption="Message",
}
#define wxMessageBox MyMessageBox
-inline int ThreadSafeMessageBox(const string& message, const string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
+inline int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
return MyMessageBox(message, caption, style, parent, x, y);
}
-inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
+inline bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent)
{
return true;
}
-inline void CalledSetStatusBar(const string& strText, int nField)
+inline void CalledSetStatusBar(const std::string& strText, int nField)
{
}
@@ -60,3 +66,5 @@ inline void UIThreadCall(boost::function0<void> fn)
inline void MainFrameRepaint()
{
}
+
+#endif
diff --git a/obj/.gitignore b/src/obj/.gitignore
index d6b7ef32c8..d6b7ef32c8 100644
--- a/obj/.gitignore
+++ b/src/obj/.gitignore
diff --git a/obj/nogui/.gitignore b/src/obj/nogui/.gitignore
index d6b7ef32c8..d6b7ef32c8 100644
--- a/obj/nogui/.gitignore
+++ b/src/obj/nogui/.gitignore
diff --git a/src/obj/test/.gitignore b/src/obj/test/.gitignore
new file mode 100644
index 0000000000..d6b7ef32c8
--- /dev/null
+++ b/src/obj/test/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/rpc.cpp b/src/rpc.cpp
index 2175dddb4b..9e7cfc5b3c 100644
--- a/rpc.cpp
+++ b/src/rpc.cpp
@@ -1,15 +1,22 @@
// Copyright (c) 2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
#include "cryptopp/sha.h"
+#include "db.h"
+#include "net.h"
+#include "init.h"
#undef printf
#include <boost/asio.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
+#include <boost/algorithm/string.hpp>
#ifdef USE_SSL
#include <boost/asio/ssl.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream;
#endif
#include "json/json_spirit_reader_template.h"
@@ -21,6 +28,8 @@ typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream;
// a certain size around 145MB. If we need access to json_spirit outside this
// file, we could use the compiled json_spirit option.
+using namespace std;
+using namespace boost;
using namespace boost::asio;
using namespace json_spirit;
@@ -28,6 +37,9 @@ void ThreadRPCServer2(void* parg);
typedef Value(*rpcfn_type)(const Array& params, bool fHelp);
extern map<string, rpcfn_type> mapCallTable;
+static int64 nWalletUnlockTime;
+static CCriticalSection cs_nWalletUnlockTime;
+
Object JSONRPCError(int code, const string& message)
{
@@ -81,7 +93,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
entry.push_back(Pair("confirmations", wtx.GetDepthInMainChain()));
entry.push_back(Pair("txid", wtx.GetHash().GetHex()));
entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime()));
- foreach(const PAIRTYPE(string,string)& item, wtx.mapValue)
+ BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second));
}
@@ -197,12 +209,26 @@ double GetDifficulty()
{
// Floating point number that is a multiple of the minimum difficulty,
// minimum difficulty = 1.0.
+
if (pindexBest == NULL)
return 1.0;
- int nShift = 256 - 32 - 31; // to fit in a uint
- double dMinimum = (CBigNum().SetCompact(bnProofOfWorkLimit.GetCompact()) >> nShift).getuint();
- double dCurrently = (CBigNum().SetCompact(pindexBest->nBits) >> nShift).getuint();
- return dMinimum / dCurrently;
+ int nShift = (pindexBest->nBits >> 24) & 0xff;
+
+ double dDiff =
+ (double)0x0000ffff / (double)(pindexBest->nBits & 0x00ffffff);
+
+ while (nShift < 29)
+ {
+ dDiff *= 256.0;
+ nShift++;
+ }
+ while (nShift > 29)
+ {
+ dDiff /= 256.0;
+ nShift--;
+ }
+
+ return dDiff;
}
Value getdifficulty(const Array& params, bool fHelp)
@@ -243,14 +269,14 @@ Value setgenerate(const Array& params, bool fHelp)
{
int nGenProcLimit = params[1].get_int();
fLimitProcessors = (nGenProcLimit != -1);
- CWalletDB().WriteSetting("fLimitProcessors", fLimitProcessors);
+ WriteSetting("fLimitProcessors", fLimitProcessors);
if (nGenProcLimit != -1)
- CWalletDB().WriteSetting("nLimitProcessors", nLimitProcessors = nGenProcLimit);
+ WriteSetting("nLimitProcessors", nLimitProcessors = nGenProcLimit);
if (nGenProcLimit == 0)
fGenerate = false;
}
- GenerateBitcoins(fGenerate);
+ GenerateBitcoins(fGenerate, pwalletMain);
return Value::null;
}
@@ -277,7 +303,7 @@ Value getinfo(const Array& params, bool fHelp)
Object obj;
obj.push_back(Pair("version", (int)VERSION));
- obj.push_back(Pair("balance", ValueFromAmount(GetBalance())));
+ 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", (fUseProxy ? addrProxy.ToStringIPPort() : string())));
@@ -286,8 +312,11 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("hashespersec", gethashespersec(params, false)));
obj.push_back(Pair("testnet", fTestNet));
- obj.push_back(Pair("keypoololdest", (boost::int64_t)GetOldestKeyPoolTime()));
+ obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
+ obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize()));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
+ if (pwalletMain->IsCrypted())
+ obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
@@ -302,59 +331,74 @@ Value getnewaddress(const Array& params, bool fHelp)
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
+ if (!pwalletMain->IsLocked())
+ pwalletMain->TopUpKeyPool();
+
+ if (pwalletMain->GetKeyPoolSize() < 1)
+ throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first");
+
// Parse the account first so we don't generate a key if there's an error
string strAccount;
if (params.size() > 0)
strAccount = AccountFromValue(params[0]);
// Generate a new key that is added to wallet
- string strAddress = PubKeyToAddress(GetKeyFromKeyPool());
+ CBitcoinAddress address(pwalletMain->GetOrReuseKeyFromPool());
- SetAddressBookName(strAddress, strAccount);
- return strAddress;
+ // This could be done in the same main CS as GetKeyFromKeyPool.
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ pwalletMain->SetAddressBookName(address, strAccount);
+
+ return address.ToString();
}
-// requires cs_main, cs_mapWallet locks
-string GetAccountAddress(string strAccount, bool bForceNew=false)
+// requires cs_main, cs_mapWallet, cs_mapAddressBook locks
+CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
{
- string strAddress;
-
- CWalletDB walletdb;
- walletdb.TxnBegin();
+ CWalletDB walletdb(pwalletMain->strWalletFile);
CAccount account;
- walletdb.ReadAccount(strAccount, account);
-
- // Check if the current key has been used
- if (!account.vchPubKey.empty())
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- CScript scriptPubKey;
- scriptPubKey.SetBitcoinAddress(account.vchPubKey);
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin();
- it != mapWallet.end() && !account.vchPubKey.empty();
- ++it)
+ walletdb.ReadAccount(strAccount, account);
+
+ bool bKeyUsed = false;
+
+ // Check if the current key has been used
+ if (!account.vchPubKey.empty())
{
- const CWalletTx& wtx = (*it).second;
- foreach(const CTxOut& txout, wtx.vout)
- if (txout.scriptPubKey == scriptPubKey)
- account.vchPubKey.clear();
+ CScript scriptPubKey;
+ scriptPubKey.SetBitcoinAddress(account.vchPubKey);
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin();
+ it != pwalletMain->mapWallet.end() && !account.vchPubKey.empty();
+ ++it)
+ {
+ const CWalletTx& wtx = (*it).second;
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ if (txout.scriptPubKey == scriptPubKey)
+ bKeyUsed = true;
+ }
}
- }
- // Generate a new key
- if (account.vchPubKey.empty() || bForceNew)
- {
- account.vchPubKey = GetKeyFromKeyPool();
- string strAddress = PubKeyToAddress(account.vchPubKey);
- SetAddressBookName(strAddress, strAccount);
- walletdb.WriteAccount(strAccount, account);
+ // Generate a new key
+ if (account.vchPubKey.empty() || bForceNew || bKeyUsed)
+ {
+ if (pwalletMain->GetKeyPoolSize() < 1)
+ {
+ if (bKeyUsed || bForceNew)
+ throw JSONRPCError(-12, "Error: Keypool ran out, please call topupkeypool first");
+ }
+ else
+ {
+ account.vchPubKey = pwalletMain->GetOrReuseKeyFromPool();
+ pwalletMain->SetAddressBookName(CBitcoinAddress(account.vchPubKey), strAccount);
+ walletdb.WriteAccount(strAccount, account);
+ }
+ }
}
- walletdb.TxnCommit();
- strAddress = PubKeyToAddress(account.vchPubKey);
-
- return strAddress;
+ return CBitcoinAddress(account.vchPubKey);
}
Value getaccountaddress(const Array& params, bool fHelp)
@@ -370,9 +414,10 @@ Value getaccountaddress(const Array& params, bool fHelp)
Value ret;
CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- ret = GetAccountAddress(strAccount);
+ ret = GetAccountAddress(strAccount).ToString();
}
return ret;
@@ -387,10 +432,8 @@ Value setaccount(const Array& params, bool fHelp)
"setaccount <bitcoinaddress> <account>\n"
"Sets the account associated with the given address.");
- string strAddress = params[0].get_str();
- uint160 hash160;
- bool isValid = AddressToHash160(strAddress, hash160);
- if (!isValid)
+ CBitcoinAddress address(params[0].get_str());
+ if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address");
@@ -400,18 +443,19 @@ Value setaccount(const Array& params, bool fHelp)
// Detect when changing the account of an address that is the 'unused current key' of another account:
CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- if (mapAddressBook.count(strAddress))
+ if (pwalletMain->mapAddressBook.count(address))
{
- string strOldAccount = mapAddressBook[strAddress];
- if (strAddress == GetAccountAddress(strOldAccount))
+ string strOldAccount = pwalletMain->mapAddressBook[address];
+ if (address == GetAccountAddress(strOldAccount))
GetAccountAddress(strOldAccount, true);
}
+
+ pwalletMain->SetAddressBookName(address, strAccount);
}
- SetAddressBookName(strAddress, strAccount);
return Value::null;
}
@@ -423,13 +467,15 @@ Value getaccount(const Array& params, bool fHelp)
"getaccount <bitcoinaddress>\n"
"Returns the account associated with the given address.");
- string strAddress = params[0].get_str();
+ CBitcoinAddress address(params[0].get_str());
+ if (!address.IsValid())
+ throw JSONRPCError(-5, "Invalid bitcoin address");
string strAccount;
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- map<string, string>::iterator mi = mapAddressBook.find(strAddress);
- if (mi != mapAddressBook.end() && !(*mi).second.empty())
+ map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address);
+ if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
strAccount = (*mi).second;
}
return strAccount;
@@ -447,32 +493,50 @@ Value getaddressesbyaccount(const Array& params, bool fHelp)
// Find all addresses that have the given account
Array ret;
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- foreach(const PAIRTYPE(string, string)& item, mapAddressBook)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
- const string& strAddress = item.first;
+ const CBitcoinAddress& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
- {
- // We're only adding valid bitcoin addresses and not ip addresses
- CScript scriptPubKey;
- if (scriptPubKey.SetBitcoinAddress(strAddress))
- ret.push_back(strAddress);
- }
+ ret.push_back(address.ToString());
}
}
return ret;
}
+Value settxfee(const Array& params, bool fHelp)
+{
+ if (fHelp || params.size() < 1 || params.size() > 1)
+ throw runtime_error(
+ "settxfee <amount>\n"
+ "<amount> is a real and is rounded to the nearest 0.00000001");
+
+ // Amount
+ int64 nAmount = 0;
+ if (params[0].get_real() != 0.0)
+ nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts
+
+ nTransactionFee = nAmount;
+ return true;
+}
+
Value sendtoaddress(const Array& params, bool fHelp)
{
- if (fHelp || params.size() < 2 || params.size() > 4)
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
+ throw runtime_error(
+ "sendtoaddress <bitcoinaddress> <amount> [comment] [comment-to]\n"
+ "<amount> is a real and is rounded to the nearest 0.00000001\n"
+ "requires wallet passphrase to be set with walletpassphrase first");
+ if (!pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
throw runtime_error(
"sendtoaddress <bitcoinaddress> <amount> [comment] [comment-to]\n"
- "<amount> is a real and is rounded to the nearest 0.01");
+ "<amount> is a real and is rounded to the nearest 0.00000001");
- string strAddress = params[0].get_str();
+ CBitcoinAddress address(params[0].get_str());
+ if (!address.IsValid())
+ throw JSONRPCError(-5, "Invalid bitcoin address");
// Amount
int64 nAmount = AmountFromValue(params[1]);
@@ -485,8 +549,12 @@ Value sendtoaddress(const Array& params, bool fHelp)
wtx.mapValue["to"] = params[3].get_str();
CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
{
- string strError = SendMoneyToBitcoinAddress(strAddress, nAmount, wtx);
+ if(pwalletMain->IsLocked())
+ throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+
+ string strError = pwalletMain->SendMoneyToBitcoinAddress(address, nAmount, wtx);
if (strError != "")
throw JSONRPCError(-4, strError);
}
@@ -503,11 +571,12 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
"Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.");
// Bitcoin address
- string strAddress = params[0].get_str();
+ CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
- if (!scriptPubKey.SetBitcoinAddress(strAddress))
+ if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address");
- if (!IsMine(scriptPubKey))
+ scriptPubKey.SetBitcoinAddress(address);
+ if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
// Minimum confirmations
@@ -517,15 +586,15 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
// Tally
int64 nAmount = 0;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
continue;
- foreach(const CTxOut& txout, wtx.vout)
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
@@ -536,22 +605,16 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
}
-void GetAccountPubKeys(string strAccount, set<CScript>& setPubKey)
+void GetAccountAddresses(string strAccount, set<CBitcoinAddress>& setAddress)
{
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- foreach(const PAIRTYPE(string, string)& item, mapAddressBook)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
- const string& strAddress = item.first;
+ const CBitcoinAddress& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
- {
- // We're only counting our own valid bitcoin addresses and not ip addresses
- CScript scriptPubKey;
- if (scriptPubKey.SetBitcoinAddress(strAddress))
- if (IsMine(scriptPubKey))
- setPubKey.insert(scriptPubKey);
- }
+ setAddress.insert(address);
}
}
}
@@ -571,23 +634,26 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
// Get the set of pub keys that have the label
string strAccount = AccountFromValue(params[0]);
- set<CScript> setPubKey;
- GetAccountPubKeys(strAccount, setPubKey);
+ set<CBitcoinAddress> setAddress;
+ GetAccountAddresses(strAccount, setAddress);
// Tally
int64 nAmount = 0;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
continue;
- foreach(const CTxOut& txout, wtx.vout)
- if (setPubKey.count(txout.scriptPubKey))
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ {
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, pwalletMain, address) && setAddress.count(address))
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
+ }
}
}
@@ -598,10 +664,10 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
{
int64 nBalance = 0;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
// Tally wallet transactions
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsFinal())
@@ -624,21 +690,21 @@ int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinD
int64 GetAccountBalance(const string& strAccount, int nMinDepth)
{
- CWalletDB walletdb;
+ CWalletDB walletdb(pwalletMain->strWalletFile);
return GetAccountBalance(walletdb, strAccount, nMinDepth);
}
Value getbalance(const Array& params, bool fHelp)
{
- if (fHelp || params.size() < 0 || params.size() > 2)
+ if (fHelp || params.size() > 2)
throw runtime_error(
"getbalance [account] [minconf=1]\n"
"If [account] is not specified, returns the server's total available balance.\n"
"If [account] is specified, returns the balance in the account.");
if (params.size() == 0)
- return ValueFromAmount(GetBalance());
+ return ValueFromAmount(pwalletMain->GetBalance());
int nMinDepth = 1;
if (params.size() > 1)
@@ -649,7 +715,7 @@ Value getbalance(const Array& params, bool fHelp)
// (GetBalance() sums up all unspent TxOuts)
// getbalance and getbalance '*' should always return the same number.
int64 nBalance = 0;
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsFinal())
@@ -658,13 +724,13 @@ Value getbalance(const Array& params, bool fHelp)
int64 allGeneratedImmature, allGeneratedMature, allFee;
allGeneratedImmature = allGeneratedMature = allFee = 0;
string strSentAccount;
- list<pair<string, int64> > listReceived;
- list<pair<string, int64> > listSent;
+ list<pair<CBitcoinAddress, int64> > listReceived;
+ list<pair<CBitcoinAddress, int64> > listSent;
wtx.GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
if (wtx.GetDepthInMainChain() >= nMinDepth)
- foreach(const PAIRTYPE(string,int64)& r, listReceived)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived)
nBalance += r.second;
- foreach(const PAIRTYPE(string,int64)& r, listSent)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listSent)
nBalance -= r.second;
nBalance -= allFee;
nBalance += allGeneratedMature;
@@ -690,33 +756,18 @@ Value movecmd(const Array& params, bool fHelp)
string strFrom = AccountFromValue(params[0]);
string strTo = AccountFromValue(params[1]);
int64 nAmount = AmountFromValue(params[2]);
- int nMinDepth = 1;
if (params.size() > 3)
- nMinDepth = params[3].get_int();
+ // unused parameter, used to be nMinDepth, keep type-checking it though
+ (void)params[3].get_int();
string strComment;
if (params.size() > 4)
strComment = params[4].get_str();
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- CWalletDB walletdb;
+ CWalletDB walletdb(pwalletMain->strWalletFile);
walletdb.TxnBegin();
- // Check funds
- if (!strFrom.empty())
- {
- int64 nBalance = GetAccountBalance(walletdb, strFrom, nMinDepth);
- if (nAmount > nBalance)
- throw JSONRPCError(-6, "Account has insufficient funds");
- }
- else
- {
- // move from "" account special case
- int64 nBalance = GetAccountBalance(walletdb, strTo, nMinDepth);
- if (nAmount > GetBalance() - nBalance)
- throw JSONRPCError(-6, "Account has insufficient funds");
- }
-
int64 nNow = GetAdjustedTime();
// Debit
@@ -745,13 +796,20 @@ Value movecmd(const Array& params, bool fHelp)
Value sendfrom(const Array& params, bool fHelp)
{
- if (fHelp || params.size() < 3 || params.size() > 6)
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() < 3 || params.size() > 6))
+ throw runtime_error(
+ "sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
+ "<amount> is a real and is rounded to the nearest 0.00000001\n"
+ "requires wallet passphrase to be set with walletpassphrase first");
+ if (!pwalletMain->IsCrypted() && (fHelp || params.size() < 3 || params.size() > 6))
throw runtime_error(
"sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
- "<amount> is a real and is rounded to the nearest 0.01");
+ "<amount> is a real and is rounded to the nearest 0.00000001");
string strAccount = AccountFromValue(params[0]);
- string strAddress = params[1].get_str();
+ CBitcoinAddress address(params[1].get_str());
+ if (!address.IsValid())
+ throw JSONRPCError(-5, "Invalid bitcoin address");
int64 nAmount = AmountFromValue(params[2]);
int nMinDepth = 1;
if (params.size() > 3)
@@ -765,15 +823,19 @@ Value sendfrom(const Array& params, bool fHelp)
wtx.mapValue["to"] = params[5].get_str();
CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
{
+ if(pwalletMain->IsLocked())
+ throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (nAmount > nBalance)
throw JSONRPCError(-6, "Account has insufficient funds");
// Send
- string strError = SendMoneyToBitcoinAddress(strAddress, nAmount, wtx);
+ string strError = pwalletMain->SendMoneyToBitcoinAddress(address, nAmount, wtx);
if (strError != "")
throw JSONRPCError(-4, strError);
}
@@ -781,9 +843,15 @@ Value sendfrom(const Array& params, bool fHelp)
return wtx.GetHash().GetHex();
}
+
Value sendmany(const Array& params, bool fHelp)
{
- if (fHelp || params.size() < 2 || params.size() > 4)
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
+ throw runtime_error(
+ "sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]\n"
+ "amounts are double-precision floating point numbers\n"
+ "requires wallet passphrase to be set with walletpassphrase first");
+ if (!pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 4))
throw runtime_error(
"sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]\n"
"amounts are double-precision floating point numbers");
@@ -799,22 +867,22 @@ Value sendmany(const Array& params, bool fHelp)
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["comment"] = params[3].get_str();
- set<string> setAddress;
+ set<CBitcoinAddress> setAddress;
vector<pair<CScript, int64> > vecSend;
int64 totalAmount = 0;
- foreach(const Pair& s, sendTo)
+ BOOST_FOREACH(const Pair& s, sendTo)
{
- uint160 hash160;
- string strAddress = s.name_;
+ CBitcoinAddress address(s.name_);
+ if (!address.IsValid())
+ throw JSONRPCError(-5, string("Invalid bitcoin address:")+s.name_);
- if (setAddress.count(strAddress))
- throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+strAddress);
- setAddress.insert(strAddress);
+ if (setAddress.count(address))
+ throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_);
+ setAddress.insert(address);
CScript scriptPubKey;
- if (!scriptPubKey.SetBitcoinAddress(strAddress))
- throw JSONRPCError(-5, string("Invalid bitcoin address:")+strAddress);
+ scriptPubKey.SetBitcoinAddress(address);
int64 nAmount = AmountFromValue(s.value_);
totalAmount += nAmount;
@@ -822,24 +890,28 @@ Value sendmany(const Array& params, bool fHelp)
}
CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
{
+ if(pwalletMain->IsLocked())
+ throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (totalAmount > nBalance)
throw JSONRPCError(-6, "Account has insufficient funds");
// Send
- CReserveKey keyChange;
+ CReserveKey keyChange(pwalletMain);
int64 nFeeRequired = 0;
- bool fCreated = CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
+ bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
if (!fCreated)
{
- if (totalAmount + nFeeRequired > GetBalance())
+ if (totalAmount + nFeeRequired > pwalletMain->GetBalance())
throw JSONRPCError(-6, "Insufficient funds");
throw JSONRPCError(-4, "Transaction creation failed");
}
- if (!CommitTransaction(wtx, keyChange))
+ if (!pwalletMain->CommitTransaction(wtx, keyChange))
throw JSONRPCError(-4, "Transaction commit failed");
}
@@ -871,10 +943,10 @@ Value ListReceived(const Array& params, bool fByAccounts)
fIncludeEmpty = params[1].get_bool();
// Tally
- map<uint160, tallyitem> mapTally;
- CRITICAL_BLOCK(cs_mapWallet)
+ map<CBitcoinAddress, tallyitem> mapTally;
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
@@ -884,14 +956,13 @@ Value ListReceived(const Array& params, bool fByAccounts)
if (nDepth < nMinDepth)
continue;
- foreach(const CTxOut& txout, wtx.vout)
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
- // Only counting our own bitcoin addresses and not ip addresses
- uint160 hash160 = txout.scriptPubKey.GetBitcoinAddressHash160();
- if (hash160 == 0 || !mapPubKeys.count(hash160)) // IsMine
+ CBitcoinAddress address;
+ if (!ExtractAddress(txout.scriptPubKey, pwalletMain, address) || !address.IsValid())
continue;
- tallyitem& item = mapTally[hash160];
+ tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
}
@@ -901,16 +972,13 @@ Value ListReceived(const Array& params, bool fByAccounts)
// Reply
Array ret;
map<string, tallyitem> mapAccountTally;
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- foreach(const PAIRTYPE(string, string)& item, mapAddressBook)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
- const string& strAddress = item.first;
+ const CBitcoinAddress& address = item.first;
const string& strAccount = item.second;
- uint160 hash160;
- if (!AddressToHash160(strAddress, hash160))
- continue;
- map<uint160, tallyitem>::iterator it = mapTally.find(hash160);
+ map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
if (it == mapTally.end() && !fIncludeEmpty)
continue;
@@ -931,7 +999,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
else
{
Object obj;
- obj.push_back(Pair("address", strAddress));
+ obj.push_back(Pair("address", address.ToString()));
obj.push_back(Pair("account", strAccount));
obj.push_back(Pair("label", strAccount)); // deprecated
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
@@ -994,8 +1062,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
{
int64 nGeneratedImmature, nGeneratedMature, nFee;
string strSentAccount;
- list<pair<string, int64> > listReceived;
- list<pair<string, int64> > listSent;
+ list<pair<CBitcoinAddress, int64> > listReceived;
+ list<pair<CBitcoinAddress, int64> > listSent;
wtx.GetAmounts(nGeneratedImmature, nGeneratedMature, listReceived, listSent, nFee, strSentAccount);
bool fAllAccounts = (strAccount == string("*"));
@@ -1023,11 +1091,11 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
// Sent
if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
- foreach(const PAIRTYPE(string, int64)& s, listSent)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& s, listSent)
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
- entry.push_back(Pair("address", s.first));
+ entry.push_back(Pair("address", s.first.ToString()));
entry.push_back(Pair("category", "send"));
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
@@ -1039,18 +1107,18 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
// Received
if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- foreach(const PAIRTYPE(string, int64)& r, listReceived)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& r, listReceived)
{
string account;
- if (mapAddressBook.count(r.first))
- account = mapAddressBook[r.first];
+ if (pwalletMain->mapAddressBook.count(r.first))
+ account = pwalletMain->mapAddressBook[r.first];
if (fAllAccounts || (account == strAccount))
{
Object entry;
entry.push_back(Pair("account", account));
- entry.push_back(Pair("address", r.first));
+ entry.push_back(Pair("address", r.first.ToString()));
entry.push_back(Pair("category", "receive"));
entry.push_back(Pair("amount", ValueFromAmount(r.second)));
if (fLong)
@@ -1081,10 +1149,10 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar
Value listtransactions(const Array& params, bool fHelp)
{
- if (fHelp || params.size() > 2)
+ if (fHelp || params.size() > 3)
throw runtime_error(
- "listtransactions [account] [count=10]\n"
- "Returns up to [count] most recent transactions for account <account>.");
+ "listtransactions [account] [count=10] [from=0]\n"
+ "Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].");
string strAccount = "*";
if (params.size() > 0)
@@ -1092,31 +1160,36 @@ Value listtransactions(const Array& params, bool fHelp)
int nCount = 10;
if (params.size() > 1)
nCount = params[1].get_int();
+ int nFrom = 0;
+ if (params.size() > 2)
+ nFrom = params[2].get_int();
Array ret;
- CWalletDB walletdb;
+ CWalletDB walletdb(pwalletMain->strWalletFile);
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
// Firs: get all CWalletTx and CAccountingEntry into a sorted-by-time multimap:
typedef pair<CWalletTx*, CAccountingEntry*> TxPair;
typedef multimap<int64, TxPair > TxItems;
TxItems txByTime;
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
CWalletTx* wtx = &((*it).second);
txByTime.insert(make_pair(wtx->GetTxTime(), TxPair(wtx, (CAccountingEntry*)0)));
}
list<CAccountingEntry> acentries;
walletdb.ListAccountCreditDebit(strAccount, acentries);
- foreach(CAccountingEntry& entry, acentries)
+ BOOST_FOREACH(CAccountingEntry& entry, acentries)
{
txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry)));
}
// Now: iterate backwards until we have nCount items to return:
- for (TxItems::reverse_iterator it = txByTime.rbegin(); it != txByTime.rend(); ++it)
+ TxItems::reverse_iterator it = txByTime.rbegin();
+ if (txByTime.size() > nFrom) std::advance(it, nFrom);
+ for (; it != txByTime.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)
@@ -1154,32 +1227,31 @@ Value listaccounts(const Array& params, bool fHelp)
nMinDepth = params[0].get_int();
map<string, int64> mapAccountBalances;
- CRITICAL_BLOCK(cs_mapWallet)
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- foreach(const PAIRTYPE(string, string)& entry, mapAddressBook) {
- uint160 hash160;
- if(AddressToHash160(entry.first, hash160) && mapPubKeys.count(hash160)) // This address belongs to me
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& entry, pwalletMain->mapAddressBook) {
+ if (pwalletMain->HaveKey(entry.first)) // This address belongs to me
mapAccountBalances[entry.second] = 0;
}
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
int64 nGeneratedImmature, nGeneratedMature, nFee;
string strSentAccount;
- list<pair<string, int64> > listReceived;
- list<pair<string, int64> > listSent;
+ list<pair<CBitcoinAddress, int64> > listReceived;
+ list<pair<CBitcoinAddress, int64> > listSent;
wtx.GetAmounts(nGeneratedImmature, nGeneratedMature, listReceived, listSent, nFee, strSentAccount);
mapAccountBalances[strSentAccount] -= nFee;
- foreach(const PAIRTYPE(string, int64)& s, listSent)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& s, listSent)
mapAccountBalances[strSentAccount] -= s.second;
if (wtx.GetDepthInMainChain() >= nMinDepth)
{
mapAccountBalances[""] += nGeneratedMature;
- foreach(const PAIRTYPE(string, int64)& r, listReceived)
- if (mapAddressBook.count(r.first))
- mapAccountBalances[mapAddressBook[r.first]] += r.second;
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& r, listReceived)
+ if (pwalletMain->mapAddressBook.count(r.first))
+ mapAccountBalances[pwalletMain->mapAddressBook[r.first]] += r.second;
else
mapAccountBalances[""] += r.second;
}
@@ -1187,12 +1259,12 @@ Value listaccounts(const Array& params, bool fHelp)
}
list<CAccountingEntry> acentries;
- CWalletDB().ListAccountCreditDebit("*", acentries);
- foreach(const CAccountingEntry& entry, acentries)
+ CWalletDB(pwalletMain->strWalletFile).ListAccountCreditDebit("*", acentries);
+ BOOST_FOREACH(const CAccountingEntry& entry, acentries)
mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
Object ret;
- foreach(const PAIRTYPE(string, int64)& accountBalance, mapAccountBalances) {
+ BOOST_FOREACH(const PAIRTYPE(string, int64)& accountBalance, mapAccountBalances) {
ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
}
return ret;
@@ -1209,11 +1281,11 @@ Value gettransaction(const Array& params, bool fHelp)
hash.SetHex(params[0].get_str());
Object entry;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- if (!mapWallet.count(hash))
+ if (!pwalletMain->mapWallet.count(hash))
throw JSONRPCError(-5, "Invalid or non-wallet transaction id");
- const CWalletTx& wtx = mapWallet[hash];
+ const CWalletTx& wtx = pwalletMain->mapWallet[hash];
int64 nCredit = wtx.GetCredit();
int64 nDebit = wtx.GetDebit();
@@ -1224,10 +1296,10 @@ Value gettransaction(const Array& params, bool fHelp)
if (wtx.IsFromMe())
entry.push_back(Pair("fee", ValueFromAmount(nFee)));
- WalletTxToJSON(mapWallet[hash], entry);
+ WalletTxToJSON(pwalletMain->mapWallet[hash], entry);
Array details;
- ListTransactions(mapWallet[hash], "*", 0, false, details);
+ ListTransactions(pwalletMain->mapWallet[hash], "*", 0, false, details);
entry.push_back(Pair("details", details));
}
@@ -1243,7 +1315,220 @@ Value backupwallet(const Array& params, bool fHelp)
"Safely copies wallet.dat to destination, which can be a directory or a path with filename.");
string strDest = params[0].get_str();
- BackupWallet(strDest);
+ BackupWallet(*pwalletMain, strDest);
+
+ return Value::null;
+}
+
+
+Value keypoolrefill(const Array& params, bool fHelp)
+{
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() > 0))
+ throw runtime_error(
+ "keypoolrefill\n"
+ "Fills the keypool, requires wallet passphrase to be set.");
+ if (!pwalletMain->IsCrypted() && (fHelp || params.size() > 0))
+ throw runtime_error(
+ "keypoolrefill\n"
+ "Fills the keypool.");
+
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
+ {
+ if (pwalletMain->IsLocked())
+ throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
+
+ pwalletMain->TopUpKeyPool();
+ }
+
+ if (pwalletMain->GetKeyPoolSize() < GetArg("-keypool", 100))
+ throw JSONRPCError(-4, "Error refreshing keypool.");
+
+ return Value::null;
+}
+
+
+void ThreadTopUpKeyPool(void* parg)
+{
+ pwalletMain->TopUpKeyPool();
+}
+
+void ThreadCleanWalletPassphrase(void* parg)
+{
+ int64 nMyWakeTime = GetTime() + *((int*)parg);
+
+ if (nWalletUnlockTime == 0)
+ {
+ CRITICAL_BLOCK(cs_nWalletUnlockTime)
+ {
+ nWalletUnlockTime = nMyWakeTime;
+ }
+
+ while (GetTime() < nWalletUnlockTime)
+ Sleep(GetTime() - nWalletUnlockTime);
+
+ CRITICAL_BLOCK(cs_nWalletUnlockTime)
+ {
+ nWalletUnlockTime = 0;
+ }
+ }
+ else
+ {
+ CRITICAL_BLOCK(cs_nWalletUnlockTime)
+ {
+ if (nWalletUnlockTime < nMyWakeTime)
+ nWalletUnlockTime = nMyWakeTime;
+ }
+ free(parg);
+ return;
+ }
+
+ pwalletMain->Lock();
+
+ delete (int*)parg;
+}
+
+Value walletpassphrase(const Array& params, bool fHelp)
+{
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
+ throw runtime_error(
+ "walletpassphrase <passphrase> <timeout>\n"
+ "Stores the wallet decryption key in memory for <timeout> seconds.");
+ if (fHelp)
+ return true;
+ if (!pwalletMain->IsCrypted())
+ throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
+
+ if (!pwalletMain->IsLocked())
+ throw JSONRPCError(-17, "Error: Wallet is already unlocked.");
+
+ // Note that the walletpassphrase is stored in params[0] which is not mlock()ed
+ string strWalletPass;
+ strWalletPass.reserve(100);
+ mlock(&strWalletPass[0], strWalletPass.capacity());
+ strWalletPass = params[0].get_str();
+
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
+ {
+ if (strWalletPass.length() > 0)
+ {
+ if (!pwalletMain->Unlock(strWalletPass))
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+ }
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ }
+ else
+ throw runtime_error(
+ "walletpassphrase <passphrase> <timeout>\n"
+ "Stores the wallet decryption key in memory for <timeout> seconds.");
+ }
+
+ CreateThread(ThreadTopUpKeyPool, NULL);
+ int* pnSleepTime = new int(params[1].get_int());
+ CreateThread(ThreadCleanWalletPassphrase, pnSleepTime);
+
+ return Value::null;
+}
+
+
+Value walletpassphrasechange(const Array& params, bool fHelp)
+{
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
+ throw runtime_error(
+ "walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
+ "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
+ if (fHelp)
+ return true;
+ if (!pwalletMain->IsCrypted())
+ throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
+
+ string strOldWalletPass;
+ strOldWalletPass.reserve(100);
+ mlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ strOldWalletPass = params[0].get_str();
+
+ string strNewWalletPass;
+ strNewWalletPass.reserve(100);
+ mlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ strNewWalletPass = params[1].get_str();
+
+ if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
+ throw runtime_error(
+ "walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
+ "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
+
+ if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass))
+ {
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+ }
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+
+ return Value::null;
+}
+
+
+Value walletlock(const Array& params, bool fHelp)
+{
+ if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0))
+ throw runtime_error(
+ "walletlock\n"
+ "Removes the wallet encryption key from memory, locking the wallet.\n"
+ "After calling this method, you will need to call walletpassphrase again\n"
+ "before being able to call any methods which require the wallet to be unlocked.");
+ if (fHelp)
+ return true;
+ if (!pwalletMain->IsCrypted())
+ throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletlock was called.");
+
+ pwalletMain->Lock();
+ CRITICAL_BLOCK(cs_nWalletUnlockTime)
+ {
+ nWalletUnlockTime = 0;
+ }
+
+ return Value::null;
+}
+
+
+Value encryptwallet(const Array& params, bool fHelp)
+{
+ if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1))
+ throw runtime_error(
+ "encryptwallet <passphrase>\n"
+ "Encrypts the wallet with <passphrase>.");
+ if (fHelp)
+ return true;
+ if (pwalletMain->IsCrypted())
+ throw JSONRPCError(-15, "Error: running with an encrypted wallet, but encryptwallet was called.");
+
+ string strWalletPass;
+ strWalletPass.reserve(100);
+ mlock(&strWalletPass[0], strWalletPass.capacity());
+ strWalletPass = params[0].get_str();
+
+ if (strWalletPass.length() < 1)
+ throw runtime_error(
+ "encryptwallet <passphrase>\n"
+ "Encrypts the wallet with <passphrase>.");
+
+ if (!pwalletMain->EncryptWallet(strWalletPass))
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ throw JSONRPCError(-16, "Error: Failed to encrypt the wallet.");
+ }
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
return Value::null;
}
@@ -1256,9 +1541,8 @@ Value validateaddress(const Array& params, bool fHelp)
"validateaddress <bitcoinaddress>\n"
"Return information about <bitcoinaddress>.");
- string strAddress = params[0].get_str();
- uint160 hash160;
- bool isValid = AddressToHash160(strAddress, hash160);
+ CBitcoinAddress address(params[0].get_str());
+ bool isValid = address.IsValid();
Object ret;
ret.push_back(Pair("isvalid", isValid));
@@ -1266,13 +1550,13 @@ Value validateaddress(const Array& params, bool fHelp)
{
// Call Hash160ToAddress() so we always return current ADDRESSVERSION
// version of the address:
- string currentAddress = Hash160ToAddress(hash160);
+ string currentAddress = address.ToString();
ret.push_back(Pair("address", currentAddress));
- ret.push_back(Pair("ismine", (mapPubKeys.count(hash160) > 0)));
- CRITICAL_BLOCK(cs_mapAddressBook)
+ ret.push_back(Pair("ismine", (pwalletMain->HaveKey(address) > 0)));
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
- if (mapAddressBook.count(currentAddress))
- ret.push_back(Pair("account", mapAddressBook[currentAddress]));
+ if (pwalletMain->mapAddressBook.count(address))
+ ret.push_back(Pair("account", pwalletMain->mapAddressBook[address]));
}
}
return ret;
@@ -1299,7 +1583,7 @@ Value getwork(const Array& params, bool fHelp)
static map<uint256, pair<CBlock*, unsigned int> > mapNewBlock;
static vector<CBlock*> vNewBlock;
- static CReserveKey reservekey;
+ static CReserveKey reservekey(pwalletMain);
if (params.size() == 0)
{
@@ -1315,7 +1599,7 @@ Value getwork(const Array& params, bool fHelp)
{
// Deallocate old blocks since they're obsolete now
mapNewBlock.clear();
- foreach(CBlock* pblock, vNewBlock)
+ BOOST_FOREACH(CBlock* pblock, vNewBlock)
delete pblock;
vNewBlock.clear();
}
@@ -1380,7 +1664,7 @@ Value getwork(const Array& params, bool fHelp)
pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nBits << CBigNum(nExtraNonce);
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
- return CheckWork(pblock, reservekey);
+ return CheckWork(pblock, *pwalletMain, reservekey);
}
}
@@ -1400,43 +1684,49 @@ Value getwork(const Array& params, bool fHelp)
pair<string, rpcfn_type> pCallTable[] =
{
- make_pair("help", &help),
- make_pair("stop", &stop),
- make_pair("getblockcount", &getblockcount),
- make_pair("getblocknumber", &getblocknumber),
- make_pair("getconnectioncount", &getconnectioncount),
- make_pair("getdifficulty", &getdifficulty),
- make_pair("getgenerate", &getgenerate),
- make_pair("setgenerate", &setgenerate),
- make_pair("gethashespersec", &gethashespersec),
- make_pair("getinfo", &getinfo),
- make_pair("getnewaddress", &getnewaddress),
- make_pair("getaccountaddress", &getaccountaddress),
- make_pair("setaccount", &setaccount),
- make_pair("setlabel", &setaccount), // deprecated
- make_pair("getaccount", &getaccount),
- make_pair("getlabel", &getaccount), // deprecated
- make_pair("getaddressesbyaccount", &getaddressesbyaccount),
- make_pair("getaddressesbylabel", &getaddressesbyaccount), // deprecated
- make_pair("sendtoaddress", &sendtoaddress),
- make_pair("getamountreceived", &getreceivedbyaddress), // deprecated, renamed to getreceivedbyaddress
- make_pair("getallreceived", &listreceivedbyaddress), // deprecated, renamed to listreceivedbyaddress
- make_pair("getreceivedbyaddress", &getreceivedbyaddress),
- make_pair("getreceivedbyaccount", &getreceivedbyaccount),
- make_pair("getreceivedbylabel", &getreceivedbyaccount), // deprecated
- make_pair("listreceivedbyaddress", &listreceivedbyaddress),
- make_pair("listreceivedbyaccount", &listreceivedbyaccount),
- make_pair("listreceivedbylabel", &listreceivedbyaccount), // deprecated
- make_pair("backupwallet", &backupwallet),
- make_pair("validateaddress", &validateaddress),
- make_pair("getbalance", &getbalance),
- make_pair("move", &movecmd),
- make_pair("sendfrom", &sendfrom),
- make_pair("sendmany", &sendmany),
- make_pair("gettransaction", &gettransaction),
- make_pair("listtransactions", &listtransactions),
- make_pair("getwork", &getwork),
- make_pair("listaccounts", &listaccounts),
+ make_pair("help", &help),
+ make_pair("stop", &stop),
+ make_pair("getblockcount", &getblockcount),
+ make_pair("getblocknumber", &getblocknumber),
+ make_pair("getconnectioncount", &getconnectioncount),
+ make_pair("getdifficulty", &getdifficulty),
+ make_pair("getgenerate", &getgenerate),
+ make_pair("setgenerate", &setgenerate),
+ make_pair("gethashespersec", &gethashespersec),
+ make_pair("getinfo", &getinfo),
+ make_pair("getnewaddress", &getnewaddress),
+ make_pair("getaccountaddress", &getaccountaddress),
+ make_pair("setaccount", &setaccount),
+ make_pair("setlabel", &setaccount), // deprecated
+ make_pair("getaccount", &getaccount),
+ make_pair("getlabel", &getaccount), // deprecated
+ make_pair("getaddressesbyaccount", &getaddressesbyaccount),
+ make_pair("getaddressesbylabel", &getaddressesbyaccount), // deprecated
+ make_pair("sendtoaddress", &sendtoaddress),
+ make_pair("getamountreceived", &getreceivedbyaddress), // deprecated, renamed to getreceivedbyaddress
+ make_pair("getallreceived", &listreceivedbyaddress), // deprecated, renamed to listreceivedbyaddress
+ make_pair("getreceivedbyaddress", &getreceivedbyaddress),
+ make_pair("getreceivedbyaccount", &getreceivedbyaccount),
+ make_pair("getreceivedbylabel", &getreceivedbyaccount), // deprecated
+ make_pair("listreceivedbyaddress", &listreceivedbyaddress),
+ make_pair("listreceivedbyaccount", &listreceivedbyaccount),
+ make_pair("listreceivedbylabel", &listreceivedbyaccount), // deprecated
+ make_pair("backupwallet", &backupwallet),
+ make_pair("keypoolrefill", &keypoolrefill),
+ make_pair("walletpassphrase", &walletpassphrase),
+ make_pair("walletpassphrasechange", &walletpassphrasechange),
+ make_pair("walletlock", &walletlock),
+ make_pair("encryptwallet", &encryptwallet),
+ make_pair("validateaddress", &validateaddress),
+ make_pair("getbalance", &getbalance),
+ make_pair("move", &movecmd),
+ make_pair("sendfrom", &sendfrom),
+ make_pair("sendmany", &sendmany),
+ make_pair("gettransaction", &gettransaction),
+ make_pair("listtransactions", &listtransactions),
+ make_pair("getwork", &getwork),
+ make_pair("listaccounts", &listaccounts),
+ make_pair("settxfee", &settxfee),
};
map<string, rpcfn_type> mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0]));
@@ -1454,12 +1744,15 @@ string pAllowInSafeMode[] =
"getinfo",
"getnewaddress",
"getaccountaddress",
- "setlabel",
+ "setlabel", // deprecated
"getaccount",
"getlabel", // deprecated
"getaddressesbyaccount",
"getaddressesbylabel", // deprecated
"backupwallet",
+ "keypoolrefill",
+ "walletpassphrase",
+ "walletlock",
"validateaddress",
"getwork",
};
@@ -1484,7 +1777,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
<< "Accept: application/json\r\n";
- foreach(const PAIRTYPE(string, string)& item, mapRequestHeaders)
+ BOOST_FOREACH(const PAIRTYPE(string, string)& item, mapRequestHeaders)
s << item.first << ": " << item.second << "\r\n";
s << "\r\n" << strMsg;
@@ -1504,7 +1797,7 @@ string rfc1123Time()
return string(buffer);
}
-string HTTPReply(int nStatus, const string& strMsg)
+static string HTTPReply(int nStatus, const string& strMsg)
{
if (nStatus == 401)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
@@ -1526,6 +1819,7 @@ string HTTPReply(int nStatus, const string& strMsg)
string strStatus;
if (nStatus == 200) strStatus = "OK";
else if (nStatus == 400) strStatus = "Bad Request";
+ else if (nStatus == 403) strStatus = "Forbidden";
else if (nStatus == 404) strStatus = "Not Found";
else if (nStatus == 500) strStatus = "Internal Server Error";
return strprintf(
@@ -1570,10 +1864,11 @@ int ReadHTTPHeader(std::basic_istream<char>& stream, map<string, string>& mapHea
{
string strHeader = str.substr(0, nColon);
boost::trim(strHeader);
+ boost::to_lower(strHeader);
string strValue = str.substr(nColon+1);
boost::trim(strValue);
mapHeadersRet[strHeader] = strValue;
- if (strHeader == "Content-Length")
+ if (strHeader == "content-length")
nLen = atoi(strValue.c_str());
}
}
@@ -1643,7 +1938,7 @@ string DecodeBase64(string s)
bool HTTPAuthorized(map<string, string>& mapHeaders)
{
- string strAuth = mapHeaders["Authorization"];
+ string strAuth = mapHeaders["authorization"];
if (strAuth.substr(0,6) != "Basic ")
return false;
string strUserPass64 = strAuth.substr(6); boost::trim(strUserPass64);
@@ -1703,7 +1998,7 @@ bool ClientAllowed(const string& strAddress)
if (strAddress == asio::ip::address_v4::loopback().to_string())
return true;
const vector<string>& vAllow = mapMultiArgs["-rpcallowip"];
- foreach(string strAllow, vAllow)
+ BOOST_FOREACH(string strAllow, vAllow)
if (WildcardMatch(strAddress, strAllow))
return true;
return false;
@@ -1858,7 +2153,12 @@ void ThreadRPCServer2(void* parg)
// Restrict callers by IP
if (!ClientAllowed(peer.address().to_string()))
+ {
+ // Only send a 403 if we're not using SSL to prevent a DoS during the SSL handshake.
+ if (!fUseSSL)
+ stream << HTTPReply(403, "") << std::flush;
continue;
+ }
map<string, string> mapHeaders;
string strRequest;
@@ -1872,7 +2172,7 @@ void ThreadRPCServer2(void* parg)
}
// Check authorization
- if (mapHeaders.count("Authorization") == 0)
+ if (mapHeaders.count("authorization") == 0)
{
stream << HTTPReply(401, "") << std::flush;
continue;
@@ -2069,12 +2369,13 @@ int CommandLineRPC(int argc, char *argv[])
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]);
+ if (strMethod == "settxfee" && n > 0) ConvertTo<double>(params[0]);
if (strMethod == "getamountreceived" && n > 1) ConvertTo<boost::int64_t>(params[1]); // deprecated
if (strMethod == "getreceivedbyaddress" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getreceivedbyaccount" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getreceivedbylabel" && n > 1) ConvertTo<boost::int64_t>(params[1]); // deprecated
if (strMethod == "getallreceived" && n > 0) ConvertTo<boost::int64_t>(params[0]); // deprecated
- if (strMethod == "getallreceived" && n > 1) ConvertTo<bool>(params[1]);
+ if (strMethod == "getallreceived" && n > 1) ConvertTo<bool>(params[1]); // deprecated
if (strMethod == "listreceivedbyaddress" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "listreceivedbyaddress" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "listreceivedbyaccount" && n > 0) ConvertTo<boost::int64_t>(params[0]);
@@ -2087,7 +2388,9 @@ int CommandLineRPC(int argc, char *argv[])
if (strMethod == "sendfrom" && n > 2) ConvertTo<double>(params[2]);
if (strMethod == "sendfrom" && n > 3) ConvertTo<boost::int64_t>(params[3]);
if (strMethod == "listtransactions" && n > 1) ConvertTo<boost::int64_t>(params[1]);
+ if (strMethod == "listtransactions" && n > 2) ConvertTo<boost::int64_t>(params[2]);
if (strMethod == "listaccounts" && n > 0) ConvertTo<boost::int64_t>(params[0]);
+ if (strMethod == "walletpassphrase" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "sendmany" && n > 1)
{
string s = params[1].get_str();
@@ -2104,7 +2407,6 @@ int CommandLineRPC(int argc, char *argv[])
// Parse reply
const Value& result = find_value(reply, "result");
const Value& error = find_value(reply, "error");
- const Value& id = find_value(reply, "id");
if (error.type() != null_type)
{
diff --git a/rpc.h b/src/rpc.h
index 48a7b8a8a6..f267400797 100644
--- a/rpc.h
+++ b/src/rpc.h
@@ -1,4 +1,5 @@
// Copyright (c) 2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
diff --git a/script.cpp b/src/script.cpp
index a85c3710a3..d0c6a11491 100644
--- a/script.cpp
+++ b/src/script.cpp
@@ -1,9 +1,12 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
#include "headers.h"
+using namespace std;
+using namespace boost;
+
bool CheckSig(vector<unsigned char> vchSig, vector<unsigned char> vchPubKey, CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
@@ -578,6 +581,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_ABS: if (bn < bnZero) bn = -bn; break;
case OP_NOT: bn = (bn == bnZero); break;
case OP_0NOTEQUAL: bn = (bn != bnZero); break;
+ default: assert(!"invalid opcode"); break;
}
popstack(stack);
stack.push_back(bn.getvch());
@@ -657,6 +661,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break;
case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break;
case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break;
+ default: assert(!"invalid opcode"); break;
}
popstack(stack);
popstack(stack);
@@ -974,7 +979,7 @@ bool Solver(const CScript& scriptPubKey, vector<pair<opcodetype, valtype> >& vSo
// Scan templates
const CScript& script1 = scriptPubKey;
- foreach(const CScript& script2, vTemplates)
+ BOOST_FOREACH(const CScript& script2, vTemplates)
{
vSolutionRet.clear();
opcodetype opcode1, opcode2;
@@ -1019,7 +1024,7 @@ bool Solver(const CScript& scriptPubKey, vector<pair<opcodetype, valtype> >& vSo
}
-bool Solver(const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& scriptSigRet)
+bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& scriptSigRet)
{
scriptSigRet.clear();
@@ -1028,20 +1033,23 @@ bool Solver(const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& s
return false;
// Compile solution
- CRITICAL_BLOCK(cs_mapKeys)
+ CRITICAL_BLOCK(keystore.cs_KeyStore)
{
- foreach(PAIRTYPE(opcodetype, valtype)& item, vSolution)
+ BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
{
if (item.first == OP_PUBKEY)
{
// Sign
const valtype& vchPubKey = item.second;
- if (!mapKeys.count(vchPubKey))
+ CKey key;
+ if (!keystore.GetKey(Hash160(vchPubKey), key))
+ return false;
+ if (key.GetPubKey() != vchPubKey)
return false;
if (hash != 0)
{
vector<unsigned char> vchSig;
- if (!CKey::Sign(mapKeys[vchPubKey], hash, vchSig))
+ if (!key.Sign(hash, vchSig))
return false;
vchSig.push_back((unsigned char)nHashType);
scriptSigRet << vchSig;
@@ -1050,19 +1058,16 @@ bool Solver(const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& s
else if (item.first == OP_PUBKEYHASH)
{
// Sign and give pubkey
- map<uint160, valtype>::iterator mi = mapPubKeys.find(uint160(item.second));
- if (mi == mapPubKeys.end())
- return false;
- const vector<unsigned char>& vchPubKey = (*mi).second;
- if (!mapKeys.count(vchPubKey))
+ CKey key;
+ if (!keystore.GetKey(uint160(item.second), key))
return false;
if (hash != 0)
{
vector<unsigned char> vchSig;
- if (!CKey::Sign(mapKeys[vchPubKey], hash, vchSig))
+ if (!key.Sign(hash, vchSig))
return false;
vchSig.push_back((unsigned char)nHashType);
- scriptSigRet << vchSig << vchPubKey;
+ scriptSigRet << vchSig << key.GetPubKey();
}
}
else
@@ -1083,68 +1088,72 @@ bool IsStandard(const CScript& scriptPubKey)
}
-bool IsMine(const CScript& scriptPubKey)
-{
- CScript scriptSig;
- return Solver(scriptPubKey, 0, 0, scriptSig);
-}
-
-
-bool ExtractPubKey(const CScript& scriptPubKey, bool fMineOnly, vector<unsigned char>& vchPubKeyRet)
+bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
{
- vchPubKeyRet.clear();
-
vector<pair<opcodetype, valtype> > vSolution;
if (!Solver(scriptPubKey, vSolution))
return false;
- CRITICAL_BLOCK(cs_mapKeys)
+ // Compile solution
+ CRITICAL_BLOCK(keystore.cs_KeyStore)
{
- foreach(PAIRTYPE(opcodetype, valtype)& item, vSolution)
+ BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
{
- valtype vchPubKey;
if (item.first == OP_PUBKEY)
{
- vchPubKey = item.second;
+ const valtype& vchPubKey = item.second;
+ vector<unsigned char> vchPubKeyFound;
+ if (!keystore.GetPubKey(Hash160(vchPubKey), vchPubKeyFound))
+ return false;
+ if (vchPubKeyFound != vchPubKey)
+ return false;
}
else if (item.first == OP_PUBKEYHASH)
{
- map<uint160, valtype>::iterator mi = mapPubKeys.find(uint160(item.second));
- if (mi == mapPubKeys.end())
- continue;
- vchPubKey = (*mi).second;
+ if (!keystore.HaveKey(uint160(item.second)))
+ return false;
}
- if (!fMineOnly || mapKeys.count(vchPubKey))
+ else
{
- vchPubKeyRet = vchPubKey;
- return true;
+ return false;
}
}
}
- return false;
-}
+ return true;
+}
-bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret)
+// requires either keystore==0, or a lock on keystore->cs_KeyStore
+bool static ExtractAddressInner(const CScript& scriptPubKey, const CKeyStore* keystore, CBitcoinAddress& addressRet)
{
- hash160Ret = 0;
-
vector<pair<opcodetype, valtype> > vSolution;
if (!Solver(scriptPubKey, vSolution))
return false;
- foreach(PAIRTYPE(opcodetype, valtype)& item, vSolution)
+ BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
{
- if (item.first == OP_PUBKEYHASH)
- {
- hash160Ret = uint160(item.second);
+ if (item.first == OP_PUBKEY)
+ addressRet.SetPubKey(item.second);
+ else if (item.first == OP_PUBKEYHASH)
+ addressRet.SetHash160((uint160)item.second);
+ if (keystore == NULL || keystore->HaveKey(addressRet))
return true;
- }
}
return false;
}
+bool ExtractAddress(const CScript& scriptPubKey, const CKeyStore* keystore, CBitcoinAddress& addressRet)
+{
+ if (keystore)
+ CRITICAL_BLOCK(keystore->cs_KeyStore)
+ return ExtractAddressInner(scriptPubKey, keystore, addressRet);
+ else
+ return ExtractAddressInner(scriptPubKey, NULL, addressRet);
+ return false;
+}
+
+
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, int nHashType)
{
vector<vector<unsigned char> > stack;
@@ -1158,7 +1167,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C
}
-bool SignSignature(const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType, CScript scriptPrereq)
+bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType, CScript scriptPrereq)
{
assert(nIn < txTo.vin.size());
CTxIn& txin = txTo.vin[nIn];
@@ -1169,7 +1178,7 @@ bool SignSignature(const CTransaction& txFrom, CTransaction& txTo, unsigned int
// The checksig op will also drop the signatures from its hash.
uint256 hash = SignatureHash(scriptPrereq + txout.scriptPubKey, txTo, nIn, nHashType);
- if (!Solver(txout.scriptPubKey, hash, nHashType, txin.scriptSig))
+ if (!Solver(keystore, txout.scriptPubKey, hash, nHashType, txin.scriptSig))
return false;
txin.scriptSig = scriptPrereq + txin.scriptSig;
@@ -1197,10 +1206,5 @@ bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsig
if (!VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, nIn, nHashType))
return false;
- // Anytime a signature is successfully verified, it's proof the outpoint is spent,
- // so lets update the wallet spent flag if it doesn't know due to wallet.dat being
- // restored from backup or the user making copies of wallet.dat.
- WalletUpdateSpent(txin.prevout);
-
return true;
}
diff --git a/script.h b/src/script.h
index da904ef489..e61ea2fd7e 100644
--- a/script.h
+++ b/src/script.h
@@ -1,6 +1,17 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef H_BITCOIN_SCRIPT
+#define H_BITCOIN_SCRIPT
+
+#include "base58.h"
+#include "keystore.h"
+
+#include <string>
+#include <vector>
+
+#include <boost/foreach.hpp>
class CTransaction;
@@ -310,7 +321,7 @@ inline const char* GetOpName(opcodetype opcode)
-inline string ValueString(const vector<unsigned char>& vch)
+inline std::string ValueString(const std::vector<unsigned char>& vch)
{
if (vch.size() <= 4)
return strprintf("%d", CBigNum(vch).getint());
@@ -318,10 +329,10 @@ inline string ValueString(const vector<unsigned char>& vch)
return HexStr(vch);
}
-inline string StackString(const vector<vector<unsigned char> >& vStack)
+inline std::string StackString(const std::vector<std::vector<unsigned char> >& vStack)
{
- string str;
- foreach(const vector<unsigned char>& vch, vStack)
+ std::string str;
+ BOOST_FOREACH(const std::vector<unsigned char>& vch, vStack)
{
if (!str.empty())
str += " ";
@@ -338,7 +349,7 @@ inline string StackString(const vector<vector<unsigned char> >& vStack)
-class CScript : public vector<unsigned char>
+class CScript : public std::vector<unsigned char>
{
protected:
CScript& push_int64(int64 n)
@@ -371,10 +382,10 @@ protected:
public:
CScript() { }
- CScript(const CScript& b) : vector<unsigned char>(b.begin(), b.end()) { }
- CScript(const_iterator pbegin, const_iterator pend) : vector<unsigned char>(pbegin, pend) { }
+ CScript(const CScript& b) : std::vector<unsigned char>(b.begin(), b.end()) { }
+ CScript(const_iterator pbegin, const_iterator pend) : std::vector<unsigned char>(pbegin, pend) { }
#ifndef _MSC_VER
- CScript(const unsigned char* pbegin, const unsigned char* pend) : vector<unsigned char>(pbegin, pend) { }
+ CScript(const unsigned char* pbegin, const unsigned char* pend) : std::vector<unsigned char>(pbegin, pend) { }
#endif
CScript& operator+=(const CScript& b)
@@ -405,7 +416,7 @@ public:
explicit CScript(opcodetype b) { operator<<(b); }
explicit CScript(const uint256& b) { operator<<(b); }
explicit CScript(const CBigNum& b) { operator<<(b); }
- explicit CScript(const vector<unsigned char>& b) { operator<<(b); }
+ explicit CScript(const std::vector<unsigned char>& b) { operator<<(b); }
CScript& operator<<(char b) { return push_int64(b); }
@@ -422,7 +433,7 @@ public:
CScript& operator<<(opcodetype opcode)
{
if (opcode < 0 || opcode > 0xff)
- throw runtime_error("CScript::operator<<() : invalid opcode");
+ throw std::runtime_error("CScript::operator<<() : invalid opcode");
insert(end(), (unsigned char)opcode);
return *this;
}
@@ -447,7 +458,7 @@ public:
return *this;
}
- CScript& operator<<(const vector<unsigned char>& b)
+ CScript& operator<<(const std::vector<unsigned char>& b)
{
if (b.size() < OP_PUSHDATA1)
{
@@ -478,12 +489,12 @@ public:
{
// I'm not sure if this should push the script or concatenate scripts.
// If there's ever a use for pushing a script onto a script, delete this member fn
- assert(("warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate", false));
+ assert(!"warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate");
return *this;
}
- bool GetOp(iterator& pc, opcodetype& opcodeRet, vector<unsigned char>& vchRet)
+ bool GetOp(iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>& vchRet)
{
// Wrapper so it can be called with either iterator or const_iterator
const_iterator pc2 = pc;
@@ -500,7 +511,7 @@ public:
return fRet;
}
- bool GetOp(const_iterator& pc, opcodetype& opcodeRet, vector<unsigned char>& vchRet) const
+ bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>& vchRet) const
{
return GetOp2(pc, opcodeRet, &vchRet);
}
@@ -510,7 +521,7 @@ public:
return GetOp2(pc, opcodeRet, NULL);
}
- bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, vector<unsigned char>* pvchRet) const
+ bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>* pvchRet) const
{
opcodeRet = OP_INVALIDOPCODE;
if (pvchRet)
@@ -614,10 +625,10 @@ public:
}
- uint160 GetBitcoinAddressHash160() const
+ CBitcoinAddress GetBitcoinAddress() const
{
opcodetype opcode;
- vector<unsigned char> vch;
+ std::vector<unsigned char> vch;
CScript::const_iterator pc = begin();
if (!GetOp(pc, opcode, vch) || opcode != OP_DUP) return 0;
if (!GetOp(pc, opcode, vch) || opcode != OP_HASH160) return 0;
@@ -626,36 +637,18 @@ public:
if (!GetOp(pc, opcode, vch) || opcode != OP_EQUALVERIFY) return 0;
if (!GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG) return 0;
if (pc != end()) return 0;
- return hash160;
+ return CBitcoinAddress(hash160);
}
- string GetBitcoinAddress() const
- {
- uint160 hash160 = GetBitcoinAddressHash160();
- if (hash160 == 0)
- return "";
- return Hash160ToAddress(hash160);
- }
-
- void SetBitcoinAddress(const uint160& hash160)
+ void SetBitcoinAddress(const CBitcoinAddress& address)
{
this->clear();
- *this << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
- }
-
- void SetBitcoinAddress(const vector<unsigned char>& vchPubKey)
- {
- SetBitcoinAddress(Hash160(vchPubKey));
+ *this << OP_DUP << OP_HASH160 << address.GetHash160() << OP_EQUALVERIFY << OP_CHECKSIG;
}
- bool SetBitcoinAddress(const string& strAddress)
+ void SetBitcoinAddress(const std::vector<unsigned char>& vchPubKey)
{
- this->clear();
- uint160 hash160;
- if (!AddressToHash160(strAddress, hash160))
- return false;
- SetBitcoinAddress(hash160);
- return true;
+ SetBitcoinAddress(CBitcoinAddress(vchPubKey));
}
@@ -664,11 +657,11 @@ public:
printf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
}
- string ToString() const
+ std::string ToString() const
{
- string str;
+ std::string str;
opcodetype opcode;
- vector<unsigned char> vch;
+ std::vector<unsigned char> vch;
const_iterator pc = begin();
while (pc < end())
{
@@ -699,11 +692,12 @@ public:
+bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, int nHashType);
-uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
bool IsStandard(const CScript& scriptPubKey);
-bool IsMine(const CScript& scriptPubKey);
-bool ExtractPubKey(const CScript& scriptPubKey, bool fMineOnly, vector<unsigned char>& vchPubKeyRet);
-bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret);
-bool SignSignature(const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL, CScript scriptPrereq=CScript());
+bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
+bool ExtractAddress(const CScript& scriptPubKey, const CKeyStore* pkeystore, CBitcoinAddress& addressRet);
+bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL, CScript scriptPrereq=CScript());
bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsigned int nIn, int nHashType=0);
+
+#endif
diff --git a/serialize.h b/src/serialize.h
index 383c987864..c55775242b 100644
--- a/serialize.h
+++ b/src/serialize.h
@@ -1,15 +1,24 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_SERIALIZE_H
+#define BITCOIN_SERIALIZE_H
#include <string>
#include <vector>
#include <map>
#include <set>
+#include <cassert>
+#include <climits>
+#include <cstring>
+#include <cstdio>
+
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
+
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 int64;
typedef unsigned __int64 uint64;
@@ -20,12 +29,37 @@ typedef unsigned long long uint64;
#if defined(_MSC_VER) && _MSC_VER < 1300
#define for if (false) ; else for
#endif
+
+#ifdef __WXMSW__
+// This is used to attempt to keep keying material out of swap
+// Note that VirtualLock does not provide this as a guarantee on Windows,
+// but, in practice, memory that has been VirtualLock'd almost never gets written to
+// the pagefile except in rare circumstances where memory is extremely low.
+#include <windows.h>
+#define mlock(p, n) VirtualLock((p), (n));
+#define munlock(p, n) VirtualUnlock((p), (n));
+#else
+#include <sys/mman.h>
+#include <limits.h>
+/* This comes from limits.h if it's not defined there set a sane default */
+#ifndef PAGESIZE
+#include <unistd.h>
+#define PAGESIZE sysconf(_SC_PAGESIZE)
+#endif
+#define mlock(a,b) \
+ mlock(((void *)(((size_t)(a)) & (~((PAGESIZE)-1)))),\
+ (((((size_t)(a)) + (b) - 1) | ((PAGESIZE) - 1)) + 1) - (((size_t)(a)) & (~((PAGESIZE) - 1))))
+#define munlock(a,b) \
+ munlock(((void *)(((size_t)(a)) & (~((PAGESIZE)-1)))),\
+ (((((size_t)(a)) + (b) - 1) | ((PAGESIZE) - 1)) + 1) - (((size_t)(a)) & (~((PAGESIZE) - 1))))
+#endif
+
class CScript;
class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;
-static const int VERSION = 32100;
+static const int VERSION = 32500;
static const char* pszSubVer = "";
static const bool VERSION_IS_BETA = true;
@@ -277,11 +311,11 @@ template<std::size_t LEN>
class CFixedFieldString
{
protected:
- const string* pcstr;
- string* pstr;
+ const std::string* pcstr;
+ std::string* pstr;
public:
- explicit CFixedFieldString(const string& str) : pcstr(&str), pstr(NULL) { }
- explicit CFixedFieldString(string& str) : pcstr(&str), pstr(&str) { }
+ explicit CFixedFieldString(const std::string& str) : pcstr(&str), pstr(NULL) { }
+ explicit CFixedFieldString(std::string& str) : pcstr(&str), pstr(&str) { }
unsigned int GetSerializeSize(int, int=0) const
{
@@ -317,9 +351,9 @@ public:
//
// string
-template<typename C> unsigned int GetSerializeSize(const basic_string<C>& str, int, int=0);
-template<typename Stream, typename C> void Serialize(Stream& os, const basic_string<C>& str, int, int=0);
-template<typename Stream, typename C> void Unserialize(Stream& is, basic_string<C>& str, int, int=0);
+template<typename C> unsigned int GetSerializeSize(const std::basic_string<C>& str, int, int=0);
+template<typename Stream, typename C> void Serialize(Stream& os, const std::basic_string<C>& str, int, int=0);
+template<typename Stream, typename C> void Unserialize(Stream& is, std::basic_string<C>& str, int, int=0);
// vector
template<typename T, typename A> unsigned int GetSerializeSize_impl(const std::vector<T, A>& v, int nType, int nVersion, const boost::true_type&);
@@ -398,13 +432,13 @@ inline void Unserialize(Stream& is, T& a, long nType, int nVersion=VERSION)
// string
//
template<typename C>
-unsigned int GetSerializeSize(const basic_string<C>& str, int, int)
+unsigned int GetSerializeSize(const std::basic_string<C>& str, int, int)
{
return GetSizeOfCompactSize(str.size()) + str.size() * sizeof(str[0]);
}
template<typename Stream, typename C>
-void Serialize(Stream& os, const basic_string<C>& str, int, int)
+void Serialize(Stream& os, const std::basic_string<C>& str, int, int)
{
WriteCompactSize(os, str.size());
if (!str.empty())
@@ -412,7 +446,7 @@ void Serialize(Stream& os, const basic_string<C>& str, int, int)
}
template<typename Stream, typename C>
-void Unserialize(Stream& is, basic_string<C>& str, int, int)
+void Unserialize(Stream& is, std::basic_string<C>& str, int, int)
{
unsigned int nSize = ReadCompactSize(is);
str.resize(nSize);
@@ -483,7 +517,7 @@ void Unserialize_impl(Stream& is, std::vector<T, A>& v, int nType, int nVersion,
unsigned int i = 0;
while (i < nSize)
{
- unsigned int blk = min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
+ unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
v.resize(i + blk);
is.read((char*)&v[i], blk * sizeof(T));
i += blk;
@@ -526,19 +560,19 @@ inline void Unserialize(Stream& is, std::vector<T, A>& v, int nType, int nVersio
//
inline unsigned int GetSerializeSize(const CScript& v, int nType, int nVersion)
{
- return GetSerializeSize((const vector<unsigned char>&)v, nType, nVersion);
+ return GetSerializeSize((const std::vector<unsigned char>&)v, nType, nVersion);
}
template<typename Stream>
void Serialize(Stream& os, const CScript& v, int nType, int nVersion)
{
- Serialize(os, (const vector<unsigned char>&)v, nType, nVersion);
+ Serialize(os, (const std::vector<unsigned char>&)v, nType, nVersion);
}
template<typename Stream>
void Unserialize(Stream& is, CScript& v, int nType, int nVersion)
{
- Unserialize(is, (vector<unsigned char>&)v, nType, nVersion);
+ Unserialize(is, (std::vector<unsigned char>&)v, nType, nVersion);
}
@@ -575,26 +609,26 @@ template<typename T0, typename T1, typename T2>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
- nSize += GetSerializeSize(get<0>(item), nType, nVersion);
- nSize += GetSerializeSize(get<1>(item), nType, nVersion);
- nSize += GetSerializeSize(get<2>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
- Serialize(os, get<0>(item), nType, nVersion);
- Serialize(os, get<1>(item), nType, nVersion);
- Serialize(os, get<2>(item), nType, nVersion);
+ Serialize(os, boost::get<0>(item), nType, nVersion);
+ Serialize(os, boost::get<1>(item), nType, nVersion);
+ Serialize(os, boost::get<2>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
- Unserialize(is, get<0>(item), nType, nVersion);
- Unserialize(is, get<1>(item), nType, nVersion);
- Unserialize(is, get<2>(item), nType, nVersion);
+ Unserialize(is, boost::get<0>(item), nType, nVersion);
+ Unserialize(is, boost::get<1>(item), nType, nVersion);
+ Unserialize(is, boost::get<2>(item), nType, nVersion);
}
@@ -606,29 +640,29 @@ template<typename T0, typename T1, typename T2, typename T3>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
- nSize += GetSerializeSize(get<0>(item), nType, nVersion);
- nSize += GetSerializeSize(get<1>(item), nType, nVersion);
- nSize += GetSerializeSize(get<2>(item), nType, nVersion);
- nSize += GetSerializeSize(get<3>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion);
+ nSize += GetSerializeSize(boost::get<3>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
- Serialize(os, get<0>(item), nType, nVersion);
- Serialize(os, get<1>(item), nType, nVersion);
- Serialize(os, get<2>(item), nType, nVersion);
- Serialize(os, get<3>(item), nType, nVersion);
+ Serialize(os, boost::get<0>(item), nType, nVersion);
+ Serialize(os, boost::get<1>(item), nType, nVersion);
+ Serialize(os, boost::get<2>(item), nType, nVersion);
+ Serialize(os, boost::get<3>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
- Unserialize(is, get<0>(item), nType, nVersion);
- Unserialize(is, get<1>(item), nType, nVersion);
- Unserialize(is, get<2>(item), nType, nVersion);
- Unserialize(is, get<3>(item), nType, nVersion);
+ Unserialize(is, boost::get<0>(item), nType, nVersion);
+ Unserialize(is, boost::get<1>(item), nType, nVersion);
+ Unserialize(is, boost::get<2>(item), nType, nVersion);
+ Unserialize(is, boost::get<3>(item), nType, nVersion);
}
@@ -661,7 +695,7 @@ void Unserialize(Stream& is, std::map<K, T, Pred, A>& m, int nType, int nVersion
typename std::map<K, T, Pred, A>::iterator mi = m.begin();
for (unsigned int i = 0; i < nSize; i++)
{
- pair<K, T> item;
+ std::pair<K, T> item;
Unserialize(is, item, nType, nVersion);
mi = m.insert(mi, item);
}
@@ -747,7 +781,8 @@ struct ser_streamplaceholder
//
-// Allocator that clears its contents before deletion
+// Allocator that locks its contents from being paged
+// out of memory and clears its contents before deletion.
//
template<typename T>
struct secure_allocator : public std::allocator<T>
@@ -769,11 +804,23 @@ struct secure_allocator : public std::allocator<T>
template<typename _Other> struct rebind
{ typedef secure_allocator<_Other> other; };
+ T* allocate(std::size_t n, const void *hint = 0)
+ {
+ T *p;
+ p = std::allocator<T>::allocate(n, hint);
+ if (p != NULL)
+ mlock(p, sizeof(T) * n);
+ return p;
+ }
+
void deallocate(T* p, std::size_t n)
{
if (p != NULL)
+ {
memset(p, 0, sizeof(T) * n);
- allocator<T>::deallocate(p, n);
+ munlock(p, sizeof(T) * n);
+ }
+ std::allocator<T>::deallocate(p, n);
}
};
@@ -787,7 +834,7 @@ struct secure_allocator : public std::allocator<T>
class CDataStream
{
protected:
- typedef vector<char, secure_allocator<char> > vector_type;
+ typedef std::vector<char, secure_allocator<char> > vector_type;
vector_type vch;
unsigned int nReadPos;
short state;
@@ -828,12 +875,12 @@ public:
Init(nTypeIn, nVersionIn);
}
- CDataStream(const vector<char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
+ CDataStream(const std::vector<char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
{
Init(nTypeIn, nVersionIn);
}
- CDataStream(const vector<unsigned char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch((char*)&vchIn.begin()[0], (char*)&vchIn.end()[0])
+ CDataStream(const std::vector<unsigned char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch((char*)&vchIn.begin()[0], (char*)&vchIn.end()[0])
{
Init(nTypeIn, nVersionIn);
}
@@ -844,7 +891,7 @@ public:
nType = nTypeIn;
nVersion = nVersionIn;
state = 0;
- exceptmask = ios::badbit | ios::failbit;
+ exceptmask = std::ios::badbit | std::ios::failbit;
}
CDataStream& operator+=(const CDataStream& b)
@@ -860,9 +907,9 @@ public:
return (ret);
}
- string str() const
+ std::string str() const
{
- return (string(begin(), end()));
+ return (std::string(begin(), end()));
}
@@ -895,7 +942,7 @@ public:
vch.insert(it, first, last);
}
- void insert(iterator it, vector<char>::const_iterator first, vector<char>::const_iterator last)
+ void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
{
if (it == vch.begin() + nReadPos && last - first <= nReadPos)
{
@@ -985,7 +1032,7 @@ public:
}
bool eof() const { return size() == 0; }
- bool fail() const { return state & (ios::badbit | ios::failbit); }
+ bool fail() const { return state & (std::ios::badbit | std::ios::failbit); }
bool good() const { return !eof() && (state == 0); }
void clear(short n) { state = n; } // name conflict with vector clear()
short exceptions() { return exceptmask; }
@@ -1009,7 +1056,7 @@ public:
{
if (nReadPosNext > vch.size())
{
- setstate(ios::failbit, "CDataStream::read() : end of data");
+ setstate(std::ios::failbit, "CDataStream::read() : end of data");
memset(pch, 0, nSize);
nSize = vch.size() - nReadPos;
}
@@ -1032,7 +1079,7 @@ public:
{
if (nReadPosNext > vch.size())
{
- setstate(ios::failbit, "CDataStream::ignore() : end of data");
+ setstate(std::ios::failbit, "CDataStream::ignore() : end of data");
nSize = vch.size() - nReadPos;
}
nReadPos = 0;
@@ -1167,7 +1214,7 @@ public:
nType = nTypeIn;
nVersion = nVersionIn;
state = 0;
- exceptmask = ios::badbit | ios::failbit;
+ exceptmask = std::ios::badbit | std::ios::failbit;
}
~CAutoFile()
@@ -1201,7 +1248,7 @@ public:
throw std::ios_base::failure(psz);
}
- bool fail() const { return state & (ios::badbit | ios::failbit); }
+ bool fail() const { return state & (std::ios::badbit | std::ios::failbit); }
bool good() const { return state == 0; }
void clear(short n = 0) { state = n; }
short exceptions() { return exceptmask; }
@@ -1219,7 +1266,7 @@ public:
if (!file)
throw std::ios_base::failure("CAutoFile::read : file handle is NULL");
if (fread(pch, 1, nSize, file) != nSize)
- setstate(ios::failbit, feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed");
+ setstate(std::ios::failbit, feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed");
return (*this);
}
@@ -1228,7 +1275,7 @@ public:
if (!file)
throw std::ios_base::failure("CAutoFile::write : file handle is NULL");
if (fwrite(pch, 1, nSize, file) != nSize)
- setstate(ios::failbit, "CAutoFile::write : write failed");
+ setstate(std::ios::failbit, "CAutoFile::write : write failed");
return (*this);
}
@@ -1259,3 +1306,5 @@ public:
return (*this);
}
};
+
+#endif
diff --git a/strlcpy.h b/src/strlcpy.h
index dc0560b30a..d4d1908e7a 100644
--- a/strlcpy.h
+++ b/src/strlcpy.h
@@ -13,7 +13,8 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-
+#ifndef BITCOIN_STRLCPY_H
+#define BITCOIN_STRLCPY_H
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
@@ -82,3 +83,4 @@ inline size_t strlcat(char *dst, const char *src, size_t siz)
return(dlen + (s - src)); /* count does not include NUL */
}
+#endif
diff --git a/src/test/README b/src/test/README
new file mode 100644
index 0000000000..77f7faa815
--- /dev/null
+++ b/src/test/README
@@ -0,0 +1,21 @@
+The sources in this directory are unit test cases. Boost includes a
+unit testing framework, and since bitcoin already uses boost, it makes
+sense to simply use this framework rather than require developers to
+configure some other framework (we want as few impediments to creating
+unit tests as possible).
+
+The build system is setup to compile an executable called "test_bitcoin"
+that runs all of the unit tests. The main source file is called
+test_bitcoin.cpp, which simply includes other files that contain the
+actual unit tests (outside of a couple required preprocessor
+directives). The pattern is to create one test file for each class or
+source file for which you want to create unit tests. The file naming
+convention is "<source_filename>_tests.cpp" and such files should wrap
+their tests in a test suite called "<source_filename>_tests". For an
+examples of this pattern, examine uint160_tests.cpp and
+uint256_tests.cpp.
+
+For further reading, I found the following website to be helpful in
+explaining how the boost unit test framework works:
+
+http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
new file mode 100644
index 0000000000..13feb86b97
--- /dev/null
+++ b/src/test/script_tests.cpp
@@ -0,0 +1,173 @@
+#include <vector>
+#include <boost/test/unit_test.hpp>
+#include <boost/foreach.hpp>
+
+#include "../main.h"
+#include "../wallet.h"
+
+using namespace std;
+extern uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
+extern bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, int nHashType);
+extern bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsigned int nIn, int nHashType);
+
+BOOST_AUTO_TEST_SUITE(script_tests)
+
+BOOST_AUTO_TEST_CASE(script_PushData)
+{
+ // Check that PUSHDATA1, PUSHDATA2, and PUSHDATA4 create the same value on
+ // the stack as the 1-75 opcodes do.
+ static const unsigned char direct[] = { 1, 0x5a };
+ static const unsigned char pushdata1[] = { OP_PUSHDATA1, 1, 0x5a };
+ static const unsigned char pushdata2[] = { OP_PUSHDATA2, 1, 0, 0x5a };
+ static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a };
+
+ vector<vector<unsigned char> > directStack;
+ BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), CTransaction(), 0, 0));
+
+ vector<vector<unsigned char> > pushdata1Stack;
+ BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), CTransaction(), 0, 0));
+ BOOST_CHECK(pushdata1Stack == directStack);
+
+ vector<vector<unsigned char> > pushdata2Stack;
+ BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), CTransaction(), 0, 0));
+ BOOST_CHECK(pushdata2Stack == directStack);
+
+ vector<vector<unsigned char> > pushdata4Stack;
+ BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), CTransaction(), 0, 0));
+ BOOST_CHECK(pushdata4Stack == directStack);
+}
+
+CScript
+sign_multisig(CScript scriptPubKey, std::vector<CKey> keys, CTransaction transaction)
+{
+ uint256 hash = SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL);
+
+ CScript result;
+ //
+ // NOTE: CHECKMULTISIG has an unfortunate bug; it requires
+ // one extra item on the stack, before the signatures.
+ // Putting OP_0 on the stack is the workaround;
+ // fixing the bug would mean splitting the blockchain (old
+ // clients would not accept new CHECKMULTISIG transactions,
+ // and vice-versa)
+ //
+ result << OP_0;
+ BOOST_FOREACH(CKey key, keys)
+ {
+ vector<unsigned char> vchSig;
+ BOOST_CHECK(key.Sign(hash, vchSig));
+ vchSig.push_back((unsigned char)SIGHASH_ALL);
+ result << vchSig;
+ }
+ return result;
+}
+CScript
+sign_multisig(CScript scriptPubKey, CKey key, CTransaction transaction)
+{
+ std::vector<CKey> keys;
+ keys.push_back(key);
+ return sign_multisig(scriptPubKey, keys, transaction);
+}
+
+BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)
+{
+ CKey key1, key2, key3;
+ key1.MakeNewKey();
+ key2.MakeNewKey();
+ key3.MakeNewKey();
+
+ CScript scriptPubKey12;
+ scriptPubKey12 << OP_1 << key1.GetPubKey() << key2.GetPubKey() << OP_2 << OP_CHECKMULTISIG;
+
+ CTransaction txFrom12;
+ txFrom12.vout.resize(1);
+ txFrom12.vout[0].scriptPubKey = scriptPubKey12;
+
+ CTransaction txTo12;
+ txTo12.vin.resize(1);
+ txTo12.vout.resize(1);
+ txTo12.vin[0].prevout.n = 0;
+ txTo12.vin[0].prevout.hash = txFrom12.GetHash();
+ txTo12.vout[0].nValue = 1;
+
+ CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12);
+ BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, 0));
+ txTo12.vout[0].nValue = 2;
+ BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, 0));
+
+ CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12);
+ BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, txTo12, 0, 0));
+
+ CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12);
+ BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, txTo12, 0, 0));
+}
+
+BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)
+{
+ CKey key1, key2, key3, key4;
+ key1.MakeNewKey();
+ key2.MakeNewKey();
+ key3.MakeNewKey();
+ key4.MakeNewKey();
+
+ CScript scriptPubKey23;
+ scriptPubKey23 << OP_2 << key1.GetPubKey() << key2.GetPubKey() << key3.GetPubKey() << OP_3 << OP_CHECKMULTISIG;
+
+ CTransaction txFrom23;
+ txFrom23.vout.resize(1);
+ txFrom23.vout[0].scriptPubKey = scriptPubKey23;
+
+ CTransaction txTo23;
+ txTo23.vin.resize(1);
+ txTo23.vout.resize(1);
+ txTo23.vin[0].prevout.n = 0;
+ txTo23.vin[0].prevout.hash = txFrom23.GetHash();
+ txTo23.vout[0].nValue = 1;
+
+ std::vector<CKey> keys;
+ keys.push_back(key1); keys.push_back(key2);
+ CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key1); keys.push_back(key3);
+ CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key2); keys.push_back(key3);
+ CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key2); keys.push_back(key2); // Can't re-use sig
+ CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order
+ CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order
+ CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys
+ CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear();
+ keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys
+ CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, txTo23, 0, 0));
+
+ keys.clear(); // Must have signatures
+ CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23);
+ BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, txTo23, 0, 0));
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
new file mode 100644
index 0000000000..0230bb6eca
--- /dev/null
+++ b/src/test/test_bitcoin.cpp
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE Bitcoin Test Suite
+#include <boost/test/unit_test.hpp>
+
+#include "../main.h"
+#include "../wallet.h"
+
+#include "uint160_tests.cpp"
+#include "uint256_tests.cpp"
+#include "script_tests.cpp"
+#include "transaction_tests.cpp"
+
+
+CWallet* pwalletMain;
+
+void Shutdown(void* parg)
+{
+ exit(0);
+}
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
new file mode 100644
index 0000000000..e6eb0f054f
--- /dev/null
+++ b/src/test/transaction_tests.cpp
@@ -0,0 +1,25 @@
+#include <boost/test/unit_test.hpp>
+
+#include "../main.h"
+#include "../wallet.h"
+
+using namespace std;
+
+BOOST_AUTO_TEST_SUITE(transaction_tests)
+
+BOOST_AUTO_TEST_CASE(basic_transaction_tests)
+{
+ // Random real transaction (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)
+ unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00};
+ vector<unsigned char> vch(ch, ch + sizeof(ch) -1);
+ CDataStream stream(vch);
+ CTransaction tx;
+ stream >> tx;
+ BOOST_CHECK_MESSAGE(tx.CheckTransaction(), "Simple deserialized transaction should be valid.");
+
+ // Check that duplicate txins fail
+ tx.vin.push_back(tx.vin[0]);
+ BOOST_CHECK_MESSAGE(!tx.CheckTransaction(), "Transaction with duplicate txins should be invalid.");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/test/uint160_tests.cpp b/src/test/uint160_tests.cpp
new file mode 100644
index 0000000000..42c8275afe
--- /dev/null
+++ b/src/test/uint160_tests.cpp
@@ -0,0 +1,18 @@
+#include <boost/test/unit_test.hpp>
+
+#include "../uint256.h"
+
+BOOST_AUTO_TEST_SUITE(uint160_tests)
+
+BOOST_AUTO_TEST_CASE(uint160_equality)
+{
+ uint160 num1 = 10;
+ uint160 num2 = 11;
+ BOOST_CHECK(num1+1 == num2);
+
+ uint64 num3 = 10;
+ BOOST_CHECK(num1 == num3);
+ BOOST_CHECK(num1+num2 == num3+num2);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp
new file mode 100644
index 0000000000..c5d45e215e
--- /dev/null
+++ b/src/test/uint256_tests.cpp
@@ -0,0 +1,18 @@
+#include <boost/test/unit_test.hpp>
+
+#include "../uint256.h"
+
+BOOST_AUTO_TEST_SUITE(uint256_tests)
+
+BOOST_AUTO_TEST_CASE(uint256_equality)
+{
+ uint256 num1 = 10;
+ uint256 num2 = 11;
+ BOOST_CHECK(num1+1 == num2);
+
+ uint64 num3 = 10;
+ BOOST_CHECK(num1 == num3);
+ BOOST_CHECK(num1+num2 == num3+num2);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/ui.cpp b/src/ui.cpp
index 2277da6a3a..372808f1ae 100644
--- a/ui.cpp
+++ b/src/ui.cpp
@@ -1,12 +1,20 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
+#include "db.h"
+#include "init.h"
+#include "strlcpy.h"
+#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/convenience.hpp>
#ifdef _MSC_VER
#include <crtdbg.h>
#endif
+using namespace std;
+using namespace boost;
DEFINE_EVENT_TYPE(wxEVT_UITHREADCALL)
@@ -16,6 +24,13 @@ CMyTaskBarIcon* ptaskbaricon = NULL;
bool fClosedToTray = false;
wxLocale g_locale;
+#ifdef __WXMSW__
+double nScaleX = 1.0;
+double nScaleY = 1.0;
+#else
+static const double nScaleX = 1.0;
+static const double nScaleY = 1.0;
+#endif
@@ -196,7 +211,7 @@ int ThreadSafeMessageBox(const string& message, const string& caption, int style
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
{
- if (nFeeRequired < CENT || nFeeRequired <= nTransactionFee || fDaemon)
+ if (nFeeRequired < MIN_TX_FEE || nFeeRequired <= nTransactionFee || fDaemon)
return true;
string strMessage = strprintf(
_("This transaction is over the size limit. You can still send it for a fee of %s, "
@@ -221,16 +236,52 @@ void SetDefaultReceivingAddress(const string& strAddress)
return;
if (strAddress != pframeMain->m_textCtrlAddress->GetValue())
{
- uint160 hash160;
- if (!AddressToHash160(strAddress, hash160))
+ CBitcoinAddress address(strAddress);
+ if (!address.IsValid())
return;
- if (!mapPubKeys.count(hash160))
+ vector<unsigned char> vchPubKey;
+ if (!pwalletMain->GetPubKey(address, vchPubKey))
return;
- CWalletDB().WriteDefaultKey(mapPubKeys[hash160]);
+ pwalletMain->SetDefaultKey(vchPubKey);
pframeMain->m_textCtrlAddress->SetValue(strAddress);
}
}
+bool GetWalletPassphrase()
+{
+ if (pwalletMain->IsLocked())
+ {
+ string strWalletPass;
+ strWalletPass.reserve(100);
+ mlock(&strWalletPass[0], strWalletPass.capacity());
+
+ // obtain current wallet encrypt/decrypt key, from passphrase
+ // Note that the passphrase is not mlock()d during this entry and could potentially
+ // be obtained from disk long after bitcoin has run.
+ strWalletPass = wxGetPasswordFromUser(_("Enter the current passphrase to the wallet."),
+ _("Passphrase")).ToStdString();
+
+ if (!strWalletPass.size())
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ wxMessageBox(_("Please supply the current wallet decryption passphrase."), "Bitcoin");
+ return false;
+ }
+
+ if (!pwalletMain->Unlock(strWalletPass))
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ wxMessageBox(_("The passphrase entered for the wallet decryption was incorrect."), "Bitcoin");
+ return false;
+ }
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ }
+ return true;
+}
+
@@ -261,9 +312,10 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
fOnSetFocusAddress = false;
fRefresh = false;
m_choiceFilter->SetSelection(0);
- double dResize = 1.0;
+ double dResize = nScaleX;
#ifdef __WXMSW__
SetIcon(wxICON(bitcoin));
+ SetSize(dResize * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
#else
SetIcon(bitcoin80_xpm);
SetBackgroundColour(m_toolBar->GetBackgroundColour());
@@ -275,7 +327,7 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
dResize = 1.22;
SetSize(dResize * GetSize().GetWidth(), 1.15 * GetSize().GetHeight());
#endif
- m_staticTextBalance->SetLabel(FormatMoney(GetBalance()) + " ");
+ m_staticTextBalance->SetLabel(FormatMoney(pwalletMain->GetBalance()) + " ");
m_listCtrl->SetFocus();
ptaskbaricon = new CMyTaskBarIcon();
#ifdef __WXMAC_OSX__
@@ -294,7 +346,7 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
dResize -= 0.01;
#endif
wxListCtrl* pplistCtrl[] = {m_listCtrlAll, m_listCtrlSentReceived, m_listCtrlSent, m_listCtrlReceived};
- foreach(wxListCtrl* p, pplistCtrl)
+ BOOST_FOREACH(wxListCtrl* p, pplistCtrl)
{
p->InsertColumn(0, "", wxLIST_FORMAT_LEFT, dResize * 0);
p->InsertColumn(1, "", wxLIST_FORMAT_LEFT, dResize * 0);
@@ -315,8 +367,13 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
// Fill your address text box
vector<unsigned char> vchPubKey;
- if (CWalletDB("r").ReadDefaultKey(vchPubKey))
- m_textCtrlAddress->SetValue(PubKeyToAddress(vchPubKey));
+ if (CWalletDB(pwalletMain->strWalletFile,"r").ReadDefaultKey(vchPubKey))
+ m_textCtrlAddress->SetValue(CBitcoinAddress(vchPubKey).ToString());
+
+ if (pwalletMain->IsCrypted())
+ m_menuOptions->Remove(m_menuOptionsEncryptWallet);
+ else
+ m_menuOptions->Remove(m_menuOptionsChangeWalletPassphrase);
// Fill listctrl with wallet transactions
RefreshListCtrl();
@@ -507,7 +564,7 @@ string FormatTxStatus(const CWalletTx& wtx)
// Status
if (!wtx.IsFinal())
{
- if (wtx.nLockTime < 500000000)
+ if (wtx.nLockTime < LOCKTIME_THRESHOLD)
return strprintf(_("Open for %d blocks"), nBestHeight - wtx.nLockTime);
else
return strprintf(_("Open until %s"), DateTimeStr(wtx.nLockTime).c_str());
@@ -528,7 +585,7 @@ string SingleLine(const string& strIn)
{
string strOut;
bool fOneSpace = false;
- foreach(unsigned char c, strIn)
+ BOOST_FOREACH(unsigned char c, strIn)
{
if (isspace(c))
{
@@ -609,8 +666,8 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
if (nCredit == 0)
{
int64 nUnmatured = 0;
- foreach(const CTxOut& txout, wtx.vout)
- nUnmatured += txout.GetCredit();
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ nUnmatured += pwalletMain->GetCredit(txout);
if (wtx.IsInMainChain())
{
strDescription = strprintf(_("Generated (%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
@@ -644,28 +701,27 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
// Received by Bitcoin Address
if (!fShowReceived)
return false;
- foreach(const CTxOut& txout, wtx.vout)
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
- if (txout.IsMine())
+ if (pwalletMain->IsMine(txout))
{
- vector<unsigned char> vchPubKey;
- if (ExtractPubKey(txout.scriptPubKey, true, vchPubKey))
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, pwalletMain, address))
{
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
//strDescription += _("Received payment to ");
//strDescription += _("Received with address ");
strDescription += _("Received with: ");
- string strAddress = PubKeyToAddress(vchPubKey);
- map<string, string>::iterator mi = mapAddressBook.find(strAddress);
- if (mi != mapAddressBook.end() && !(*mi).second.empty())
+ map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address);
+ if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
{
string strLabel = (*mi).second;
- strDescription += strAddress.substr(0,12) + "... ";
+ strDescription += address.ToString().substr(0,12) + "... ";
strDescription += "(" + strLabel + ")";
}
else
- strDescription += strAddress;
+ strDescription += address.ToString();
}
}
break;
@@ -687,12 +743,12 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
else
{
bool fAllFromMe = true;
- foreach(const CTxIn& txin, wtx.vin)
- fAllFromMe = fAllFromMe && txin.IsMine();
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ fAllFromMe = fAllFromMe && pwalletMain->IsMine(txin);
bool fAllToMe = true;
- foreach(const CTxOut& txout, wtx.vout)
- fAllToMe = fAllToMe && txout.IsMine();
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ fAllToMe = fAllToMe && pwalletMain->IsMine(txout);
if (fAllFromMe && fAllToMe)
{
@@ -718,9 +774,10 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
for (int nOut = 0; nOut < wtx.vout.size(); nOut++)
{
const CTxOut& txout = wtx.vout[nOut];
- if (txout.IsMine())
+ if (pwalletMain->IsMine(txout))
continue;
+ CBitcoinAddress address;
string strAddress;
if (!mapValue["to"].empty())
{
@@ -730,15 +787,14 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
else
{
// Sent to Bitcoin Address
- uint160 hash160;
- if (ExtractHash160(txout.scriptPubKey, hash160))
- strAddress = Hash160ToAddress(hash160);
+ if (ExtractAddress(txout.scriptPubKey, NULL, address))
+ strAddress = address.ToString();
}
string strDescription = _("To: ");
- CRITICAL_BLOCK(cs_mapAddressBook)
- if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
- strDescription += mapAddressBook[strAddress] + " ";
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ if (pwalletMain->mapAddressBook.count(address) && !pwalletMain->mapAddressBook[address].empty())
+ strDescription += pwalletMain->mapAddressBook[address] + " ";
strDescription += strAddress;
if (!mapValue["message"].empty())
{
@@ -776,10 +832,10 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
// Mixed debit transaction, can't break down payees
//
bool fAllMine = true;
- foreach(const CTxOut& txout, wtx.vout)
- fAllMine = fAllMine && txout.IsMine();
- foreach(const CTxIn& txin, wtx.vin)
- fAllMine = fAllMine && txin.IsMine();
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ fAllMine = fAllMine && pwalletMain->IsMine(txout);
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ fAllMine = fAllMine && pwalletMain->IsMine(txin);
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
@@ -806,16 +862,16 @@ void CMainFrame::OnIdle(wxIdleEvent& event)
// Collect list of wallet transactions and sort newest first
bool fEntered = false;
vector<pair<unsigned int, uint256> > vSorted;
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
printf("RefreshListCtrl starting\n");
fEntered = true;
fRefreshListCtrl = false;
- vWalletUpdated.clear();
+ pwalletMain->vWalletUpdated.clear();
// Do the newest transactions first
- vSorted.reserve(mapWallet.size());
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ vSorted.reserve(pwalletMain->mapWallet.size());
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
unsigned int nTime = UINT_MAX - wtx.GetTxTime();
@@ -834,12 +890,12 @@ void CMainFrame::OnIdle(wxIdleEvent& event)
if (fShutdown)
return;
bool fEntered = false;
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
fEntered = true;
uint256& hash = vSorted[i++].second;
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(hash);
- if (mi != mapWallet.end())
+ map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
+ if (mi != pwalletMain->mapWallet.end())
InsertTransaction((*mi).second, true);
}
if (!fEntered || i == 100 || i % 500 == 0)
@@ -857,10 +913,10 @@ void CMainFrame::OnIdle(wxIdleEvent& event)
static int64 nLastTime;
if (GetTime() > nLastTime + 30)
{
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
nLastTime = GetTime();
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
CWalletTx& wtx = (*it).second;
if (wtx.nTimeDisplayed && wtx.nTimeDisplayed != wtx.GetTxTime())
@@ -881,7 +937,7 @@ void CMainFrame::RefreshStatusColumn()
if (nTop == nLastTop && pindexLastBest == pindexBest)
return;
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
int nStart = nTop;
int nEnd = min(nStart + 100, m_listCtrl->GetItemCount());
@@ -901,8 +957,8 @@ void CMainFrame::RefreshStatusColumn()
for (int nIndex = nStart; nIndex < min(nEnd, m_listCtrl->GetItemCount()); nIndex++)
{
uint256 hash((string)GetItemText(m_listCtrl, nIndex, 1));
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(hash);
- if (mi == mapWallet.end())
+ map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
+ if (mi == pwalletMain->mapWallet.end())
{
printf("CMainFrame::RefreshStatusColumn() : tx not found in mapWallet\n");
continue;
@@ -999,41 +1055,41 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
nLastRepaintTime = GetTimeMillis();
// Update listctrl contents
- if (!vWalletUpdated.empty())
+ if (!pwalletMain->vWalletUpdated.empty())
{
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
string strTop;
if (m_listCtrl->GetItemCount())
strTop = (string)m_listCtrl->GetItemText(0);
- foreach(uint256 hash, vWalletUpdated)
+ BOOST_FOREACH(uint256 hash, pwalletMain->vWalletUpdated)
{
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(hash);
- if (mi != mapWallet.end())
+ map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
+ if (mi != pwalletMain->mapWallet.end())
InsertTransaction((*mi).second, false);
}
- vWalletUpdated.clear();
+ pwalletMain->vWalletUpdated.clear();
if (m_listCtrl->GetItemCount() && strTop != (string)m_listCtrl->GetItemText(0))
m_listCtrl->ScrollList(0, INT_MIN/2);
}
}
// Balance total
- TRY_CRITICAL_BLOCK(cs_mapWallet)
+ TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
fPaintedBalance = true;
- m_staticTextBalance->SetLabel(FormatMoney(GetBalance()) + " ");
+ m_staticTextBalance->SetLabel(FormatMoney(pwalletMain->GetBalance()) + " ");
// Count hidden and multi-line transactions
nTransactionCount = 0;
- for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
CWalletTx& wtx = (*it).second;
nTransactionCount += wtx.nLinesDisplayed;
}
}
}
- if (!vWalletUpdated.empty() || !fPaintedBalance)
+ if (!pwalletMain->vWalletUpdated.empty() || !fPaintedBalance)
nNeedRepaint++;
// Update status column of visible items only
@@ -1059,7 +1115,7 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
m_statusBar->SetStatusText(strStatus, 2);
// Update receiving address
- string strDefaultAddress = PubKeyToAddress(vchDefaultKey);
+ string strDefaultAddress = CBitcoinAddress(pwalletMain->vchDefaultKey).ToString();
if (m_textCtrlAddress->GetValue() != strDefaultAddress)
m_textCtrlAddress->SetValue(strDefaultAddress);
}
@@ -1094,12 +1150,6 @@ void CMainFrame::OnMenuFileExit(wxCommandEvent& event)
Close(true);
}
-void CMainFrame::OnMenuOptionsGenerate(wxCommandEvent& event)
-{
- // Options->Generate Coins
- GenerateBitcoins(event.IsChecked());
-}
-
void CMainFrame::OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event)
{
event.Check(fGenerateBitcoins);
@@ -1113,6 +1163,169 @@ void CMainFrame::OnMenuOptionsChangeYourAddress(wxCommandEvent& event)
return;
}
+void CMainFrame::OnMenuOptionsEncryptWallet(wxCommandEvent& event)
+{
+ // Options->Encrypt Wallet
+ if (pwalletMain->IsCrypted())
+ {
+ wxMessageBox(_("Wallet already encrypted."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ string strWalletPass;
+ strWalletPass.reserve(100);
+ mlock(&strWalletPass[0], strWalletPass.capacity());
+
+ // obtain current wallet encrypt/decrypt key, from passphrase
+ // Note that the passphrase is not mlock()d during this entry and could potentially
+ // be obtained from disk long after bitcoin has run.
+ strWalletPass = wxGetPasswordFromUser(_("Enter the new passphrase to the wallet.\nPlease use a passphrase of 10 or more random characters, or eight or more words."),
+ _("Passphrase")).ToStdString();
+
+ if (!strWalletPass.size())
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ wxMessageBox(_("Error: The supplied passphrase was too short."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ if(wxMessageBox(_("WARNING: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR BITCOINS!\nAre you sure you wish to encrypt your wallet?"), "Bitcoin", wxYES_NO) != wxYES)
+ return;
+
+ string strWalletPassTest;
+ strWalletPassTest.reserve(100);
+ mlock(&strWalletPassTest[0], strWalletPassTest.capacity());
+ strWalletPassTest = wxGetPasswordFromUser(_("Please re-enter your new wallet passphrase."),
+ _("Passphrase")).ToStdString();
+
+ if (strWalletPassTest != strWalletPass)
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ fill(strWalletPassTest.begin(), strWalletPassTest.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ munlock(&strWalletPassTest[0], strWalletPassTest.capacity());
+ wxMessageBox(_("Error: the supplied passphrases didn't match."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ if (!pwalletMain->EncryptWallet(strWalletPass))
+ {
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ fill(strWalletPassTest.begin(), strWalletPassTest.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ munlock(&strWalletPassTest[0], strWalletPassTest.capacity());
+ wxMessageBox(_("Wallet encryption failed."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+ fill(strWalletPass.begin(), strWalletPass.end(), '\0');
+ fill(strWalletPassTest.begin(), strWalletPassTest.end(), '\0');
+ munlock(&strWalletPass[0], strWalletPass.capacity());
+ munlock(&strWalletPassTest[0], strWalletPassTest.capacity());
+ wxMessageBox(_("Wallet Encrypted.\nRemember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer."), "Bitcoin");
+
+ m_menuOptions->Remove(m_menuOptionsEncryptWallet);
+ m_menuOptions->Insert(m_menuOptions->GetMenuItemCount() - 1, m_menuOptionsChangeWalletPassphrase);
+}
+
+void CMainFrame::OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event)
+{
+ // Options->Change Wallet Encryption Passphrase
+ if (!pwalletMain->IsCrypted())
+ {
+ wxMessageBox(_("Wallet is unencrypted, please encrypt it first."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ string strOldWalletPass;
+ strOldWalletPass.reserve(100);
+ mlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+
+ // obtain current wallet encrypt/decrypt key, from passphrase
+ // Note that the passphrase is not mlock()d during this entry and could potentially
+ // be obtained from disk long after bitcoin has run.
+ strOldWalletPass = wxGetPasswordFromUser(_("Enter the current passphrase to the wallet."),
+ _("Passphrase")).ToStdString();
+
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
+ {
+ bool fWasLocked = pwalletMain->IsLocked();
+ pwalletMain->Lock();
+
+ if (!strOldWalletPass.size() || !pwalletMain->Unlock(strOldWalletPass))
+ {
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ wxMessageBox(_("The passphrase entered for the wallet decryption was incorrect."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ if (fWasLocked)
+ pwalletMain->Lock();
+
+ string strNewWalletPass;
+ strNewWalletPass.reserve(100);
+ mlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+
+ // obtain new wallet encrypt/decrypt key, from passphrase
+ // Note that the passphrase is not mlock()d during this entry and could potentially
+ // be obtained from disk long after bitcoin has run.
+ strNewWalletPass = wxGetPasswordFromUser(_("Enter the new passphrase for the wallet."),
+ _("Passphrase")).ToStdString();
+
+ if (!strNewWalletPass.size())
+ {
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ wxMessageBox(_("Error: The supplied passphrase was too short."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ string strNewWalletPassTest;
+ strNewWalletPassTest.reserve(100);
+ mlock(&strNewWalletPassTest[0], strNewWalletPassTest.capacity());
+
+ // obtain new wallet encrypt/decrypt key, from passphrase
+ // Note that the passphrase is not mlock()d during this entry and could potentially
+ // be obtained from disk long after bitcoin has run.
+ strNewWalletPassTest = wxGetPasswordFromUser(_("Re-enter the new passphrase for the wallet."),
+ _("Passphrase")).ToStdString();
+
+ if (strNewWalletPassTest != strNewWalletPass)
+ {
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ fill(strNewWalletPassTest.begin(), strNewWalletPassTest.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ munlock(&strNewWalletPassTest[0], strNewWalletPassTest.capacity());
+ wxMessageBox(_("Error: the supplied passphrases didn't match."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+
+ if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass))
+ {
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ fill(strNewWalletPassTest.begin(), strNewWalletPassTest.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ munlock(&strNewWalletPassTest[0], strNewWalletPassTest.capacity());
+ wxMessageBox(_("The passphrase entered for the wallet decryption was incorrect."), "Bitcoin", wxOK | wxICON_ERROR);
+ return;
+ }
+ fill(strOldWalletPass.begin(), strOldWalletPass.end(), '\0');
+ fill(strNewWalletPass.begin(), strNewWalletPass.end(), '\0');
+ fill(strNewWalletPassTest.begin(), strNewWalletPassTest.end(), '\0');
+ munlock(&strOldWalletPass[0], strOldWalletPass.capacity());
+ munlock(&strNewWalletPass[0], strNewWalletPass.capacity());
+ munlock(&strNewWalletPassTest[0], strNewWalletPassTest.capacity());
+ wxMessageBox(_("Wallet Passphrase Changed."), "Bitcoin");
+ }
+}
+
void CMainFrame::OnMenuOptionsOptions(wxCommandEvent& event)
{
// Options->Options
@@ -1173,11 +1386,23 @@ void CMainFrame::OnButtonNew(wxCommandEvent& event)
return;
string strName = dialog.GetValue();
- // Generate new key
- string strAddress = PubKeyToAddress(GetKeyFromKeyPool());
+ string strAddress;
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
+ {
+ bool fWasLocked = pwalletMain->IsLocked();
+ if (!GetWalletPassphrase())
+ return;
+
+ // Generate new key
+ strAddress = CBitcoinAddress(pwalletMain->GetOrReuseKeyFromPool()).ToString();
+
+ if (fWasLocked)
+ pwalletMain->Lock();
+ }
// Save
- SetAddressBookName(strAddress, strName);
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ pwalletMain->SetAddressBookName(strAddress, strName);
SetDefaultReceivingAddress(strAddress);
}
@@ -1195,10 +1420,10 @@ void CMainFrame::OnListItemActivated(wxListEvent& event)
{
uint256 hash((string)GetItemText(m_listCtrl, event.GetIndex(), 1));
CWalletTx wtx;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(hash);
- if (mi == mapWallet.end())
+ map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
+ if (mi == pwalletMain->mapWallet.end())
{
printf("CMainFrame::OnListItemActivated() : tx not found in mapWallet\n");
return;
@@ -1223,7 +1448,10 @@ void CMainFrame::OnListItemActivated(wxListEvent& event)
CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetailsDialogBase(parent)
{
- CRITICAL_BLOCK(cs_mapAddressBook)
+#ifdef __WXMSW__
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
+#endif
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
string strHTML;
strHTML.reserve(4000);
@@ -1271,21 +1499,20 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (nNet > 0)
{
// Credit
- foreach(const CTxOut& txout, wtx.vout)
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
- if (txout.IsMine())
+ if (pwalletMain->IsMine(txout))
{
- vector<unsigned char> vchPubKey;
- if (ExtractPubKey(txout.scriptPubKey, true, vchPubKey))
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, pwalletMain, address))
{
- string strAddress = PubKeyToAddress(vchPubKey);
- if (mapAddressBook.count(strAddress))
+ if (pwalletMain->mapAddressBook.count(address))
{
strHTML += string() + _("<b>From:</b> ") + _("unknown") + "<br>";
strHTML += _("<b>To:</b> ");
- strHTML += HtmlEscape(strAddress);
- if (!mapAddressBook[strAddress].empty())
- strHTML += _(" (yours, label: ") + mapAddressBook[strAddress] + ")";
+ strHTML += HtmlEscape(address.ToString());
+ if (!pwalletMain->mapAddressBook[address].empty())
+ strHTML += _(" (yours, label: ") + pwalletMain->mapAddressBook[address] + ")";
else
strHTML += _(" (yours)");
strHTML += "<br>";
@@ -1307,8 +1534,8 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
// Online transaction
strAddress = wtx.mapValue["to"];
strHTML += _("<b>To:</b> ");
- if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
- strHTML += mapAddressBook[strAddress] + " ";
+ if (pwalletMain->mapAddressBook.count(strAddress) && !pwalletMain->mapAddressBook[strAddress].empty())
+ strHTML += pwalletMain->mapAddressBook[strAddress] + " ";
strHTML += HtmlEscape(strAddress) + "<br>";
}
@@ -1322,8 +1549,8 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
// Coinbase
//
int64 nUnmatured = 0;
- foreach(const CTxOut& txout, wtx.vout)
- nUnmatured += txout.GetCredit();
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ nUnmatured += pwalletMain->GetCredit(txout);
strHTML += _("<b>Credit:</b> ");
if (wtx.IsInMainChain())
strHTML += strprintf(_("(%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
@@ -1341,33 +1568,33 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
else
{
bool fAllFromMe = true;
- foreach(const CTxIn& txin, wtx.vin)
- fAllFromMe = fAllFromMe && txin.IsMine();
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ fAllFromMe = fAllFromMe && pwalletMain->IsMine(txin);
bool fAllToMe = true;
- foreach(const CTxOut& txout, wtx.vout)
- fAllToMe = fAllToMe && txout.IsMine();
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ fAllToMe = fAllToMe && pwalletMain->IsMine(txout);
if (fAllFromMe)
{
//
// Debit
//
- foreach(const CTxOut& txout, wtx.vout)
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
- if (txout.IsMine())
+ if (pwalletMain->IsMine(txout))
continue;
if (wtx.mapValue["to"].empty())
{
// Offline transaction
- uint160 hash160;
- if (ExtractHash160(txout.scriptPubKey, hash160))
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, pwalletMain, address))
{
- string strAddress = Hash160ToAddress(hash160);
+ string strAddress = address.ToString();
strHTML += _("<b>To:</b> ");
- if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
- strHTML += mapAddressBook[strAddress] + " ";
+ if (pwalletMain->mapAddressBook.count(address) && !pwalletMain->mapAddressBook[address].empty())
+ strHTML += pwalletMain->mapAddressBook[address] + " ";
strHTML += strAddress;
strHTML += "<br>";
}
@@ -1394,12 +1621,12 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
//
// Mixed debit transaction
//
- foreach(const CTxIn& txin, wtx.vin)
- if (txin.IsMine())
- strHTML += _("<b>Debit:</b> ") + FormatMoney(-txin.GetDebit()) + "<br>";
- foreach(const CTxOut& txout, wtx.vout)
- if (txout.IsMine())
- strHTML += _("<b>Credit:</b> ") + FormatMoney(txout.GetCredit()) + "<br>";
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ if (pwalletMain->IsMine(txin))
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-pwalletMain->GetDebit(txin)) + "<br>";
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ if (pwalletMain->IsMine(txout))
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(pwalletMain->GetCredit(txout)) + "<br>";
}
}
@@ -1424,31 +1651,31 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (fDebug)
{
strHTML += "<hr><br>debug print<br><br>";
- foreach(const CTxIn& txin, wtx.vin)
- if (txin.IsMine())
- strHTML += "<b>Debit:</b> " + FormatMoney(-txin.GetDebit()) + "<br>";
- foreach(const CTxOut& txout, wtx.vout)
- if (txout.IsMine())
- strHTML += "<b>Credit:</b> " + FormatMoney(txout.GetCredit()) + "<br>";
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ if (pwalletMain->IsMine(txin))
+ strHTML += "<b>Debit:</b> " + FormatMoney(-pwalletMain->GetDebit(txin)) + "<br>";
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ if (pwalletMain->IsMine(txout))
+ strHTML += "<b>Credit:</b> " + FormatMoney(pwalletMain->GetCredit(txout)) + "<br>";
strHTML += "<br><b>Transaction:</b><br>";
strHTML += HtmlEscape(wtx.ToString(), true);
strHTML += "<br><b>Inputs:</b><br>";
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
{
- foreach(const CTxIn& txin, wtx.vin)
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
{
COutPoint prevout = txin.prevout;
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(prevout.hash);
- if (mi != mapWallet.end())
+ map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(prevout.hash);
+ if (mi != pwalletMain->mapWallet.end())
{
const CWalletTx& prev = (*mi).second;
if (prevout.n < prev.vout.size())
{
strHTML += HtmlEscape(prev.ToString(), true);
strHTML += " &nbsp;&nbsp; " + FormatTxStatus(prev) + ", ";
- strHTML = strHTML + "IsMine=" + (prev.vout[prevout.n].IsMine() ? "true" : "false") + "<br>";
+ strHTML = strHTML + "IsMine=" + (pwalletMain->IsMine(prev.vout[prevout.n]) ? "true" : "false") + "<br>";
}
}
}
@@ -1637,6 +1864,8 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)
SelectPage(0);
#ifndef __WXMSW__
SetSize(1.0 * GetSize().GetWidth(), 1.2 * GetSize().GetHeight());
+#else
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
#endif
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
m_checkBoxStartOnSystemStartup->SetLabel(_("&Start Bitcoin on window system startup"));
@@ -1655,13 +1884,6 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)
// Init values
m_textCtrlTransactionFee->SetValue(FormatMoney(nTransactionFee));
- m_checkBoxLimitProcessors->SetValue(fLimitProcessors);
- m_spinCtrlLimitProcessors->Enable(fLimitProcessors);
- m_spinCtrlLimitProcessors->SetValue(nLimitProcessors);
- int nProcessors = wxThread::GetCPUCount();
- if (nProcessors < 1)
- nProcessors = 999;
- m_spinCtrlLimitProcessors->SetRange(1, nProcessors);
m_checkBoxStartOnSystemStartup->SetValue(fTmpStartOnSystemStartup = GetStartOnSystemStartup());
m_checkBoxMinimizeToTray->SetValue(fMinimizeToTray);
m_checkBoxMinimizeOnClose->SetValue(fMinimizeOnClose);
@@ -1702,11 +1924,6 @@ void COptionsDialog::OnKillFocusTransactionFee(wxFocusEvent& event)
m_textCtrlTransactionFee->SetValue(FormatMoney(nTmp));
}
-void COptionsDialog::OnCheckBoxLimitProcessors(wxCommandEvent& event)
-{
- m_spinCtrlLimitProcessors->Enable(event.IsChecked());
-}
-
void COptionsDialog::OnCheckBoxUseProxy(wxCommandEvent& event)
{
m_textCtrlProxyIP->Enable(event.IsChecked());
@@ -1749,26 +1966,12 @@ void COptionsDialog::OnButtonCancel(wxCommandEvent& event)
void COptionsDialog::OnButtonApply(wxCommandEvent& event)
{
- CWalletDB walletdb;
+ CWalletDB walletdb(pwalletMain->strWalletFile);
int64 nPrevTransactionFee = nTransactionFee;
if (ParseMoney(m_textCtrlTransactionFee->GetValue(), nTransactionFee) && nTransactionFee != nPrevTransactionFee)
walletdb.WriteSetting("nTransactionFee", nTransactionFee);
- int nPrevMaxProc = (fLimitProcessors ? nLimitProcessors : INT_MAX);
- if (fLimitProcessors != m_checkBoxLimitProcessors->GetValue())
- {
- fLimitProcessors = m_checkBoxLimitProcessors->GetValue();
- walletdb.WriteSetting("fLimitProcessors", fLimitProcessors);
- }
- if (nLimitProcessors != m_spinCtrlLimitProcessors->GetValue())
- {
- nLimitProcessors = m_spinCtrlLimitProcessors->GetValue();
- walletdb.WriteSetting("nLimitProcessors", nLimitProcessors);
- }
- if (fGenerateBitcoins && (fLimitProcessors ? nLimitProcessors : INT_MAX) > nPrevMaxProc)
- GenerateBitcoins(fGenerateBitcoins);
-
if (fTmpStartOnSystemStartup != m_checkBoxStartOnSystemStartup->GetValue())
{
fTmpStartOnSystemStartup = m_checkBoxStartOnSystemStartup->GetValue();
@@ -1833,6 +2036,8 @@ CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
fontTmp.SetPointSize(8);
m_staticTextMain->SetFont(fontTmp);
SetSize(GetSize().GetWidth() + 44, GetSize().GetHeight() + 10);
+#else
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
#endif
}
@@ -1859,6 +2064,7 @@ CSendDialog::CSendDialog(wxWindow* parent, const wxString& strAddress) : CSendDi
m_bitmapCheckMark->Show(false);
fEnabledPrev = true;
m_textCtrlAddress->SetFocus();
+
//// todo: should add a display of your balance for convenience
#ifndef __WXMSW__
wxFont fontTmp = m_staticTextInstructions->GetFont();
@@ -1866,12 +2072,21 @@ CSendDialog::CSendDialog(wxWindow* parent, const wxString& strAddress) : CSendDi
fontTmp.SetPointSize(9);
m_staticTextInstructions->SetFont(fontTmp);
SetSize(725, 180);
+#else
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
#endif
-
+
// Set Icon
- wxIcon iconSend;
- iconSend.CopyFromBitmap(wxBitmap(send16noshadow_xpm));
- SetIcon(iconSend);
+ if (nScaleX == 1.0 && nScaleY == 1.0) // We don't have icons of the proper size otherwise
+ {
+ wxIcon iconSend;
+ iconSend.CopyFromBitmap(wxBitmap(send16noshadow_xpm));
+ SetIcon(iconSend);
+ }
+#ifdef __WXMSW__
+ else
+ SetIcon(wxICON(bitcoin));
+#endif
// Fixup the tab order
m_buttonPaste->MoveAfterInTabOrder(m_buttonCancel);
@@ -1928,39 +2143,54 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event)
wxMessageBox(_("Error in amount "), _("Send Coins"));
return;
}
- if (nValue > GetBalance())
+ if (nValue > pwalletMain->GetBalance())
{
wxMessageBox(_("Amount exceeds your balance "), _("Send Coins"));
return;
}
- if (nValue + nTransactionFee > GetBalance())
+ if (nValue + nTransactionFee > pwalletMain->GetBalance())
{
wxMessageBox(string(_("Total exceeds your balance when the ")) + FormatMoney(nTransactionFee) + _(" transaction fee is included "), _("Send Coins"));
return;
}
// Parse bitcoin address
- uint160 hash160;
- bool fBitcoinAddress = AddressToHash160(strAddress, hash160);
+ CBitcoinAddress address(strAddress);
+ bool fBitcoinAddress = address.IsValid();
if (fBitcoinAddress)
{
CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
{
+ bool fWasLocked = pwalletMain->IsLocked();
+ if (!GetWalletPassphrase())
+ return;
+
// Send to bitcoin address
CScript scriptPubKey;
- scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
+ scriptPubKey.SetBitcoinAddress(address);
- string strError = SendMoney(scriptPubKey, nValue, wtx, true);
+ string strError = pwalletMain->SendMoney(scriptPubKey, nValue, wtx, true);
if (strError == "")
wxMessageBox(_("Payment sent "), _("Sending..."));
else if (strError == "ABORTED")
+ {
+ if (fWasLocked)
+ pwalletMain->Lock();
return; // leave send dialog open
+ }
else
{
wxMessageBox(strError + " ", _("Sending..."));
EndModal(false);
+ if (fWasLocked)
+ pwalletMain->Lock();
+ return;
}
+
+ if (fWasLocked)
+ pwalletMain->Lock();
}
}
else
@@ -1982,9 +2212,9 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event)
return;
}
- CRITICAL_BLOCK(cs_mapAddressBook)
- if (!mapAddressBook.count(strAddress))
- SetAddressBookName(strAddress, "");
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ if (!pwalletMain->mapAddressBook.count(address))
+ pwalletMain->SetAddressBookName(strAddress, "");
EndModal(true);
}
@@ -2020,6 +2250,8 @@ CSendingDialog::CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 n
fWorkDone = false;
#ifndef __WXMSW__
SetSize(1.2 * GetSize().GetWidth(), 1.08 * GetSize().GetHeight());
+#else
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
#endif
SetTitle(strprintf(_("Sending %s to %s"), FormatMoney(nPrice).c_str(), wtx.mapValue["to"].c_str()));
@@ -2166,7 +2398,7 @@ void SendingDialogStartTransfer(void* parg)
void CSendingDialog::StartTransfer()
{
// Make sure we have enough money
- if (nPrice + nTransactionFee > GetBalance())
+ if (nPrice + nTransactionFee > pwalletMain->GetBalance())
{
Error(_("Insufficient funds"));
return;
@@ -2237,21 +2469,32 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
// Pay
if (!Status(_("Creating transaction...")))
return;
- if (nPrice + nTransactionFee > GetBalance())
+ if (nPrice + nTransactionFee > pwalletMain->GetBalance())
{
Error(_("Insufficient funds"));
return;
}
- CReserveKey reservekey;
+
+ CReserveKey reservekey(pwalletMain);
int64 nFeeRequired;
- if (!CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired))
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
{
- if (nPrice + nFeeRequired > GetBalance())
- Error(strprintf(_("This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"), FormatMoney(nFeeRequired).c_str()));
- else
- Error(_("Transaction creation failed"));
- return;
- }
+ bool fWasLocked = pwalletMain->IsLocked();
+ if (!GetWalletPassphrase())
+ return;
+
+ if (!pwalletMain->CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired))
+ {
+ if (nPrice + nFeeRequired > pwalletMain->GetBalance())
+ Error(strprintf(_("This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"), FormatMoney(nFeeRequired).c_str()));
+ else
+ Error(_("Transaction creation failed"));
+ return;
+ }
+
+ if (fWasLocked)
+ pwalletMain->Lock();
+ }
// Transaction fee
if (!ThreadSafeAskFee(nFeeRequired, _("Sending..."), this))
@@ -2284,7 +2527,7 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
return;
// Commit
- if (!CommitTransaction(wtx, reservekey))
+ if (!pwalletMain->CommitTransaction(wtx, reservekey))
{
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."));
return;
@@ -2343,6 +2586,10 @@ void CSendingDialog::OnReply3(CDataStream& vRecv)
CAddressBookDialog::CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, int nPageIn, bool fDuringSendIn) : CAddressBookDialogBase(parent)
{
+#ifdef __WXMSW__
+ SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
+#endif
+
// Set initially selected page
wxNotebookEvent event;
event.SetSelection(nPageIn);
@@ -2354,9 +2601,16 @@ CAddressBookDialog::CAddressBookDialog(wxWindow* parent, const wxString& strInit
m_buttonCancel->Show(false);
// Set Icon
- wxIcon iconAddressBook;
- iconAddressBook.CopyFromBitmap(wxBitmap(addressbook16_xpm));
- SetIcon(iconAddressBook);
+ if (nScaleX == 1.0 && nScaleY == 1.0) // We don't have icons of the proper size otherwise
+ {
+ wxIcon iconAddressBook;
+ iconAddressBook.CopyFromBitmap(wxBitmap(addressbook16_xpm));
+ SetIcon(iconAddressBook);
+ }
+#ifdef __WXMSW__
+ else
+ SetIcon(wxICON(bitcoin));
+#endif
// Init column headers
m_listCtrlSending->InsertColumn(0, _("Name"), wxLIST_FORMAT_LEFT, 200);
@@ -2367,19 +2621,18 @@ CAddressBookDialog::CAddressBookDialog(wxWindow* parent, const wxString& strInit
m_listCtrlReceiving->SetFocus();
// Fill listctrl with address book data
- CRITICAL_BLOCK(cs_mapKeys)
- CRITICAL_BLOCK(cs_mapAddressBook)
+ CRITICAL_BLOCK(pwalletMain->cs_KeyStore)
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
{
string strDefaultReceiving = (string)pframeMain->m_textCtrlAddress->GetValue();
- foreach(const PAIRTYPE(string, string)& item, mapAddressBook)
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
- string strAddress = item.first;
+ const CBitcoinAddress& address = item.first;
string strName = item.second;
- uint160 hash160;
- bool fMine = (AddressToHash160(strAddress, hash160) && mapPubKeys.count(hash160));
+ bool fMine = pwalletMain->HaveKey(address);
wxListCtrl* plistCtrl = fMine ? m_listCtrlReceiving : m_listCtrlSending;
- int nIndex = InsertLine(plistCtrl, strName, strAddress);
- if (strAddress == (fMine ? strDefaultReceiving : string(strInitSelected)))
+ int nIndex = InsertLine(plistCtrl, strName, address.ToString());
+ if (address.ToString() == (fMine ? strDefaultReceiving : string(strInitSelected)))
plistCtrl->SetItemState(nIndex, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED);
}
}
@@ -2430,7 +2683,8 @@ void CAddressBookDialog::OnListEndLabelEdit(wxListEvent& event)
if (event.IsEditCancelled())
return;
string strAddress = (string)GetItemText(m_listCtrl, event.GetIndex(), 1);
- SetAddressBookName(strAddress, string(event.GetText()));
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ pwalletMain->SetAddressBookName(strAddress, string(event.GetText()));
pframeMain->RefreshListCtrl();
}
@@ -2465,7 +2719,8 @@ void CAddressBookDialog::OnButtonDelete(wxCommandEvent& event)
if (m_listCtrl->GetItemState(nIndex, wxLIST_STATE_SELECTED))
{
string strAddress = (string)GetItemText(m_listCtrl, nIndex, 1);
- CWalletDB().EraseName(strAddress);
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ pwalletMain->DelAddressBookName(strAddress);
m_listCtrl->DeleteItem(nIndex);
}
}
@@ -2484,8 +2739,8 @@ void CAddressBookDialog::OnButtonCopy(wxCommandEvent& event)
bool CAddressBookDialog::CheckIfMine(const string& strAddress, const string& strTitle)
{
- uint160 hash160;
- bool fMine = (AddressToHash160(strAddress, hash160) && mapPubKeys.count(hash160));
+ CBitcoinAddress address(strAddress);
+ bool fMine = address.IsValid() && pwalletMain->HaveKey(address);
if (fMine)
wxMessageBox(_("This is one of your own addresses for receiving payments and cannot be entered in the address book. "), strTitle);
return fMine;
@@ -2524,9 +2779,12 @@ void CAddressBookDialog::OnButtonEdit(wxCommandEvent& event)
}
// Write back
- if (strAddress != strAddressOrg)
- CWalletDB().EraseName(strAddressOrg);
- SetAddressBookName(strAddress, strName);
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ {
+ if (strAddress != strAddressOrg)
+ pwalletMain->DelAddressBookName(strAddressOrg);
+ pwalletMain->SetAddressBookName(strAddress, strName);
+ }
m_listCtrl->SetItem(nIndex, 1, strAddress);
m_listCtrl->SetItemText(nIndex, strName);
pframeMain->RefreshListCtrl();
@@ -2561,12 +2819,23 @@ void CAddressBookDialog::OnButtonNew(wxCommandEvent& event)
return;
strName = dialog.GetValue();
- // Generate new key
- strAddress = PubKeyToAddress(GetKeyFromKeyPool());
+ CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
+ {
+ bool fWasLocked = pwalletMain->IsLocked();
+ if (!GetWalletPassphrase())
+ return;
+
+ // Generate new key
+ strAddress = CBitcoinAddress(pwalletMain->GetOrReuseKeyFromPool()).ToString();
+
+ if (fWasLocked)
+ pwalletMain->Lock();
+ }
}
// Add to list and select it
- SetAddressBookName(strAddress, strName);
+ CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+ pwalletMain->SetAddressBookName(strAddress, strName);
int nIndex = InsertLine(m_listCtrl, strName, strAddress);
SetSelection(m_listCtrl, nIndex);
m_listCtrl->SetFocus();
@@ -2605,6 +2874,7 @@ void CAddressBookDialog::OnClose(wxCloseEvent& event)
enum
{
ID_TASKBAR_RESTORE = 10001,
+ ID_TASKBAR_SEND,
ID_TASKBAR_OPTIONS,
ID_TASKBAR_GENERATE,
ID_TASKBAR_EXIT,
@@ -2613,8 +2883,8 @@ enum
BEGIN_EVENT_TABLE(CMyTaskBarIcon, wxTaskBarIcon)
EVT_TASKBAR_LEFT_DCLICK(CMyTaskBarIcon::OnLeftButtonDClick)
EVT_MENU(ID_TASKBAR_RESTORE, CMyTaskBarIcon::OnMenuRestore)
+ EVT_MENU(ID_TASKBAR_SEND, CMyTaskBarIcon::OnMenuSend)
EVT_MENU(ID_TASKBAR_OPTIONS, CMyTaskBarIcon::OnMenuOptions)
- EVT_MENU(ID_TASKBAR_GENERATE, CMyTaskBarIcon::OnMenuGenerate)
EVT_UPDATE_UI(ID_TASKBAR_GENERATE, CMyTaskBarIcon::OnUpdateUIGenerate)
EVT_MENU(ID_TASKBAR_EXIT, CMyTaskBarIcon::OnMenuExit)
END_EVENT_TABLE()
@@ -2665,6 +2935,13 @@ void CMyTaskBarIcon::OnMenuRestore(wxCommandEvent& event)
Restore();
}
+void CMyTaskBarIcon::OnMenuSend(wxCommandEvent& event)
+{
+ // Taskbar: Send
+ CSendDialog dialog(pframeMain);
+ dialog.ShowModal();
+}
+
void CMyTaskBarIcon::OnMenuOptions(wxCommandEvent& event)
{
// Since it's modal, get the main window to do it
@@ -2681,11 +2958,6 @@ void CMyTaskBarIcon::Restore()
pframeMain->Raise();
}
-void CMyTaskBarIcon::OnMenuGenerate(wxCommandEvent& event)
-{
- GenerateBitcoins(event.IsChecked());
-}
-
void CMyTaskBarIcon::OnUpdateUIGenerate(wxUpdateUIEvent& event)
{
event.Check(fGenerateBitcoins);
@@ -2706,8 +2978,8 @@ wxMenu* CMyTaskBarIcon::CreatePopupMenu()
{
wxMenu* pmenu = new wxMenu;
pmenu->Append(ID_TASKBAR_RESTORE, _("&Open Bitcoin"));
+ pmenu->Append(ID_TASKBAR_SEND, _("&Send Bitcoins"));
pmenu->Append(ID_TASKBAR_OPTIONS, _("O&ptions..."));
- pmenu->AppendCheckItem(ID_TASKBAR_GENERATE, _("&Generate Coins"))->Check(fGenerateBitcoins);
#ifndef __WXMAC_OSX__ // Mac has built-in quit menu
pmenu->AppendSeparator();
pmenu->Append(ID_TASKBAR_EXIT, _("E&xit"));
@@ -2839,9 +3111,6 @@ bool CMyApp::OnInit()
extern int g_isPainting;
g_isPainting = 10000;
#endif
-#ifdef GUI
- wxImage::AddHandler(new wxPNGHandler);
-#endif
#if defined(__WXMSW__ ) || defined(__WXMAC_OSX__)
SetAppName("Bitcoin");
#else
@@ -2872,6 +3141,16 @@ bool CMyApp::OnInit()
g_locale.AddCatalog("wxstd"); // wxWidgets standard translations, if any
g_locale.AddCatalog("bitcoin");
+#ifdef __WXMSW__
+ HDC hdc = GetDC(NULL);
+ if (hdc)
+ {
+ nScaleX = GetDeviceCaps(hdc, LOGPIXELSX) / 96.0;
+ nScaleY = GetDeviceCaps(hdc, LOGPIXELSY) / 96.0;
+ ReleaseDC(NULL, hdc);
+ }
+#endif
+
return AppInit(argc, argv);
}
diff --git a/ui.h b/src/ui.h
index af97d5abb1..2a128a7bac 100644
--- a/ui.h
+++ b/src/ui.h
@@ -1,6 +1,12 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_UI_H
+#define BITCOIN_UI_H
+
+#include <boost/function.hpp>
+#include "wallet.h"
DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1)
@@ -12,9 +18,9 @@ extern wxLocale g_locale;
void HandleCtrlA(wxKeyEvent& event);
void UIThreadCall(boost::function0<void>);
-int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
-bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent);
-void CalledSetStatusBar(const string& strText, int nField);
+int ThreadSafeMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
+bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent);
+void CalledSetStatusBar(const std::string& strText, int nField);
void MainFrameRepaint();
void CreateMainWindow();
void SetStartOnSystemStartup(bool fAutoStart);
@@ -28,8 +34,8 @@ inline int MyMessageBox(const wxString& message, const wxString& caption="Messag
if (!fDaemon)
return wxMessageBox(message, caption, style, parent, x, y);
#endif
- printf("wxMessageBox %s: %s\n", string(caption).c_str(), string(message).c_str());
- fprintf(stderr, "%s: %s\n", string(caption).c_str(), string(message).c_str());
+ printf("wxMessageBox %s: %s\n", std::string(caption).c_str(), std::string(message).c_str());
+ fprintf(stderr, "%s: %s\n", std::string(caption).c_str(), std::string(message).c_str());
return wxOK;
}
#define wxMessageBox MyMessageBox
@@ -52,9 +58,10 @@ protected:
void OnPaint(wxPaintEvent& event);
void OnPaintListCtrl(wxPaintEvent& event);
void OnMenuFileExit(wxCommandEvent& event);
- void OnMenuOptionsGenerate(wxCommandEvent& event);
void OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event);
void OnMenuOptionsChangeYourAddress(wxCommandEvent& event);
+ void OnMenuOptionsEncryptWallet(wxCommandEvent& event);
+ void OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event);
void OnMenuOptionsOptions(wxCommandEvent& event);
void OnMenuHelpAbout(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
@@ -94,8 +101,8 @@ public:
bool fRefresh;
void OnUIThreadCall(wxCommandEvent& event);
- int GetSortIndex(const string& strSort);
- void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
+ int GetSortIndex(const std::string& strSort);
+ void InsertLine(bool fNew, int nIndex, uint256 hashKey, std::string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
bool DeleteLine(uint256 hashKey);
bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
void RefreshListCtrl();
@@ -127,7 +134,6 @@ protected:
// Event handlers
void OnListBox(wxCommandEvent& event);
void OnKillFocusTransactionFee(wxFocusEvent& event);
- void OnCheckBoxLimitProcessors(wxCommandEvent& event);
void OnCheckBoxUseProxy(wxCommandEvent& event);
void OnKillFocusProxy(wxFocusEvent& event);
@@ -178,8 +184,8 @@ public:
// Custom
bool fEnabledPrev;
- string strFromSave;
- string strMessageSave;
+ std::string strFromSave;
+ std::string strMessageSave;
};
@@ -213,8 +219,8 @@ public:
void Close();
void Repaint();
bool Status();
- bool Status(const string& str);
- bool Error(const string& str);
+ bool Status(const std::string& str);
+ bool Error(const std::string& str);
void StartTransfer();
void OnReply2(CDataStream& vRecv);
void OnReply3(CDataStream& vRecv);
@@ -259,7 +265,7 @@ public:
wxString GetSelectedAddress();
wxString GetSelectedSendingAddress();
wxString GetSelectedReceivingAddress();
- bool CheckIfMine(const string& strAddress, const string& strTitle);
+ bool CheckIfMine(const std::string& strAddress, const std::string& strTitle);
};
@@ -283,11 +289,11 @@ protected:
public:
/** Constructor */
CGetTextFromUserDialog(wxWindow* parent,
- const string& strCaption,
- const string& strMessage1,
- const string& strValue1="",
- const string& strMessage2="",
- const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
+ const std::string& strCaption,
+ const std::string& strMessage1,
+ const std::string& strValue1="",
+ const std::string& strMessage2="",
+ const std::string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
{
int x = GetSize().GetWidth();
int y = GetSize().GetHeight();
@@ -310,9 +316,9 @@ public:
}
// Custom
- string GetValue() { return (string)m_textCtrl1->GetValue(); }
- string GetValue1() { return (string)m_textCtrl1->GetValue(); }
- string GetValue2() { return (string)m_textCtrl2->GetValue(); }
+ std::string GetValue() { return (std::string)m_textCtrl1->GetValue(); }
+ std::string GetValue1() { return (std::string)m_textCtrl1->GetValue(); }
+ std::string GetValue2() { return (std::string)m_textCtrl2->GetValue(); }
};
@@ -323,6 +329,7 @@ protected:
// Event handlers
void OnLeftButtonDClick(wxTaskBarIconEvent& event);
void OnMenuRestore(wxCommandEvent& event);
+ void OnMenuSend(wxCommandEvent& event);
void OnMenuOptions(wxCommandEvent& event);
void OnUpdateUIGenerate(wxUpdateUIEvent& event);
void OnMenuGenerate(wxCommandEvent& event);
@@ -342,3 +349,5 @@ public:
DECLARE_EVENT_TABLE()
};
+
+#endif
diff --git a/uibase.cpp b/src/uibase.cpp
index 41be5d7527..6d219ad667 100644
--- a/uibase.cpp
+++ b/src/uibase.cpp
@@ -28,14 +28,16 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
m_menubar->Append( m_menuFile, _("&File") );
m_menuOptions = new wxMenu();
- wxMenuItem* m_menuOptionsGenerateBitcoins;
- m_menuOptionsGenerateBitcoins = new wxMenuItem( m_menuOptions, wxID_OPTIONSGENERATEBITCOINS, wxString( _("&Generate Coins") ) , wxEmptyString, wxITEM_CHECK );
- m_menuOptions->Append( m_menuOptionsGenerateBitcoins );
-
wxMenuItem* m_menuOptionsChangeYourAddress;
m_menuOptionsChangeYourAddress = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Your Receiving Addresses...") ) , wxEmptyString, wxITEM_NORMAL );
m_menuOptions->Append( m_menuOptionsChangeYourAddress );
+ m_menuOptionsEncryptWallet = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Encrypt Wallet...") ) , wxEmptyString, wxITEM_NORMAL );
+ m_menuOptions->Append( m_menuOptionsEncryptWallet );
+
+ m_menuOptionsChangeWalletPassphrase = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Change Wallet Encryption Passphrase...") ) , wxEmptyString, wxITEM_NORMAL );
+ m_menuOptions->Append( m_menuOptionsChangeWalletPassphrase );
+
wxMenuItem* m_menuOptionsOptions;
m_menuOptionsOptions = new wxMenuItem( m_menuOptions, wxID_PREFERENCES, wxString( _("&Options...") ) , wxEmptyString, wxITEM_NORMAL );
m_menuOptions->Append( m_menuOptionsOptions );
@@ -190,9 +192,9 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
this->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CMainFrameBase::OnMouseEvents ) );
this->Connect( wxEVT_PAINT, wxPaintEventHandler( CMainFrameBase::OnPaint ) );
this->Connect( m_menuFileExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuFileExit ) );
- this->Connect( m_menuOptionsGenerateBitcoins->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsGenerate ) );
- this->Connect( m_menuOptionsGenerateBitcoins->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( CMainFrameBase::OnUpdateUIOptionsGenerate ) );
this->Connect( m_menuOptionsChangeYourAddress->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsChangeYourAddress ) );
+ this->Connect( m_menuOptionsEncryptWallet->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsEncryptWallet ) );
+ this->Connect( m_menuOptionsChangeWalletPassphrase->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsChangeWalletPassphrase ) );
this->Connect( m_menuOptionsOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsOptions ) );
this->Connect( m_menuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuHelpAbout ) );
this->Connect( wxID_BUTTONSEND, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonSend ) );
@@ -250,9 +252,9 @@ CMainFrameBase::~CMainFrameBase()
this->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CMainFrameBase::OnMouseEvents ) );
this->Disconnect( wxEVT_PAINT, wxPaintEventHandler( CMainFrameBase::OnPaint ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuFileExit ) );
- this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsGenerate ) );
- this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( CMainFrameBase::OnUpdateUIOptionsGenerate ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsChangeYourAddress ) );
+ this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsEncryptWallet ) );
+ this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsChangeWalletPassphrase ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuOptionsOptions ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuHelpAbout ) );
this->Disconnect( wxID_BUTTONSEND, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonSend ) );
@@ -350,21 +352,6 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
bSizer69->Add( 0, 16, 0, wxEXPAND, 5 );
- wxBoxSizer* bSizer71;
- bSizer71 = new wxBoxSizer( wxHORIZONTAL );
-
- m_checkBoxLimitProcessors = new wxCheckBox( m_panelMain, wxID_ANY, _("&Limit coin generation to"), wxDefaultPosition, wxDefaultSize, 0 );
- bSizer71->Add( m_checkBoxLimitProcessors, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-
- m_spinCtrlLimitProcessors = new wxSpinCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 48,-1 ), wxSP_ARROW_KEYS, 1, 999, 1 );
- bSizer71->Add( m_spinCtrlLimitProcessors, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- m_staticText35 = new wxStaticText( m_panelMain, wxID_ANY, _("processors"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText35->Wrap( -1 );
- bSizer71->Add( m_staticText35, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-
- bSizer69->Add( bSizer71, 0, 0, 5 );
-
m_checkBoxStartOnSystemStartup = new wxCheckBox( m_panelMain, wxID_ANY, _("&Start Bitcoin on system startup"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer69->Add( m_checkBoxStartOnSystemStartup, 0, wxALL, 5 );
@@ -380,7 +367,7 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
wxBoxSizer* bSizer102;
bSizer102 = new wxBoxSizer( wxHORIZONTAL );
- m_checkBoxUseProxy = new wxCheckBox( m_panelMain, wxID_ANY, _("&Connect through socks4 proxy: "), wxDefaultPosition, wxDefaultSize, 0 );
+ m_checkBoxUseProxy = new wxCheckBox( m_panelMain, wxID_ANY, _("&Connect through socks4 proxy (requires restart to apply): "), wxDefaultPosition, wxDefaultSize, 0 );
bSizer102->Add( m_checkBoxUseProxy, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bSizer69->Add( bSizer102, 1, wxEXPAND, 5 );
@@ -479,7 +466,6 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
// Connect Events
m_listBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( COptionsDialogBase::OnListBox ), NULL, this );
- m_checkBoxLimitProcessors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxLimitProcessors ), NULL, this );
m_checkBoxMinimizeToTray->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxMinimizeToTray ), NULL, this );
m_checkBoxUseProxy->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxUseProxy ), NULL, this );
m_textCtrlProxyIP->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
@@ -494,7 +480,6 @@ COptionsDialogBase::~COptionsDialogBase()
{
// Disconnect Events
m_listBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( COptionsDialogBase::OnListBox ), NULL, this );
- m_checkBoxLimitProcessors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxLimitProcessors ), NULL, this );
m_checkBoxMinimizeToTray->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxMinimizeToTray ), NULL, this );
m_checkBoxUseProxy->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxUseProxy ), NULL, this );
m_textCtrlProxyIP->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
diff --git a/uibase.h b/src/uibase.h
index c5da8f5081..ca0730b20e 100644
--- a/uibase.h
+++ b/src/uibase.h
@@ -34,36 +34,34 @@
#include <wx/dialog.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
-#include <wx/spinctrl.h>
#include <wx/scrolwin.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
#define wxID_MAINFRAME 1000
-#define wxID_OPTIONSGENERATEBITCOINS 1001
-#define wxID_BUTTONSEND 1002
-#define wxID_BUTTONRECEIVE 1003
-#define wxID_TEXTCTRLADDRESS 1004
-#define wxID_BUTTONNEW 1005
-#define wxID_BUTTONCOPY 1006
-#define wxID_PROXYIP 1007
-#define wxID_PROXYPORT 1008
-#define wxID_TRANSACTIONFEE 1009
-#define wxID_TEXTCTRLPAYTO 1010
-#define wxID_BUTTONPASTE 1011
-#define wxID_BUTTONADDRESSBOOK 1012
-#define wxID_TEXTCTRLAMOUNT 1013
-#define wxID_CHOICETRANSFERTYPE 1014
-#define wxID_LISTCTRL 1015
-#define wxID_BUTTONRENAME 1016
-#define wxID_PANELSENDING 1017
-#define wxID_LISTCTRLSENDING 1018
-#define wxID_PANELRECEIVING 1019
-#define wxID_LISTCTRLRECEIVING 1020
-#define wxID_BUTTONDELETE 1021
-#define wxID_BUTTONEDIT 1022
-#define wxID_TEXTCTRL 1023
+#define wxID_BUTTONSEND 1001
+#define wxID_BUTTONRECEIVE 1002
+#define wxID_TEXTCTRLADDRESS 1003
+#define wxID_BUTTONNEW 1004
+#define wxID_BUTTONCOPY 1005
+#define wxID_PROXYIP 1006
+#define wxID_PROXYPORT 1007
+#define wxID_TRANSACTIONFEE 1008
+#define wxID_TEXTCTRLPAYTO 1009
+#define wxID_BUTTONPASTE 1010
+#define wxID_BUTTONADDRESSBOOK 1011
+#define wxID_TEXTCTRLAMOUNT 1012
+#define wxID_CHOICETRANSFERTYPE 1013
+#define wxID_LISTCTRL 1014
+#define wxID_BUTTONRENAME 1015
+#define wxID_PANELSENDING 1016
+#define wxID_LISTCTRLSENDING 1017
+#define wxID_PANELRECEIVING 1018
+#define wxID_LISTCTRLRECEIVING 1019
+#define wxID_BUTTONDELETE 1020
+#define wxID_BUTTONEDIT 1021
+#define wxID_TEXTCTRL 1022
///////////////////////////////////////////////////////////////////////////////
/// Class CMainFrameBase
@@ -99,9 +97,9 @@ class CMainFrameBase : public wxFrame
virtual void OnMouseEvents( wxMouseEvent& event ) { event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnMenuFileExit( wxCommandEvent& event ) { event.Skip(); }
- virtual void OnMenuOptionsGenerate( wxCommandEvent& event ) { event.Skip(); }
- virtual void OnUpdateUIOptionsGenerate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsChangeYourAddress( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnMenuOptionsEncryptWallet( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnMenuOptionsChangeWalletPassphrase( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsOptions( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuHelpAbout( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ) { event.Skip(); }
@@ -119,6 +117,8 @@ class CMainFrameBase : public wxFrame
public:
wxMenu* m_menuOptions;
+ wxMenuItem* m_menuOptionsEncryptWallet;
+ wxMenuItem* m_menuOptionsChangeWalletPassphrase;
wxStatusBar* m_statusBar;
wxTextCtrl* m_textCtrlAddress;
wxListCtrl* m_listCtrlAll;
@@ -165,9 +165,6 @@ class COptionsDialogBase : public wxDialog
wxScrolledWindow* m_scrolledWindow;
wxPanel* m_panelMain;
- wxCheckBox* m_checkBoxLimitProcessors;
- wxSpinCtrl* m_spinCtrlLimitProcessors;
- wxStaticText* m_staticText35;
wxCheckBox* m_checkBoxStartOnSystemStartup;
wxCheckBox* m_checkBoxMinimizeToTray;
wxCheckBox* m_checkBoxUseUPnP;
@@ -192,7 +189,6 @@ class COptionsDialogBase : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual void OnListBox( wxCommandEvent& event ) { event.Skip(); }
- virtual void OnCheckBoxLimitProcessors( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckBoxMinimizeToTray( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckBoxUseProxy( wxCommandEvent& event ) { event.Skip(); }
virtual void OnKillFocusProxy( wxFocusEvent& event ) { event.Skip(); }
diff --git a/uint256.h b/src/uint256.h
index c4f391a38a..3e20201387 100644
--- a/uint256.h
+++ b/src/uint256.h
@@ -1,9 +1,16 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_UINT256_H
+#define BITCOIN_UINT256_H
+
+#include "serialize.h"
#include <limits.h>
#include <string>
+#include <vector>
+
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 int64;
typedef unsigned __int64 uint64;
@@ -16,7 +23,7 @@ typedef unsigned long long uint64;
#endif
-inline int Testuint256AdHoc(vector<string> vArg);
+inline int Testuint256AdHoc(std::vector<std::string> vArg);
@@ -296,7 +303,7 @@ public:
char psz[sizeof(pn)*2 + 1];
for (int i = 0; i < sizeof(pn); i++)
sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]);
- return string(psz, psz + sizeof(pn)*2);
+ return std::string(psz, psz + sizeof(pn)*2);
}
void SetHex(const char* psz)
@@ -377,7 +384,7 @@ public:
friend class uint160;
friend class uint256;
- friend inline int Testuint256AdHoc(vector<string> vArg);
+ friend inline int Testuint256AdHoc(std::vector<std::string> vArg);
};
typedef base_uint<160> base_uint160;
@@ -626,7 +633,7 @@ inline const uint256 operator-(const uint256& a, const uint256& b) { return
-inline int Testuint256AdHoc(vector<string> vArg)
+inline int Testuint256AdHoc(std::vector<std::string> vArg)
{
uint256 g(0);
@@ -755,3 +762,5 @@ inline int Testuint256AdHoc(vector<string> vArg)
return (0);
}
+
+#endif
diff --git a/util.cpp b/src/util.cpp
index 2359616689..24c7ed4487 100644
--- a/util.cpp
+++ b/src/util.cpp
@@ -1,9 +1,19 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
#include "headers.h"
-
+#include "strlcpy.h"
+#include <boost/program_options/detail/config_file.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/interprocess/sync/interprocess_mutex.hpp>
+#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
+#include <boost/foreach.hpp>
+
+using namespace std;
+using namespace boost;
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
@@ -270,7 +280,7 @@ string strprintf(const char* format, ...)
if (ret >= 0 && ret < limit)
break;
if (p != buffer)
- delete p;
+ delete[] p;
limit *= 2;
p = new char[limit];
if (p == NULL)
@@ -278,7 +288,7 @@ string strprintf(const char* format, ...)
}
string str(p, p+ret);
if (p != buffer)
- delete p;
+ delete[] p;
return str;
}
@@ -337,11 +347,6 @@ string FormatMoney(int64 n, bool fPlus)
if (nTrim)
str.erase(str.size()-nTrim, nTrim);
- // Insert thousands-separators:
- size_t point = str.find(".");
- for (int i = (str.size()-point)+3; i < str.size(); i += 4)
- if (isdigit(str[str.size() - i - 1]))
- str.insert(str.size() - i, 1, ',');
if (n < 0)
str.insert((unsigned int)0, 1, '-');
else if (fPlus && n > 0)
@@ -364,8 +369,6 @@ bool ParseMoney(const char* pszIn, int64& nRet)
p++;
for (; *p; p++)
{
- if (*p == ',' && p > pszIn && isdigit(p[-1]) && isdigit(p[1]) && isdigit(p[2]) && isdigit(p[3]) && !isdigit(p[4]))
- continue;
if (*p == '.')
{
p++;
@@ -704,7 +707,7 @@ void GetDataDir(char* pszDir)
if (!pfMkdir[nVariation])
{
pfMkdir[nVariation] = true;
- filesystem::create_directory(pszDir);
+ boost::filesystem::create_directory(pszDir);
}
}
@@ -758,8 +761,8 @@ string GetPidFile()
void CreatePidFile(string pidFile, pid_t pid)
{
- FILE* file;
- if (file = fopen(pidFile.c_str(), "w"))
+ FILE* file = fopen(pidFile.c_str(), "w");
+ if (file)
{
fprintf(file, "%d\n", pid);
fclose(file);
@@ -788,7 +791,9 @@ void ShrinkDebugFile()
fseek(file, -sizeof(pch), SEEK_END);
int nBytes = fread(pch, 1, sizeof(pch), file);
fclose(file);
- if (file = fopen(strFile.c_str(), "w"))
+
+ file = fopen(strFile.c_str(), "w");
+ if (file)
{
fwrite(pch, 1, nBytes, file);
fclose(file);
@@ -855,7 +860,7 @@ void AddTimeData(unsigned int ip, int64 nTime)
{
// If nobody has a time different than ours but within 5 minutes of ours, give a warning
bool fMatch = false;
- foreach(int64 nOffset, vTimeOffsets)
+ BOOST_FOREACH(int64 nOffset, vTimeOffsets)
if (nOffset != 0 && abs64(nOffset) < 5 * 60)
fMatch = true;
@@ -869,7 +874,7 @@ void AddTimeData(unsigned int ip, int64 nTime)
}
}
}
- foreach(int64 n, vTimeOffsets)
+ BOOST_FOREACH(int64 n, vTimeOffsets)
printf("%+"PRI64d" ", n);
printf("| nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
}
@@ -894,12 +899,132 @@ string FormatVersion(int nVersion)
string FormatFullVersion()
{
string s = FormatVersion(VERSION) + pszSubVer;
- if (VERSION_IS_BETA)
- s += _("-beta");
+ if (VERSION_IS_BETA) {
+ s += "-";
+ s += _("beta");
+ }
return s;
}
+#ifdef DEBUG_LOCKORDER
+//
+// Early deadlock detection.
+// Problem being solved:
+// Thread 1 locks A, then B, then C
+// Thread 2 locks D, then C, then A
+// --> may result in deadlock between the two threads, depending on when they run.
+// Solution implemented here:
+// Keep track of pairs of locks: (A before B), (A before C), etc.
+// Complain if any thread trys to lock in a different order.
+//
+
+struct CLockLocation
+{
+ std::string mutexName;
+ std::string sourceFile;
+ int sourceLine;
+
+ CLockLocation(const char* pszName, const char* pszFile, int nLine)
+ {
+ mutexName = pszName;
+ sourceFile = pszFile;
+ sourceLine = nLine;
+ }
+};
+
+typedef std::vector< std::pair<CCriticalSection*, CLockLocation> > LockStack;
+
+static boost::interprocess::interprocess_mutex dd_mutex;
+static std::map<std::pair<CCriticalSection*, CCriticalSection*>, LockStack> lockorders;
+static boost::thread_specific_ptr<LockStack> lockstack;
+
+
+static void potential_deadlock_detected(const LockStack& s1, const LockStack& s2)
+{
+ printf("POTENTIAL DEADLOCK DETECTED\n");
+ printf("Previous lock order was:\n");
+ BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, s2)
+ {
+ printf(" %s %s:%d\n", i.second.mutexName.c_str(), i.second.sourceFile.c_str(), i.second.sourceLine);
+ }
+ printf("Current lock order is:\n");
+ BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, s1)
+ {
+ printf(" %s %s:%d\n", i.second.mutexName.c_str(), i.second.sourceFile.c_str(), i.second.sourceLine);
+ }
+}
+
+static void push_lock(CCriticalSection* c, const CLockLocation& locklocation)
+{
+ bool fOrderOK = true;
+ if (lockstack.get() == NULL)
+ lockstack.reset(new LockStack);
+
+ dd_mutex.lock();
+
+ (*lockstack).push_back(std::make_pair(c, locklocation));
+
+ BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, (*lockstack))
+ {
+ if (i.first == c) break;
+
+ std::pair<CCriticalSection*, CCriticalSection*> p1 = std::make_pair(i.first, c);
+ if (lockorders.count(p1))
+ continue;
+ lockorders[p1] = (*lockstack);
+
+ std::pair<CCriticalSection*, CCriticalSection*> p2 = std::make_pair(c, i.first);
+ if (lockorders.count(p2))
+ {
+ potential_deadlock_detected(lockorders[p2], lockorders[p1]);
+ break;
+ }
+ }
+ dd_mutex.unlock();
+}
+
+static void pop_lock()
+{
+ (*lockstack).pop_back();
+}
+
+void CCriticalSection::Enter(const char* pszName, const char* pszFile, int nLine)
+{
+ push_lock(this, CLockLocation(pszName, pszFile, nLine));
+ mutex.lock();
+}
+void CCriticalSection::Leave()
+{
+ mutex.unlock();
+ pop_lock();
+}
+bool CCriticalSection::TryEnter(const char* pszName, const char* pszFile, int nLine)
+{
+ push_lock(this, CLockLocation(pszName, pszFile, nLine));
+ bool result = mutex.try_lock();
+ if (!result) pop_lock();
+ return result;
+}
+
+#else
+
+void CCriticalSection::Enter(const char*, const char*, int)
+{
+ mutex.lock();
+}
+
+void CCriticalSection::Leave()
+{
+ mutex.unlock();
+}
+
+bool CCriticalSection::TryEnter(const char*, const char*, int)
+{
+ bool result = mutex.try_lock();
+ return result;
+}
+#endif /* DEBUG_LOCKORDER */
diff --git a/util.h b/src/util.h
index 44afffcbf6..1e4ceb2468 100644
--- a/util.h
+++ b/src/util.h
@@ -1,6 +1,28 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_UTIL_H
+#define BITCOIN_UTIL_H
+
+#include "uint256.h"
+
+#ifndef __WXMSW__
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif
+#include <map>
+#include <vector>
+#include <string>
+
+#include <boost/thread.hpp>
+#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
+#include <boost/date_time/gregorian/gregorian_types.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+
+#include <openssl/sha.h>
+#include <openssl/ripemd.h>
#if defined(_MSC_VER) || defined(__BORLANDC__)
@@ -17,7 +39,6 @@ typedef unsigned long long uint64;
#define __forceinline inline
#endif
-#define foreach BOOST_FOREACH
#define loop for (;;)
#define BEGIN(a) ((char*)&(a))
#define END(a) ((char*)&((&(a))[1]))
@@ -84,6 +105,8 @@ T* alignup(T* p)
typedef int socklen_t;
#else
#define WSAGetLastError() errno
+#define WSAEINVAL EINVAL
+#define WSAEALREADY EALREADY
#define WSAEWOULDBLOCK EWOULDBLOCK
#define WSAEMSGSIZE EMSGSIZE
#define WSAEINTR EINTR
@@ -134,8 +157,8 @@ inline const char* _(const char* psz)
-extern map<string, string> mapArgs;
-extern map<string, vector<string> > mapMultiArgs;
+extern std::map<std::string, std::string> mapArgs;
+extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
extern bool fDebug;
extern bool fPrintToConsole;
extern bool fPrintToDebugger;
@@ -145,7 +168,7 @@ extern bool fShutdown;
extern bool fDaemon;
extern bool fServer;
extern bool fCommandLine;
-extern string strMiscWarning;
+extern std::string strMiscWarning;
extern bool fTestNet;
extern bool fNoListen;
extern bool fLogTimestamps;
@@ -154,39 +177,39 @@ void RandAddSeed();
void RandAddSeedPerfmon();
int OutputDebugStringF(const char* pszFormat, ...);
int my_snprintf(char* buffer, size_t limit, const char* format, ...);
-string strprintf(const char* format, ...);
+std::string strprintf(const char* format, ...);
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);
-void ParseString(const string& str, char c, vector<string>& v);
-string FormatMoney(int64 n, bool fPlus=false);
-bool ParseMoney(const string& str, int64& nRet);
+void ParseString(const std::string& str, char c, std::vector<std::string>& v);
+std::string FormatMoney(int64 n, bool fPlus=false);
+bool ParseMoney(const std::string& str, int64& nRet);
bool ParseMoney(const char* pszIn, int64& nRet);
-vector<unsigned char> ParseHex(const char* psz);
-vector<unsigned char> ParseHex(const string& str);
+std::vector<unsigned char> ParseHex(const char* psz);
+std::vector<unsigned char> ParseHex(const std::string& str);
void ParseParameters(int argc, char* argv[]);
const char* wxGetTranslation(const char* psz);
bool WildcardMatch(const char* psz, const char* mask);
-bool WildcardMatch(const string& str, const string& mask);
+bool WildcardMatch(const std::string& str, const std::string& mask);
int GetFilesize(FILE* file);
void GetDataDir(char* pszDirRet);
-string GetConfigFile();
-string GetPidFile();
-void CreatePidFile(string pidFile, pid_t pid);
-void ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string> >& mapMultiSettingsRet);
+std::string GetConfigFile();
+std::string GetPidFile();
+void CreatePidFile(std::string pidFile, pid_t pid);
+void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
#ifdef __WXMSW__
-string MyGetSpecialFolderPath(int nFolder, bool fCreate);
+std::string MyGetSpecialFolderPath(int nFolder, bool fCreate);
#endif
-string GetDefaultDataDir();
-string GetDataDir();
+std::string GetDefaultDataDir();
+std::string GetDataDir();
void ShrinkDebugFile();
int GetRandInt(int nMax);
uint64 GetRand(uint64 nMax);
int64 GetTime();
int64 GetAdjustedTime();
void AddTimeData(unsigned int ip, int64 nTime);
-string FormatFullVersion();
+std::string FormatFullVersion();
@@ -200,31 +223,17 @@ string FormatFullVersion();
-// Wrapper to automatically initialize critical sections
+// Wrapper to automatically initialize mutex
class CCriticalSection
{
-#ifdef __WXMSW__
-protected:
- CRITICAL_SECTION cs;
-public:
- explicit CCriticalSection() { InitializeCriticalSection(&cs); }
- ~CCriticalSection() { DeleteCriticalSection(&cs); }
- void Enter() { EnterCriticalSection(&cs); }
- void Leave() { LeaveCriticalSection(&cs); }
- bool TryEnter() { return TryEnterCriticalSection(&cs); }
-#else
protected:
boost::interprocess::interprocess_recursive_mutex mutex;
public:
explicit CCriticalSection() { }
~CCriticalSection() { }
- void Enter() { mutex.lock(); }
- void Leave() { mutex.unlock(); }
- bool TryEnter() { return mutex.try_lock(); }
-#endif
-public:
- const char* pszFile;
- int nLine;
+ void Enter(const char* pszName, const char* pszFile, int nLine);
+ void Leave();
+ bool TryEnter(const char* pszName, const char* pszFile, int nLine);
};
// Automatically leave critical section when leaving block, needed for exception safety
@@ -232,9 +241,17 @@ class CCriticalBlock
{
protected:
CCriticalSection* pcs;
+
public:
- CCriticalBlock(CCriticalSection& csIn) { pcs = &csIn; pcs->Enter(); }
- ~CCriticalBlock() { pcs->Leave(); }
+ CCriticalBlock(CCriticalSection& csIn, const char* pszName, const char* pszFile, int nLine)
+ {
+ pcs = &csIn;
+ pcs->Enter(pszName, pszFile, nLine);
+ }
+ ~CCriticalBlock()
+ {
+ pcs->Leave();
+ }
};
// WARNING: This will catch continue and break!
@@ -242,22 +259,32 @@ public:
// I'd rather be careful than suffer the other more error prone syntax.
// The compiler will optimise away all this loop junk.
#define CRITICAL_BLOCK(cs) \
- for (bool fcriticalblockonce=true; fcriticalblockonce; assert(("break caught by CRITICAL_BLOCK!", !fcriticalblockonce)), fcriticalblockonce=false) \
- for (CCriticalBlock criticalblock(cs); fcriticalblockonce && (cs.pszFile=__FILE__, cs.nLine=__LINE__, true); fcriticalblockonce=false, cs.pszFile=NULL, cs.nLine=0)
+ for (bool fcriticalblockonce=true; fcriticalblockonce; assert(("break caught by CRITICAL_BLOCK!" && !fcriticalblockonce)), fcriticalblockonce=false) \
+ for (CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__); fcriticalblockonce; fcriticalblockonce=false)
class CTryCriticalBlock
{
protected:
CCriticalSection* pcs;
+
public:
- CTryCriticalBlock(CCriticalSection& csIn) { pcs = (csIn.TryEnter() ? &csIn : NULL); }
- ~CTryCriticalBlock() { if (pcs) pcs->Leave(); }
+ CTryCriticalBlock(CCriticalSection& csIn, const char* pszName, const char* pszFile, int nLine)
+ {
+ pcs = (csIn.TryEnter(pszName, pszFile, nLine) ? &csIn : NULL);
+ }
+ ~CTryCriticalBlock()
+ {
+ if (pcs)
+ {
+ pcs->Leave();
+ }
+ }
bool Entered() { return pcs != NULL; }
};
#define TRY_CRITICAL_BLOCK(cs) \
- for (bool fcriticalblockonce=true; fcriticalblockonce; assert(("break caught by TRY_CRITICAL_BLOCK!", !fcriticalblockonce)), fcriticalblockonce=false) \
- for (CTryCriticalBlock criticalblock(cs); fcriticalblockonce && (fcriticalblockonce = criticalblock.Entered()) && (cs.pszFile=__FILE__, cs.nLine=__LINE__, true); fcriticalblockonce=false, cs.pszFile=NULL, cs.nLine=0)
+ for (bool fcriticalblockonce=true; fcriticalblockonce; assert(("break caught by TRY_CRITICAL_BLOCK!" && !fcriticalblockonce)), fcriticalblockonce=false) \
+ for (CTryCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__); fcriticalblockonce && (fcriticalblockonce = criticalblock.Entered()); fcriticalblockonce=false)
@@ -268,12 +295,12 @@ public:
-inline string i64tostr(int64 n)
+inline std::string i64tostr(int64 n)
{
return strprintf("%"PRI64d, n);
}
-inline string itostr(int n)
+inline std::string itostr(int n)
{
return strprintf("%d", n);
}
@@ -287,7 +314,7 @@ inline int64 atoi64(const char* psz)
#endif
}
-inline int64 atoi64(const string& str)
+inline int64 atoi64(const std::string& str)
{
#ifdef _MSC_VER
return _atoi64(str.c_str());
@@ -296,7 +323,7 @@ inline int64 atoi64(const string& str)
#endif
}
-inline int atoi(const string& str)
+inline int atoi(const std::string& str)
{
return atoi(str.c_str());
}
@@ -317,39 +344,39 @@ inline int64 abs64(int64 n)
}
template<typename T>
-string HexStr(const T itbegin, const T itend, bool fSpaces=false)
+std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
{
if (itbegin == itend)
return "";
const unsigned char* pbegin = (const unsigned char*)&itbegin[0];
const unsigned char* pend = pbegin + (itend - itbegin) * sizeof(itbegin[0]);
- string str;
+ std::string str;
str.reserve((pend-pbegin) * (fSpaces ? 3 : 2));
for (const unsigned char* p = pbegin; p != pend; p++)
str += strprintf((fSpaces && p != pend-1 ? "%02x " : "%02x"), *p);
return str;
}
-inline string HexStr(const vector<unsigned char>& vch, bool fSpaces=false)
+inline std::string HexStr(const std::vector<unsigned char>& vch, bool fSpaces=false)
{
return HexStr(vch.begin(), vch.end(), fSpaces);
}
template<typename T>
-string HexNumStr(const T itbegin, const T itend, bool f0x=true)
+std::string HexNumStr(const T itbegin, const T itend, bool f0x=true)
{
if (itbegin == itend)
return "";
const unsigned char* pbegin = (const unsigned char*)&itbegin[0];
const unsigned char* pend = pbegin + (itend - itbegin) * sizeof(itbegin[0]);
- string str = (f0x ? "0x" : "");
+ std::string str = (f0x ? "0x" : "");
str.reserve(str.size() + (pend-pbegin) * 2);
for (const unsigned char* p = pend-1; p >= pbegin; p--)
str += strprintf("%02x", *p);
return str;
}
-inline string HexNumStr(const vector<unsigned char>& vch, bool f0x=true)
+inline std::string HexNumStr(const std::vector<unsigned char>& vch, bool f0x=true)
{
return HexNumStr(vch.begin(), vch.end(), f0x);
}
@@ -360,7 +387,7 @@ void PrintHex(const T pbegin, const T pend, const char* pszFormat="%s", bool fSp
printf(pszFormat, HexStr(pbegin, pend, fSpaces).c_str());
}
-inline void PrintHex(const vector<unsigned char>& vch, const char* pszFormat="%s", bool fSpaces=true)
+inline void PrintHex(const std::vector<unsigned char>& vch, const char* pszFormat="%s", bool fSpaces=true)
{
printf(pszFormat, HexStr(vch, fSpaces).c_str());
}
@@ -380,11 +407,11 @@ inline int64 GetPerformanceCounter()
inline int64 GetTimeMillis()
{
- return (posix_time::ptime(posix_time::microsec_clock::universal_time()) -
- posix_time::ptime(gregorian::date(1970,1,1))).total_milliseconds();
+ return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) -
+ boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds();
}
-inline string DateTimeStrFormat(const char* pszFormat, int64 nTime)
+inline std::string DateTimeStrFormat(const char* pszFormat, int64 nTime)
{
time_t n = nTime;
struct tm* ptmTime = gmtime(&n);
@@ -409,21 +436,21 @@ inline bool IsSwitchChar(char c)
#endif
}
-inline string GetArg(const string& strArg, const string& strDefault)
+inline std::string GetArg(const std::string& strArg, const std::string& strDefault)
{
if (mapArgs.count(strArg))
return mapArgs[strArg];
return strDefault;
}
-inline int64 GetArg(const string& strArg, int64 nDefault)
+inline int64 GetArg(const std::string& strArg, int64 nDefault)
{
if (mapArgs.count(strArg))
return atoi64(mapArgs[strArg]);
return nDefault;
}
-inline bool GetBoolArg(const string& strArg)
+inline bool GetBoolArg(const std::string& strArg)
{
if (mapArgs.count(strArg))
{
@@ -538,7 +565,7 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=VERSION)
return Hash(ss.begin(), ss.end());
}
-inline uint160 Hash160(const vector<unsigned char>& vch)
+inline uint160 Hash160(const std::vector<unsigned char>& vch)
{
uint256 hash1;
SHA256(&vch[0], vch.size(), (unsigned char*)&hash1);
@@ -601,7 +628,10 @@ inline pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=fa
return (pthread_t)0;
}
if (!fWantHandle)
+ {
+ pthread_detach(hthread);
return (pthread_t)-1;
+ }
return hthread;
}
@@ -626,7 +656,7 @@ inline bool TerminateThread(pthread_t hthread, unsigned int nExitCode)
return (pthread_cancel(hthread) == 0);
}
-inline void ExitThread(unsigned int nExitCode)
+inline void ExitThread(size_t nExitCode)
{
pthread_exit((void*)nExitCode);
}
@@ -655,3 +685,5 @@ inline bool AffinityBugWorkaround(void(*pfn)(void*))
#endif
return false;
}
+
+#endif
diff --git a/src/wallet.cpp b/src/wallet.cpp
new file mode 100644
index 0000000000..6519ac6372
--- /dev/null
+++ b/src/wallet.cpp
@@ -0,0 +1,1352 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+
+#include "headers.h"
+#include "db.h"
+#include "cryptopp/sha.h"
+#include "crypter.h"
+
+using namespace std;
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// mapWallet
+//
+
+bool CWallet::AddKey(const CKey& key)
+{
+ if (!CCryptoKeyStore::AddKey(key))
+ return false;
+ if (!fFileBacked)
+ return true;
+ if (!IsCrypted())
+ return CWalletDB(strWalletFile).WriteKey(key.GetPubKey(), key.GetPrivKey());
+ return true;
+}
+
+bool CWallet::AddCryptedKey(const vector<unsigned char> &vchPubKey, const vector<unsigned char> &vchCryptedSecret)
+{
+ if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
+ return false;
+ if (!fFileBacked)
+ return true;
+ CRITICAL_BLOCK(cs_pwalletdbEncryption)
+ {
+ if (pwalletdbEncryption)
+ return pwalletdbEncryption->WriteCryptedKey(vchPubKey, vchCryptedSecret);
+ else
+ return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret);
+ }
+}
+
+bool CWallet::Unlock(const string& strWalletPassphrase)
+{
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (!IsLocked())
+ return false;
+
+ CCrypter crypter;
+ CKeyingMaterial vMasterKey;
+
+ BOOST_FOREACH(const MasterKeyMap::value_type& pMasterKey, mapMasterKeys)
+ {
+ if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
+ return false;
+ if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
+ return false;
+ if (CCryptoKeyStore::Unlock(vMasterKey))
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CWallet::ChangeWalletPassphrase(const string& strOldWalletPassphrase, const string& strNewWalletPassphrase)
+{
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ bool fWasLocked = IsLocked();
+
+ Lock();
+
+ CCrypter crypter;
+ CKeyingMaterial vMasterKey;
+ BOOST_FOREACH(MasterKeyMap::value_type& pMasterKey, mapMasterKeys)
+ {
+ if(!crypter.SetKeyFromPassphrase(strOldWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
+ return false;
+ if(!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
+ return false;
+ if (CCryptoKeyStore::Unlock(vMasterKey))
+ {
+ int64 nStartTime = GetTimeMillis();
+ crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
+ pMasterKey.second.nDeriveIterations = pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime)));
+
+ nStartTime = GetTimeMillis();
+ crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
+ pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
+
+ if (pMasterKey.second.nDeriveIterations < 25000)
+ pMasterKey.second.nDeriveIterations = 25000;
+
+ printf("Wallet passphrase changed to an nDeriveIterations of %i\n", pMasterKey.second.nDeriveIterations);
+
+ if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
+ return false;
+ if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey))
+ return false;
+ CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second);
+ if (fWasLocked)
+ Lock();
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
+// This class implements an addrIncoming entry that causes pre-0.4
+// clients to crash on startup if reading a private-key-encrypted wallet.
+class CCorruptAddress
+{
+public:
+ IMPLEMENT_SERIALIZE
+ (
+ if (nType & SER_DISK)
+ READWRITE(nVersion);
+ )
+};
+
+bool CWallet::EncryptWallet(const string& strWalletPassphrase)
+{
+ CRITICAL_BLOCK(cs_KeyStore)
+ CRITICAL_BLOCK(cs_vMasterKey)
+ CRITICAL_BLOCK(cs_pwalletdbEncryption)
+ {
+ if (IsCrypted())
+ return false;
+
+ CKeyingMaterial vMasterKey;
+ RandAddSeedPerfmon();
+
+ vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
+ RAND_bytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
+
+ CMasterKey kMasterKey;
+
+ RandAddSeedPerfmon();
+ kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);
+ RAND_bytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE);
+
+ CCrypter crypter;
+ int64 nStartTime = GetTimeMillis();
+ crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, 25000, kMasterKey.nDerivationMethod);
+ kMasterKey.nDeriveIterations = 2500000 / ((double)(GetTimeMillis() - nStartTime));
+
+ nStartTime = GetTimeMillis();
+ crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod);
+ kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
+
+ if (kMasterKey.nDeriveIterations < 25000)
+ kMasterKey.nDeriveIterations = 25000;
+
+ printf("Encrypting Wallet with an nDeriveIterations of %i\n", kMasterKey.nDeriveIterations);
+
+ if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod))
+ return false;
+ if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey))
+ return false;
+
+ mapMasterKeys[++nMasterKeyMaxID] = kMasterKey;
+ if (fFileBacked)
+ {
+ pwalletdbEncryption = new CWalletDB(strWalletFile);
+ pwalletdbEncryption->TxnBegin();
+ pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey);
+ }
+
+ if (!EncryptKeys(vMasterKey))
+ {
+ if (fFileBacked)
+ pwalletdbEncryption->TxnAbort();
+ exit(1); //We now probably have half of our keys encrypted in memory, and half not...die and let the user reload their unencrypted wallet.
+ }
+
+ if (fFileBacked)
+ {
+ CCorruptAddress corruptAddress;
+ pwalletdbEncryption->WriteSetting("addrIncoming", corruptAddress);
+ if (!pwalletdbEncryption->TxnCommit())
+ exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet.
+
+ pwalletdbEncryption->Close();
+ pwalletdbEncryption = NULL;
+ }
+
+ Lock();
+ }
+ return true;
+}
+
+void CWallet::WalletUpdateSpent(const CTransaction &tx)
+{
+ // Anytime a signature is successfully verified, it's proof the outpoint is spent.
+ // Update the wallet spent flag if it doesn't know due to wallet.dat being
+ // restored from backup or the user making copies of wallet.dat.
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
+ {
+ map<uint256, CWalletTx>::iterator mi = mapWallet.find(txin.prevout.hash);
+ if (mi != mapWallet.end())
+ {
+ CWalletTx& wtx = (*mi).second;
+ if (!wtx.IsSpent(txin.prevout.n) && IsMine(wtx.vout[txin.prevout.n]))
+ {
+ printf("WalletUpdateSpent found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
+ wtx.MarkSpent(txin.prevout.n);
+ wtx.WriteToDisk();
+ vWalletUpdated.push_back(txin.prevout.hash);
+ }
+ }
+ }
+ }
+}
+
+bool CWallet::AddToWallet(const CWalletTx& wtxIn)
+{
+ uint256 hash = wtxIn.GetHash();
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ // Inserts only if not already there, returns tx inserted or tx found
+ pair<map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(make_pair(hash, wtxIn));
+ CWalletTx& wtx = (*ret.first).second;
+ wtx.pwallet = this;
+ bool fInsertedNew = ret.second;
+ if (fInsertedNew)
+ wtx.nTimeReceived = GetAdjustedTime();
+
+ bool fUpdated = false;
+ if (!fInsertedNew)
+ {
+ // Merge
+ if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock)
+ {
+ wtx.hashBlock = wtxIn.hashBlock;
+ fUpdated = true;
+ }
+ if (wtxIn.nIndex != -1 && (wtxIn.vMerkleBranch != wtx.vMerkleBranch || wtxIn.nIndex != wtx.nIndex))
+ {
+ wtx.vMerkleBranch = wtxIn.vMerkleBranch;
+ wtx.nIndex = wtxIn.nIndex;
+ fUpdated = true;
+ }
+ if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe)
+ {
+ wtx.fFromMe = wtxIn.fFromMe;
+ fUpdated = true;
+ }
+ fUpdated |= wtx.UpdateSpent(wtxIn.vfSpent);
+ }
+
+ //// debug print
+ printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
+
+ // Write to disk
+ if (fInsertedNew || fUpdated)
+ if (!wtx.WriteToDisk())
+ return false;
+
+ // If default receiving address gets used, replace it with a new one
+ CScript scriptDefaultKey;
+ scriptDefaultKey.SetBitcoinAddress(vchDefaultKey);
+ BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+ {
+ if (txout.scriptPubKey == scriptDefaultKey)
+ {
+ SetDefaultKey(GetOrReuseKeyFromPool());
+ SetAddressBookName(CBitcoinAddress(vchDefaultKey), "");
+ }
+ }
+
+ // Notify UI
+ vWalletUpdated.push_back(hash);
+
+ // since AddToWallet is called directly for self-originating transactions, check for consumption of own coins
+ WalletUpdateSpent(wtx);
+ }
+
+ // Refresh UI
+ MainFrameRepaint();
+ return true;
+}
+
+bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
+{
+ uint256 hash = tx.GetHash();
+ bool fExisted = mapWallet.count(hash);
+ if (fExisted && !fUpdate) return false;
+ if (fExisted || IsMine(tx) || IsFromMe(tx))
+ {
+ CWalletTx wtx(this,tx);
+ // Get merkle branch if transaction was found in a block
+ if (pblock)
+ wtx.SetMerkleBranch(pblock);
+ return AddToWallet(wtx);
+ }
+ else
+ WalletUpdateSpent(tx);
+ return false;
+}
+
+bool CWallet::EraseFromWallet(uint256 hash)
+{
+ if (!fFileBacked)
+ return false;
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ if (mapWallet.erase(hash))
+ CWalletDB(strWalletFile).EraseTx(hash);
+ }
+ return true;
+}
+
+
+bool CWallet::IsMine(const CTxIn &txin) const
+{
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
+ if (mi != mapWallet.end())
+ {
+ const CWalletTx& prev = (*mi).second;
+ if (txin.prevout.n < prev.vout.size())
+ if (IsMine(prev.vout[txin.prevout.n]))
+ return true;
+ }
+ }
+ return false;
+}
+
+int64 CWallet::GetDebit(const CTxIn &txin) const
+{
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
+ if (mi != mapWallet.end())
+ {
+ const CWalletTx& prev = (*mi).second;
+ if (txin.prevout.n < prev.vout.size())
+ if (IsMine(prev.vout[txin.prevout.n]))
+ return prev.vout[txin.prevout.n].nValue;
+ }
+ }
+ return 0;
+}
+
+int64 CWalletTx::GetTxTime() const
+{
+ if (!fTimeReceivedIsTxTime && hashBlock != 0)
+ {
+ // If we did not receive the transaction directly, we rely on the block's
+ // time to figure out when it happened. We use the median over a range
+ // of blocks to try to filter out inaccurate block times.
+ map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
+ if (mi != mapBlockIndex.end())
+ {
+ CBlockIndex* pindex = (*mi).second;
+ if (pindex)
+ return pindex->GetMedianTime();
+ }
+ }
+ return nTimeReceived;
+}
+
+int CWalletTx::GetRequestCount() const
+{
+ // Returns -1 if it wasn't being tracked
+ int nRequests = -1;
+ CRITICAL_BLOCK(pwallet->cs_mapRequestCount)
+ {
+ if (IsCoinBase())
+ {
+ // Generated block
+ if (hashBlock != 0)
+ {
+ map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
+ if (mi != pwallet->mapRequestCount.end())
+ nRequests = (*mi).second;
+ }
+ }
+ else
+ {
+ // Did anyone request this transaction?
+ map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(GetHash());
+ if (mi != pwallet->mapRequestCount.end())
+ {
+ nRequests = (*mi).second;
+
+ // How about the block it's in?
+ if (nRequests == 0 && hashBlock != 0)
+ {
+ map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
+ if (mi != pwallet->mapRequestCount.end())
+ nRequests = (*mi).second;
+ else
+ nRequests = 1; // If it's in someone else's block it must have got out
+ }
+ }
+ }
+ }
+ return nRequests;
+}
+
+void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<CBitcoinAddress, int64> >& listReceived,
+ list<pair<CBitcoinAddress, int64> >& listSent, int64& nFee, string& strSentAccount) const
+{
+ nGeneratedImmature = nGeneratedMature = nFee = 0;
+ listReceived.clear();
+ listSent.clear();
+ strSentAccount = strFromAccount;
+
+ if (IsCoinBase())
+ {
+ if (GetBlocksToMaturity() > 0)
+ nGeneratedImmature = pwallet->GetCredit(*this);
+ else
+ nGeneratedMature = GetCredit();
+ return;
+ }
+
+ // Compute fee:
+ int64 nDebit = GetDebit();
+ if (nDebit > 0) // debit>0 means we signed/sent this transaction
+ {
+ int64 nValueOut = GetValueOut();
+ nFee = nDebit - nValueOut;
+ }
+
+ // Sent/received. Standard client will never generate a send-to-multiple-recipients,
+ // but non-standard clients might (so return a list of address/amount pairs)
+ BOOST_FOREACH(const CTxOut& txout, vout)
+ {
+ CBitcoinAddress address;
+ vector<unsigned char> vchPubKey;
+ if (!ExtractAddress(txout.scriptPubKey, NULL, address))
+ {
+ printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
+ this->GetHash().ToString().c_str());
+ address = " unknown ";
+ }
+
+ // Don't report 'change' txouts
+ if (nDebit > 0 && pwallet->IsChange(txout))
+ continue;
+
+ if (nDebit > 0)
+ listSent.push_back(make_pair(address, txout.nValue));
+
+ if (pwallet->IsMine(txout))
+ listReceived.push_back(make_pair(address, txout.nValue));
+ }
+
+}
+
+void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
+ int64& nSent, int64& nFee) const
+{
+ nGenerated = nReceived = nSent = nFee = 0;
+
+ int64 allGeneratedImmature, allGeneratedMature, allFee;
+ allGeneratedImmature = allGeneratedMature = allFee = 0;
+ string strSentAccount;
+ list<pair<CBitcoinAddress, int64> > listReceived;
+ list<pair<CBitcoinAddress, int64> > listSent;
+ GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
+
+ if (strAccount == "")
+ nGenerated = allGeneratedMature;
+ if (strAccount == strSentAccount)
+ {
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& s, listSent)
+ nSent += s.second;
+ nFee = allFee;
+ }
+ CRITICAL_BLOCK(pwallet->cs_mapAddressBook)
+ {
+ BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived)
+ {
+ if (pwallet->mapAddressBook.count(r.first))
+ {
+ map<CBitcoinAddress, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first);
+ if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount)
+ nReceived += r.second;
+ }
+ else if (strAccount.empty())
+ {
+ nReceived += r.second;
+ }
+ }
+ }
+}
+
+void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
+{
+ vtxPrev.clear();
+
+ const int COPY_DEPTH = 3;
+ if (SetMerkleBranch() < COPY_DEPTH)
+ {
+ vector<uint256> vWorkQueue;
+ BOOST_FOREACH(const CTxIn& txin, vin)
+ vWorkQueue.push_back(txin.prevout.hash);
+
+ // This critsect is OK because txdb is already open
+ CRITICAL_BLOCK(pwallet->cs_mapWallet)
+ {
+ map<uint256, const CMerkleTx*> mapWalletPrev;
+ set<uint256> setAlreadyDone;
+ for (int i = 0; i < vWorkQueue.size(); i++)
+ {
+ uint256 hash = vWorkQueue[i];
+ if (setAlreadyDone.count(hash))
+ continue;
+ setAlreadyDone.insert(hash);
+
+ CMerkleTx tx;
+ map<uint256, CWalletTx>::const_iterator mi = pwallet->mapWallet.find(hash);
+ if (mi != pwallet->mapWallet.end())
+ {
+ tx = (*mi).second;
+ BOOST_FOREACH(const CMerkleTx& txWalletPrev, (*mi).second.vtxPrev)
+ mapWalletPrev[txWalletPrev.GetHash()] = &txWalletPrev;
+ }
+ else if (mapWalletPrev.count(hash))
+ {
+ tx = *mapWalletPrev[hash];
+ }
+ else if (!fClient && txdb.ReadDiskTx(hash, tx))
+ {
+ ;
+ }
+ else
+ {
+ printf("ERROR: AddSupportingTransactions() : unsupported transaction\n");
+ continue;
+ }
+
+ int nDepth = tx.SetMerkleBranch();
+ vtxPrev.push_back(tx);
+
+ if (nDepth < COPY_DEPTH)
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
+ vWorkQueue.push_back(txin.prevout.hash);
+ }
+ }
+ }
+
+ reverse(vtxPrev.begin(), vtxPrev.end());
+}
+
+bool CWalletTx::WriteToDisk()
+{
+ return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
+}
+
+int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
+{
+ int ret = 0;
+
+ CBlockIndex* pindex = pindexStart;
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ while (pindex)
+ {
+ CBlock block;
+ block.ReadFromDisk(pindex, true);
+ BOOST_FOREACH(CTransaction& tx, block.vtx)
+ {
+ if (AddToWalletIfInvolvingMe(tx, &block, fUpdate))
+ ret++;
+ }
+ pindex = pindex->pnext;
+ }
+ }
+ return ret;
+}
+
+void CWallet::ReacceptWalletTransactions()
+{
+ CTxDB txdb("r");
+ bool fRepeat = true;
+ while (fRepeat) CRITICAL_BLOCK(cs_mapWallet)
+ {
+ fRepeat = false;
+ vector<CDiskTxPos> vMissingTx;
+ BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
+ {
+ CWalletTx& wtx = item.second;
+ if (wtx.IsCoinBase() && wtx.IsSpent(0))
+ continue;
+
+ CTxIndex txindex;
+ bool fUpdated = false;
+ if (txdb.ReadTxIndex(wtx.GetHash(), txindex))
+ {
+ // 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());
+ continue;
+ }
+ for (int i = 0; i < txindex.vSpent.size(); i++)
+ {
+ if (wtx.IsSpent(i))
+ continue;
+ if (!txindex.vSpent[i].IsNull() && IsMine(wtx.vout[i]))
+ {
+ wtx.MarkSpent(i);
+ fUpdated = true;
+ vMissingTx.push_back(txindex.vSpent[i]);
+ }
+ }
+ if (fUpdated)
+ {
+ printf("ReacceptWalletTransactions found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
+ wtx.MarkDirty();
+ wtx.WriteToDisk();
+ }
+ }
+ else
+ {
+ // Reaccept any txes of ours that aren't already in a block
+ if (!wtx.IsCoinBase())
+ wtx.AcceptWalletTransaction(txdb, false);
+ }
+ }
+ if (!vMissingTx.empty())
+ {
+ // TODO: optimize this to scan just part of the block chain?
+ if (ScanForWalletTransactions(pindexGenesisBlock))
+ fRepeat = true; // Found missing transactions: re-do Reaccept.
+ }
+ }
+}
+
+void CWalletTx::RelayWalletTransaction(CTxDB& txdb)
+{
+ BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
+ {
+ if (!tx.IsCoinBase())
+ {
+ uint256 hash = tx.GetHash();
+ if (!txdb.ContainsTx(hash))
+ RelayMessage(CInv(MSG_TX, hash), (CTransaction)tx);
+ }
+ }
+ if (!IsCoinBase())
+ {
+ uint256 hash = GetHash();
+ if (!txdb.ContainsTx(hash))
+ {
+ printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str());
+ RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this);
+ }
+ }
+}
+
+void CWalletTx::RelayWalletTransaction()
+{
+ CTxDB txdb("r");
+ RelayWalletTransaction(txdb);
+}
+
+void CWallet::ResendWalletTransactions()
+{
+ // Do this infrequently and randomly to avoid giving away
+ // that these are our transactions.
+ static int64 nNextTime;
+ if (GetTime() < nNextTime)
+ return;
+ bool fFirst = (nNextTime == 0);
+ nNextTime = GetTime() + GetRand(30 * 60);
+ if (fFirst)
+ return;
+
+ // Only do it if there's been a new block since last time
+ static int64 nLastTime;
+ if (nTimeBestReceived < nLastTime)
+ return;
+ nLastTime = GetTime();
+
+ // Rebroadcast any of our txes that aren't in a block yet
+ printf("ResendWalletTransactions()\n");
+ CTxDB txdb("r");
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ // Sort them in chronological order
+ multimap<unsigned int, CWalletTx*> mapSorted;
+ BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
+ {
+ CWalletTx& wtx = item.second;
+ // Don't rebroadcast until it's had plenty of time that
+ // it should have gotten in already by now.
+ if (nTimeBestReceived - (int64)wtx.nTimeReceived > 5 * 60)
+ mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
+ }
+ BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted)
+ {
+ CWalletTx& wtx = *item.second;
+ wtx.RelayWalletTransaction(txdb);
+ }
+ }
+}
+
+
+
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Actions
+//
+
+
+int64 CWallet::GetBalance() const
+{
+ int64 nTotal = 0;
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ {
+ const CWalletTx* pcoin = &(*it).second;
+ if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
+ continue;
+ nTotal += pcoin->GetAvailableCredit();
+ }
+ }
+
+ return nTotal;
+}
+
+
+bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
+{
+ setCoinsRet.clear();
+ nValueRet = 0;
+
+ // List of values less than target
+ pair<int64, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
+ coinLowestLarger.first = INT64_MAX;
+ coinLowestLarger.second.first = NULL;
+ vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue;
+ int64 nTotalLower = 0;
+
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ vector<const CWalletTx*> vCoins;
+ vCoins.reserve(mapWallet.size());
+ for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ vCoins.push_back(&(*it).second);
+ random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
+
+ BOOST_FOREACH(const CWalletTx* pcoin, vCoins)
+ {
+ if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
+ continue;
+
+ if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
+ continue;
+
+ int nDepth = pcoin->GetDepthInMainChain();
+ if (nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
+ continue;
+
+ for (int i = 0; i < pcoin->vout.size(); i++)
+ {
+ if (pcoin->IsSpent(i) || !IsMine(pcoin->vout[i]))
+ continue;
+
+ int64 n = pcoin->vout[i].nValue;
+
+ if (n <= 0)
+ continue;
+
+ pair<int64,pair<const CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin,i));
+
+ if (n == nTargetValue)
+ {
+ setCoinsRet.insert(coin.second);
+ nValueRet += coin.first;
+ return true;
+ }
+ else if (n < nTargetValue + CENT)
+ {
+ vValue.push_back(coin);
+ nTotalLower += n;
+ }
+ else if (n < coinLowestLarger.first)
+ {
+ coinLowestLarger = coin;
+ }
+ }
+ }
+ }
+
+ if (nTotalLower == nTargetValue || nTotalLower == nTargetValue + CENT)
+ {
+ for (int i = 0; i < vValue.size(); ++i)
+ {
+ setCoinsRet.insert(vValue[i].second);
+ nValueRet += vValue[i].first;
+ }
+ return true;
+ }
+
+ if (nTotalLower < nTargetValue + (coinLowestLarger.second.first ? CENT : 0))
+ {
+ if (coinLowestLarger.second.first == NULL)
+ return false;
+ setCoinsRet.insert(coinLowestLarger.second);
+ nValueRet += coinLowestLarger.first;
+ return true;
+ }
+
+ if (nTotalLower >= nTargetValue + CENT)
+ nTargetValue += CENT;
+
+ // Solve subset sum by stochastic approximation
+ sort(vValue.rbegin(), vValue.rend());
+ vector<char> vfIncluded;
+ vector<char> vfBest(vValue.size(), true);
+ int64 nBest = nTotalLower;
+
+ for (int nRep = 0; nRep < 1000 && nBest != nTargetValue; nRep++)
+ {
+ vfIncluded.assign(vValue.size(), false);
+ int64 nTotal = 0;
+ bool fReachedTarget = false;
+ for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++)
+ {
+ for (int i = 0; i < vValue.size(); i++)
+ {
+ if (nPass == 0 ? rand() % 2 : !vfIncluded[i])
+ {
+ nTotal += vValue[i].first;
+ vfIncluded[i] = true;
+ if (nTotal >= nTargetValue)
+ {
+ fReachedTarget = true;
+ if (nTotal < nBest)
+ {
+ nBest = nTotal;
+ vfBest = vfIncluded;
+ }
+ nTotal -= vValue[i].first;
+ vfIncluded[i] = false;
+ }
+ }
+ }
+ }
+ }
+
+ // If the next larger is still closer, return it
+ if (coinLowestLarger.second.first && coinLowestLarger.first - nTargetValue <= nBest - nTargetValue)
+ {
+ setCoinsRet.insert(coinLowestLarger.second);
+ nValueRet += coinLowestLarger.first;
+ }
+ else {
+ for (int i = 0; i < vValue.size(); i++)
+ if (vfBest[i])
+ {
+ setCoinsRet.insert(vValue[i].second);
+ nValueRet += vValue[i].first;
+ }
+
+ //// debug print
+ printf("SelectCoins() best subset: ");
+ for (int i = 0; i < vValue.size(); i++)
+ if (vfBest[i])
+ printf("%s ", FormatMoney(vValue[i].first).c_str());
+ printf("total %s\n", FormatMoney(nBest).c_str());
+ }
+
+ return true;
+}
+
+bool CWallet::SelectCoins(int64 nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
+{
+ return (SelectCoinsMinConf(nTargetValue, 1, 6, setCoinsRet, nValueRet) ||
+ SelectCoinsMinConf(nTargetValue, 1, 1, setCoinsRet, nValueRet) ||
+ SelectCoinsMinConf(nTargetValue, 0, 1, setCoinsRet, nValueRet));
+}
+
+
+
+
+bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
+{
+ int64 nValue = 0;
+ BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend)
+ {
+ if (nValue < 0)
+ return false;
+ nValue += s.second;
+ }
+ if (vecSend.empty() || nValue < 0)
+ return false;
+
+ wtxNew.pwallet = this;
+
+ CRITICAL_BLOCK(cs_main)
+ {
+ // txdb must be opened before the mapWallet lock
+ CTxDB txdb("r");
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ nFeeRet = nTransactionFee;
+ loop
+ {
+ wtxNew.vin.clear();
+ wtxNew.vout.clear();
+ wtxNew.fFromMe = true;
+
+ int64 nTotalValue = nValue + nFeeRet;
+ double dPriority = 0;
+ // vouts to the payees
+ BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend)
+ wtxNew.vout.push_back(CTxOut(s.second, s.first));
+
+ // Choose coins to use
+ set<pair<const CWalletTx*,unsigned int> > setCoins;
+ int64 nValueIn = 0;
+ if (!SelectCoins(nTotalValue, setCoins, nValueIn))
+ return false;
+ BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
+ {
+ int64 nCredit = pcoin.first->vout[pcoin.second].nValue;
+ dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain();
+ }
+
+ int64 nChange = nValueIn - nValue - nFeeRet;
+ // if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE
+ // or until nChange becomes zero
+ if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < CENT)
+ {
+ int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet);
+ nChange -= nMoveToFee;
+ nFeeRet += nMoveToFee;
+ }
+
+ if (nChange > 0)
+ {
+ // Note: We use a new key here to keep it from being obvious which side is the change.
+ // The drawback is that by not reusing a previous key, the change may be lost if a
+ // backup is restored, if the backup doesn't have the new private key for the change.
+ // If we reused the old key, it would be possible to add code to look for and
+ // rediscover unknown transactions that were written with keys of ours to recover
+ // post-backup change.
+
+ // Reserve a new key pair from key pool
+ vector<unsigned char> vchPubKey = reservekey.GetReservedKey();
+ // assert(mapKeys.count(vchPubKey));
+
+ // Fill a vout to ourself, using same address type as the payment
+ CScript scriptChange;
+ if (vecSend[0].first.GetBitcoinAddress().IsValid())
+ scriptChange.SetBitcoinAddress(vchPubKey);
+ else
+ scriptChange << vchPubKey << OP_CHECKSIG;
+
+ // Insert change txn at random position:
+ vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());
+ wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
+ }
+ else
+ reservekey.ReturnKey();
+
+ // Fill vin
+ BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
+ wtxNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second));
+
+ // Sign
+ int nIn = 0;
+ BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
+ if (!SignSignature(*this, *coin.first, wtxNew, nIn++))
+ return false;
+
+ // Limit size
+ unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK);
+ if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
+ return false;
+ dPriority /= nBytes;
+
+ // Check that enough fee is included
+ int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000);
+ bool fAllowFree = CTransaction::AllowFree(dPriority);
+ int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree);
+ if (nFeeRet < max(nPayFee, nMinFee))
+ {
+ nFeeRet = max(nPayFee, nMinFee);
+ continue;
+ }
+
+ // Fill vtxPrev by copying from previous transactions vtxPrev
+ wtxNew.AddSupportingTransactions(txdb);
+ wtxNew.fTimeReceivedIsTxTime = true;
+
+ break;
+ }
+ }
+ }
+ return true;
+}
+
+bool CWallet::CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
+{
+ vector< pair<CScript, int64> > vecSend;
+ vecSend.push_back(make_pair(scriptPubKey, nValue));
+ return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet);
+}
+
+// Call after CreateTransaction unless you want to abort
+bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
+{
+ CRITICAL_BLOCK(cs_main)
+ {
+ printf("CommitTransaction:\n%s", wtxNew.ToString().c_str());
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ // This is only to keep the database open to defeat the auto-flush for the
+ // duration of this scope. This is the only place where this optimization
+ // maybe makes sense; please don't do it anywhere else.
+ CWalletDB* pwalletdb = fFileBacked ? new CWalletDB(strWalletFile,"r") : NULL;
+
+ // Take key pair from key pool so it won't be used again
+ reservekey.KeepKey();
+
+ // Add tx to wallet, because if it has change it's also ours,
+ // otherwise just for transaction history.
+ AddToWallet(wtxNew);
+
+ // Mark old coins as spent
+ set<CWalletTx*> setCoins;
+ BOOST_FOREACH(const CTxIn& txin, wtxNew.vin)
+ {
+ CWalletTx &coin = mapWallet[txin.prevout.hash];
+ coin.pwallet = this;
+ coin.MarkSpent(txin.prevout.n);
+ coin.WriteToDisk();
+ vWalletUpdated.push_back(coin.GetHash());
+ }
+
+ if (fFileBacked)
+ delete pwalletdb;
+ }
+
+ // Track how many getdata requests our transaction gets
+ CRITICAL_BLOCK(cs_mapRequestCount)
+ mapRequestCount[wtxNew.GetHash()] = 0;
+
+ // Broadcast
+ if (!wtxNew.AcceptToMemoryPool())
+ {
+ // This must not fail. The transaction has already been signed and recorded.
+ printf("CommitTransaction() : Error: Transaction not valid");
+ return false;
+ }
+ wtxNew.RelayWalletTransaction();
+ }
+ MainFrameRepaint();
+ return true;
+}
+
+
+
+
+// requires cs_main lock
+string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
+{
+ CReserveKey reservekey(this);
+ int64 nFeeRequired;
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (IsLocked())
+ {
+ string strError = _("Error: Wallet locked, unable to create transaction ");
+ printf("SendMoney() : %s", strError.c_str());
+ return strError;
+ }
+ if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired))
+ {
+ string strError;
+ if (nValue + nFeeRequired > GetBalance())
+ strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "), FormatMoney(nFeeRequired).c_str());
+ else
+ strError = _("Error: Transaction creation failed ");
+ printf("SendMoney() : %s", strError.c_str());
+ return strError;
+ }
+ }
+
+ if (fAskFee && !ThreadSafeAskFee(nFeeRequired, _("Sending..."), NULL))
+ return "ABORTED";
+
+ if (!CommitTransaction(wtxNew, reservekey))
+ return _("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.");
+
+ MainFrameRepaint();
+ return "";
+}
+
+
+
+// requires cs_main lock
+string CWallet::SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
+{
+ // Check amount
+ if (nValue <= 0)
+ return _("Invalid amount");
+ if (nValue + nTransactionFee > GetBalance())
+ return _("Insufficient funds");
+
+ // Parse bitcoin address
+ CScript scriptPubKey;
+ scriptPubKey.SetBitcoinAddress(address);
+
+ return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee);
+}
+
+
+
+
+int CWallet::LoadWallet(bool& fFirstRunRet)
+{
+ if (!fFileBacked)
+ return false;
+ fFirstRunRet = false;
+ int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
+ if (nLoadWalletRet != DB_LOAD_OK)
+ return nLoadWalletRet;
+ fFirstRunRet = vchDefaultKey.empty();
+
+ if (!HaveKey(Hash160(vchDefaultKey)))
+ {
+ // Create new keyUser and set as default key
+ RandAddSeedPerfmon();
+
+ SetDefaultKey(GetOrReuseKeyFromPool());
+ if (!SetAddressBookName(CBitcoinAddress(vchDefaultKey), ""))
+ return DB_LOAD_FAIL;
+ }
+
+ CreateThread(ThreadFlushWalletDB, &strWalletFile);
+ return DB_LOAD_OK;
+}
+
+
+bool CWallet::SetAddressBookName(const CBitcoinAddress& address, const string& strName)
+{
+ mapAddressBook[address] = strName;
+ if (!fFileBacked)
+ return false;
+ return CWalletDB(strWalletFile).WriteName(address.ToString(), strName);
+}
+
+bool CWallet::DelAddressBookName(const CBitcoinAddress& address)
+{
+ mapAddressBook.erase(address);
+ if (!fFileBacked)
+ return false;
+ return CWalletDB(strWalletFile).EraseName(address.ToString());
+}
+
+
+void CWallet::PrintWallet(const CBlock& block)
+{
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ 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("\n");
+}
+
+bool CWallet::GetTransaction(const uint256 &hashTx, CWalletTx& wtx)
+{
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ map<uint256, CWalletTx>::iterator mi = mapWallet.find(hashTx);
+ if (mi != mapWallet.end())
+ {
+ wtx = (*mi).second;
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CWallet::SetDefaultKey(const std::vector<unsigned char> &vchPubKey)
+{
+ if (fFileBacked)
+ {
+ if (!CWalletDB(strWalletFile).WriteDefaultKey(vchPubKey))
+ return false;
+ }
+ vchDefaultKey = vchPubKey;
+ return true;
+}
+
+bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut)
+{
+ if (!pwallet->fFileBacked)
+ return false;
+ strWalletFileOut = pwallet->strWalletFile;
+ return true;
+}
+
+bool CWallet::TopUpKeyPool()
+{
+ CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(cs_setKeyPool)
+ CRITICAL_BLOCK(cs_vMasterKey)
+ {
+ if (IsLocked())
+ return false;
+
+ CWalletDB walletdb(strWalletFile);
+
+ // Top up key pool
+ int64 nTargetSize = max(GetArg("-keypool", 100), (int64)0);
+ while (setKeyPool.size() < nTargetSize+1)
+ {
+ int64 nEnd = 1;
+ if (!setKeyPool.empty())
+ nEnd = *(--setKeyPool.end()) + 1;
+ 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());
+ }
+ }
+ return true;
+}
+
+void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
+{
+ nIndex = -1;
+ keypool.vchPubKey.clear();
+ CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(cs_setKeyPool)
+ {
+ if (!IsLocked())
+ TopUpKeyPool();
+
+ // Get the oldest key
+ if(setKeyPool.empty())
+ return;
+
+ CWalletDB walletdb(strWalletFile);
+
+ nIndex = *(setKeyPool.begin());
+ setKeyPool.erase(setKeyPool.begin());
+ if (!walletdb.ReadPool(nIndex, keypool))
+ throw runtime_error("ReserveKeyFromKeyPool() : read failed");
+ if (!HaveKey(Hash160(keypool.vchPubKey)))
+ throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
+ assert(!keypool.vchPubKey.empty());
+ printf("keypool reserve %"PRI64d"\n", nIndex);
+ }
+}
+
+void CWallet::KeepKey(int64 nIndex)
+{
+ // Remove from key pool
+ if (fFileBacked)
+ {
+ CWalletDB walletdb(strWalletFile);
+ CRITICAL_BLOCK(cs_main)
+ {
+ walletdb.ErasePool(nIndex);
+ }
+ }
+ printf("keypool keep %"PRI64d"\n", nIndex);
+}
+
+void CWallet::ReturnKey(int64 nIndex)
+{
+ // Return to key pool
+ CRITICAL_BLOCK(cs_setKeyPool)
+ setKeyPool.insert(nIndex);
+ printf("keypool return %"PRI64d"\n", nIndex);
+}
+
+vector<unsigned char> CWallet::GetOrReuseKeyFromPool()
+{
+ int64 nIndex = 0;
+ CKeyPool keypool;
+ ReserveKeyFromKeyPool(nIndex, keypool);
+ if(nIndex == -1)
+ return vchDefaultKey;
+ KeepKey(nIndex);
+ return keypool.vchPubKey;
+}
+
+int64 CWallet::GetOldestKeyPoolTime()
+{
+ int64 nIndex = 0;
+ CKeyPool keypool;
+ ReserveKeyFromKeyPool(nIndex, keypool);
+ if (nIndex == -1)
+ return GetTime();
+ ReturnKey(nIndex);
+ return keypool.nTime;
+}
+
+vector<unsigned char> CReserveKey::GetReservedKey()
+{
+ if (nIndex == -1)
+ {
+ CKeyPool keypool;
+ pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
+ if (nIndex != -1)
+ vchPubKey = keypool.vchPubKey;
+ else
+ {
+ printf("CReserveKey::GetReservedKey(): Warning: using default key instead of a new key, top up your keypool.");
+ vchPubKey = pwallet->vchDefaultKey;
+ }
+ }
+ assert(!vchPubKey.empty());
+ return vchPubKey;
+}
+
+void CReserveKey::KeepKey()
+{
+ if (nIndex != -1)
+ pwallet->KeepKey(nIndex);
+ nIndex = -1;
+ vchPubKey.clear();
+}
+
+void CReserveKey::ReturnKey()
+{
+ if (nIndex != -1)
+ pwallet->ReturnKey(nIndex);
+ nIndex = -1;
+ vchPubKey.clear();
+}
+
diff --git a/src/wallet.h b/src/wallet.h
new file mode 100644
index 0000000000..499f2a63ac
--- /dev/null
+++ b/src/wallet.h
@@ -0,0 +1,640 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+#ifndef BITCOIN_WALLET_H
+#define BITCOIN_WALLET_H
+
+#include "bignum.h"
+#include "key.h"
+#include "script.h"
+
+class CWalletTx;
+class CReserveKey;
+class CWalletDB;
+
+class CWallet : public CCryptoKeyStore
+{
+private:
+ bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
+ bool SelectCoins(int64 nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
+
+ CWalletDB *pwalletdbEncryption;
+ CCriticalSection cs_pwalletdbEncryption;
+
+public:
+ bool fFileBacked;
+ std::string strWalletFile;
+
+ std::set<int64> setKeyPool;
+ CCriticalSection cs_setKeyPool;
+
+ typedef std::map<unsigned int, CMasterKey> MasterKeyMap;
+ MasterKeyMap mapMasterKeys;
+ unsigned int nMasterKeyMaxID;
+
+ CWallet()
+ {
+ fFileBacked = false;
+ nMasterKeyMaxID = 0;
+ pwalletdbEncryption = NULL;
+ }
+ CWallet(std::string strWalletFileIn)
+ {
+ strWalletFile = strWalletFileIn;
+ fFileBacked = true;
+ nMasterKeyMaxID = 0;
+ pwalletdbEncryption = NULL;
+ }
+
+ mutable CCriticalSection cs_mapWallet;
+ std::map<uint256, CWalletTx> mapWallet;
+ std::vector<uint256> vWalletUpdated;
+
+ std::map<uint256, int> mapRequestCount;
+ mutable CCriticalSection cs_mapRequestCount;
+
+ std::map<CBitcoinAddress, std::string> mapAddressBook;
+ mutable CCriticalSection cs_mapAddressBook;
+
+ std::vector<unsigned char> vchDefaultKey;
+
+ // keystore implementation
+ bool AddKey(const CKey& key);
+ bool LoadKey(const CKey& key) { return CCryptoKeyStore::AddKey(key); }
+ bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
+ bool LoadCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); }
+
+ bool Unlock(const std::string& strWalletPassphrase);
+ bool ChangeWalletPassphrase(const std::string& strOldWalletPassphrase, const std::string& strNewWalletPassphrase);
+ bool EncryptWallet(const std::string& strWalletPassphrase);
+
+ bool AddToWallet(const CWalletTx& wtxIn);
+ bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate = false);
+ bool EraseFromWallet(uint256 hash);
+ void WalletUpdateSpent(const CTransaction& prevout);
+ int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
+ void ReacceptWalletTransactions();
+ void ResendWalletTransactions();
+ int64 GetBalance() const;
+ bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
+ bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
+ bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
+ bool BroadcastTransaction(CWalletTx& wtxNew);
+ std::string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
+ std::string SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
+
+ bool TopUpKeyPool();
+ void ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool);
+ void KeepKey(int64 nIndex);
+ void ReturnKey(int64 nIndex);
+ std::vector<unsigned char> GetOrReuseKeyFromPool();
+ int64 GetOldestKeyPoolTime();
+
+ bool IsMine(const CTxIn& txin) const;
+ int64 GetDebit(const CTxIn& txin) const;
+ bool IsMine(const CTxOut& txout) const
+ {
+ return ::IsMine(*this, txout.scriptPubKey);
+ }
+ int64 GetCredit(const CTxOut& txout) const
+ {
+ if (!MoneyRange(txout.nValue))
+ throw std::runtime_error("CWallet::GetCredit() : value out of range");
+ return (IsMine(txout) ? txout.nValue : 0);
+ }
+ bool IsChange(const CTxOut& txout) const
+ {
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, this, address))
+ CRITICAL_BLOCK(cs_mapAddressBook)
+ if (!mapAddressBook.count(address))
+ return true;
+ return false;
+ }
+ int64 GetChange(const CTxOut& txout) const
+ {
+ if (!MoneyRange(txout.nValue))
+ throw std::runtime_error("CWallet::GetChange() : value out of range");
+ return (IsChange(txout) ? txout.nValue : 0);
+ }
+ bool IsMine(const CTransaction& tx) const
+ {
+ BOOST_FOREACH(const CTxOut& txout, tx.vout)
+ if (IsMine(txout))
+ return true;
+ return false;
+ }
+ bool IsFromMe(const CTransaction& tx) const
+ {
+ return (GetDebit(tx) > 0);
+ }
+ int64 GetDebit(const CTransaction& tx) const
+ {
+ int64 nDebit = 0;
+ BOOST_FOREACH(const CTxIn& txin, tx.vin)
+ {
+ nDebit += GetDebit(txin);
+ if (!MoneyRange(nDebit))
+ throw std::runtime_error("CWallet::GetDebit() : value out of range");
+ }
+ return nDebit;
+ }
+ int64 GetCredit(const CTransaction& tx) const
+ {
+ int64 nCredit = 0;
+ BOOST_FOREACH(const CTxOut& txout, tx.vout)
+ {
+ nCredit += GetCredit(txout);
+ if (!MoneyRange(nCredit))
+ throw std::runtime_error("CWallet::GetCredit() : value out of range");
+ }
+ return nCredit;
+ }
+ int64 GetChange(const CTransaction& tx) const
+ {
+ int64 nChange = 0;
+ BOOST_FOREACH(const CTxOut& txout, tx.vout)
+ {
+ nChange += GetChange(txout);
+ if (!MoneyRange(nChange))
+ throw std::runtime_error("CWallet::GetChange() : value out of range");
+ }
+ return nChange;
+ }
+ void SetBestChain(const CBlockLocator& loc)
+ {
+ CWalletDB walletdb(strWalletFile);
+ walletdb.WriteBestBlock(loc);
+ }
+
+ int LoadWallet(bool& fFirstRunRet);
+// bool BackupWallet(const std::string& strDest);
+
+ // requires cs_mapAddressBook lock
+ bool SetAddressBookName(const CBitcoinAddress& address, const std::string& strName);
+
+ // requires cs_mapAddressBook lock
+ bool DelAddressBookName(const CBitcoinAddress& address);
+
+ void UpdatedTransaction(const uint256 &hashTx)
+ {
+ CRITICAL_BLOCK(cs_mapWallet)
+ vWalletUpdated.push_back(hashTx);
+ }
+
+ void PrintWallet(const CBlock& block);
+
+ void Inventory(const uint256 &hash)
+ {
+ CRITICAL_BLOCK(cs_mapRequestCount)
+ {
+ std::map<uint256, int>::iterator mi = mapRequestCount.find(hash);
+ if (mi != mapRequestCount.end())
+ (*mi).second++;
+ }
+ }
+
+ int GetKeyPoolSize()
+ {
+ return setKeyPool.size();
+ }
+
+ bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx);
+
+ bool SetDefaultKey(const std::vector<unsigned char> &vchPubKey);
+};
+
+
+class CReserveKey
+{
+protected:
+ CWallet* pwallet;
+ int64 nIndex;
+ std::vector<unsigned char> vchPubKey;
+public:
+ CReserveKey(CWallet* pwalletIn)
+ {
+ nIndex = -1;
+ pwallet = pwalletIn;
+ }
+
+ ~CReserveKey()
+ {
+ if (!fShutdown)
+ ReturnKey();
+ }
+
+ void ReturnKey();
+ std::vector<unsigned char> GetReservedKey();
+ void KeepKey();
+};
+
+
+//
+// A transaction with a bunch of additional info that only the owner cares
+// about. It includes any unrecorded transactions needed to link it back
+// to the block chain.
+//
+class CWalletTx : public CMerkleTx
+{
+public:
+ const CWallet* pwallet;
+
+ std::vector<CMerkleTx> vtxPrev;
+ std::map<std::string, std::string> mapValue;
+ std::vector<std::pair<std::string, std::string> > vOrderForm;
+ unsigned int fTimeReceivedIsTxTime;
+ unsigned int nTimeReceived; // time received by this node
+ char fFromMe;
+ std::string strFromAccount;
+ std::vector<char> vfSpent;
+
+ // memory only
+ mutable char fDebitCached;
+ mutable char fCreditCached;
+ mutable char fAvailableCreditCached;
+ mutable char fChangeCached;
+ mutable int64 nDebitCached;
+ mutable int64 nCreditCached;
+ mutable int64 nAvailableCreditCached;
+ mutable int64 nChangeCached;
+
+ // memory only UI hints
+ mutable unsigned int nTimeDisplayed;
+ mutable int nLinesDisplayed;
+ mutable char fConfirmedDisplayed;
+
+ CWalletTx()
+ {
+ Init(NULL);
+ }
+
+ CWalletTx(const CWallet* pwalletIn)
+ {
+ Init(pwalletIn);
+ }
+
+ CWalletTx(const CWallet* pwalletIn, const CMerkleTx& txIn) : CMerkleTx(txIn)
+ {
+ Init(pwalletIn);
+ }
+
+ CWalletTx(const CWallet* pwalletIn, const CTransaction& txIn) : CMerkleTx(txIn)
+ {
+ Init(pwalletIn);
+ }
+
+ void Init(const CWallet* pwalletIn)
+ {
+ pwallet = pwalletIn;
+ vtxPrev.clear();
+ mapValue.clear();
+ vOrderForm.clear();
+ fTimeReceivedIsTxTime = false;
+ nTimeReceived = 0;
+ fFromMe = false;
+ strFromAccount.clear();
+ vfSpent.clear();
+ fDebitCached = false;
+ fCreditCached = false;
+ fAvailableCreditCached = false;
+ fChangeCached = false;
+ nDebitCached = 0;
+ nCreditCached = 0;
+ nAvailableCreditCached = 0;
+ nChangeCached = 0;
+ nTimeDisplayed = 0;
+ nLinesDisplayed = 0;
+ fConfirmedDisplayed = false;
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ CWalletTx* pthis = const_cast<CWalletTx*>(this);
+ if (fRead)
+ pthis->Init(NULL);
+ char fSpent = false;
+
+ if (!fRead)
+ {
+ pthis->mapValue["fromaccount"] = pthis->strFromAccount;
+
+ std::string str;
+ BOOST_FOREACH(char f, vfSpent)
+ {
+ str += (f ? '1' : '0');
+ if (f)
+ fSpent = true;
+ }
+ pthis->mapValue["spent"] = str;
+ }
+
+ nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action);
+ READWRITE(vtxPrev);
+ READWRITE(mapValue);
+ READWRITE(vOrderForm);
+ READWRITE(fTimeReceivedIsTxTime);
+ READWRITE(nTimeReceived);
+ READWRITE(fFromMe);
+ READWRITE(fSpent);
+
+ if (fRead)
+ {
+ pthis->strFromAccount = pthis->mapValue["fromaccount"];
+
+ if (mapValue.count("spent"))
+ BOOST_FOREACH(char c, pthis->mapValue["spent"])
+ pthis->vfSpent.push_back(c != '0');
+ else
+ pthis->vfSpent.assign(vout.size(), fSpent);
+ }
+
+ pthis->mapValue.erase("fromaccount");
+ pthis->mapValue.erase("version");
+ pthis->mapValue.erase("spent");
+ )
+
+ // marks certain txout's as spent
+ // returns true if any update took place
+ bool UpdateSpent(const std::vector<char>& vfNewSpent)
+ {
+ bool fReturn = false;
+ for (int i=0; i < vfNewSpent.size(); i++)
+ {
+ if (i == vfSpent.size())
+ break;
+
+ if (vfNewSpent[i] && !vfSpent[i])
+ {
+ vfSpent[i] = true;
+ fReturn = true;
+ fAvailableCreditCached = false;
+ }
+ }
+ return fReturn;
+ }
+
+ void MarkDirty()
+ {
+ fCreditCached = false;
+ fAvailableCreditCached = false;
+ fDebitCached = false;
+ fChangeCached = false;
+ }
+
+ void MarkSpent(unsigned int nOut)
+ {
+ if (nOut >= vout.size())
+ throw std::runtime_error("CWalletTx::MarkSpent() : nOut out of range");
+ vfSpent.resize(vout.size());
+ if (!vfSpent[nOut])
+ {
+ vfSpent[nOut] = true;
+ fAvailableCreditCached = false;
+ }
+ }
+
+ bool IsSpent(unsigned int nOut) const
+ {
+ if (nOut >= vout.size())
+ throw std::runtime_error("CWalletTx::IsSpent() : nOut out of range");
+ if (nOut >= vfSpent.size())
+ return false;
+ return (!!vfSpent[nOut]);
+ }
+
+ int64 GetDebit() const
+ {
+ if (vin.empty())
+ return 0;
+ if (fDebitCached)
+ return nDebitCached;
+ nDebitCached = pwallet->GetDebit(*this);
+ fDebitCached = true;
+ return nDebitCached;
+ }
+
+ int64 GetCredit(bool fUseCache=true) const
+ {
+ // Must wait until coinbase is safely deep enough in the chain before valuing it
+ if (IsCoinBase() && GetBlocksToMaturity() > 0)
+ return 0;
+
+ // GetBalance can assume transactions in mapWallet won't change
+ if (fUseCache && fCreditCached)
+ return nCreditCached;
+ nCreditCached = pwallet->GetCredit(*this);
+ fCreditCached = true;
+ return nCreditCached;
+ }
+
+ int64 GetAvailableCredit(bool fUseCache=true) const
+ {
+ // Must wait until coinbase is safely deep enough in the chain before valuing it
+ if (IsCoinBase() && GetBlocksToMaturity() > 0)
+ return 0;
+
+ if (fUseCache && fAvailableCreditCached)
+ return nAvailableCreditCached;
+
+ int64 nCredit = 0;
+ for (int i = 0; i < vout.size(); i++)
+ {
+ if (!IsSpent(i))
+ {
+ const CTxOut &txout = vout[i];
+ nCredit += pwallet->GetCredit(txout);
+ if (!MoneyRange(nCredit))
+ throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
+ }
+ }
+
+ nAvailableCreditCached = nCredit;
+ fAvailableCreditCached = true;
+ return nCredit;
+ }
+
+
+ int64 GetChange() const
+ {
+ if (fChangeCached)
+ return nChangeCached;
+ nChangeCached = pwallet->GetChange(*this);
+ fChangeCached = true;
+ return nChangeCached;
+ }
+
+ void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<CBitcoinAddress, int64> >& listReceived,
+ std::list<std::pair<CBitcoinAddress, int64> >& listSent, int64& nFee, std::string& strSentAccount) const;
+
+ void GetAccountAmounts(const std::string& strAccount, int64& nGenerated, int64& nReceived,
+ int64& nSent, int64& nFee) const;
+
+ bool IsFromMe() const
+ {
+ return (GetDebit() > 0);
+ }
+
+ bool IsConfirmed() const
+ {
+ // Quick answer in most cases
+ if (!IsFinal())
+ return false;
+ if (GetDepthInMainChain() >= 1)
+ return true;
+ if (!IsFromMe()) // using wtx's cached debit
+ return false;
+
+ // If no confirmations but it's from us, we can still
+ // consider it confirmed if all dependencies are confirmed
+ std::map<uint256, const CMerkleTx*> mapPrev;
+ std::vector<const CMerkleTx*> vWorkQueue;
+ vWorkQueue.reserve(vtxPrev.size()+1);
+ vWorkQueue.push_back(this);
+ for (int i = 0; i < vWorkQueue.size(); i++)
+ {
+ const CMerkleTx* ptx = vWorkQueue[i];
+
+ if (!ptx->IsFinal())
+ return false;
+ if (ptx->GetDepthInMainChain() >= 1)
+ continue;
+ if (!pwallet->IsFromMe(*ptx))
+ return false;
+
+ if (mapPrev.empty())
+ BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
+ mapPrev[tx.GetHash()] = &tx;
+
+ BOOST_FOREACH(const CTxIn& txin, ptx->vin)
+ {
+ if (!mapPrev.count(txin.prevout.hash))
+ return false;
+ vWorkQueue.push_back(mapPrev[txin.prevout.hash]);
+ }
+ }
+ return true;
+ }
+
+ bool WriteToDisk();
+
+ int64 GetTxTime() const;
+ int GetRequestCount() const;
+
+ void AddSupportingTransactions(CTxDB& txdb);
+
+ bool AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs=true);
+ bool AcceptWalletTransaction();
+
+ void RelayWalletTransaction(CTxDB& txdb);
+ void RelayWalletTransaction();
+};
+
+
+//
+// Private key that includes an expiration date in case it never gets used.
+//
+class CWalletKey
+{
+public:
+ CPrivKey vchPrivKey;
+ int64 nTimeCreated;
+ int64 nTimeExpires;
+ std::string strComment;
+ //// todo: add something to note what created it (user, getnewaddress, change)
+ //// maybe should have a map<string, string> property map
+
+ CWalletKey(int64 nExpires=0)
+ {
+ nTimeCreated = (nExpires ? GetTime() : 0);
+ nTimeExpires = nExpires;
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ if (!(nType & SER_GETHASH))
+ READWRITE(nVersion);
+ READWRITE(vchPrivKey);
+ READWRITE(nTimeCreated);
+ READWRITE(nTimeExpires);
+ READWRITE(strComment);
+ )
+};
+
+
+
+
+
+
+//
+// Account information.
+// Stored in wallet with key "acc"+string account name
+//
+class CAccount
+{
+public:
+ std::vector<unsigned char> vchPubKey;
+
+ CAccount()
+ {
+ SetNull();
+ }
+
+ void SetNull()
+ {
+ vchPubKey.clear();
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ if (!(nType & SER_GETHASH))
+ READWRITE(nVersion);
+ READWRITE(vchPubKey);
+ )
+};
+
+
+
+//
+// Internal transfers.
+// Database key is acentry<account><counter>
+//
+class CAccountingEntry
+{
+public:
+ std::string strAccount;
+ int64 nCreditDebit;
+ int64 nTime;
+ std::string strOtherAccount;
+ std::string strComment;
+
+ CAccountingEntry()
+ {
+ SetNull();
+ }
+
+ void SetNull()
+ {
+ nCreditDebit = 0;
+ nTime = 0;
+ strAccount.clear();
+ strOtherAccount.clear();
+ strComment.clear();
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ if (!(nType & SER_GETHASH))
+ READWRITE(nVersion);
+ // Note: strAccount is serialized as part of the key, not here.
+ READWRITE(nCreditDebit);
+ READWRITE(nTime);
+ READWRITE(strOtherAccount);
+ READWRITE(strComment);
+ )
+};
+
+bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
+
+#endif
diff --git a/xpm/about.xpm b/src/xpm/about.xpm
index 3fa868ca76..3fa868ca76 100644
--- a/xpm/about.xpm
+++ b/src/xpm/about.xpm
diff --git a/xpm/addressbook16.xpm b/src/xpm/addressbook16.xpm
index e00944ef7a..e00944ef7a 100644
--- a/xpm/addressbook16.xpm
+++ b/src/xpm/addressbook16.xpm
diff --git a/xpm/addressbook20.xpm b/src/xpm/addressbook20.xpm
index 7ebd73fb2f..7ebd73fb2f 100644
--- a/xpm/addressbook20.xpm
+++ b/src/xpm/addressbook20.xpm
diff --git a/xpm/bitcoin16.xpm b/src/xpm/bitcoin16.xpm
index f70fef026a..f70fef026a 100644
--- a/xpm/bitcoin16.xpm
+++ b/src/xpm/bitcoin16.xpm
diff --git a/xpm/bitcoin20.xpm b/src/xpm/bitcoin20.xpm
index 3cc29ac14b..3cc29ac14b 100644
--- a/xpm/bitcoin20.xpm
+++ b/src/xpm/bitcoin20.xpm
diff --git a/xpm/bitcoin32.xpm b/src/xpm/bitcoin32.xpm
index f538a44d2d..f538a44d2d 100644
--- a/xpm/bitcoin32.xpm
+++ b/src/xpm/bitcoin32.xpm
diff --git a/xpm/bitcoin48.xpm b/src/xpm/bitcoin48.xpm
index 85a7711940..85a7711940 100644
--- a/xpm/bitcoin48.xpm
+++ b/src/xpm/bitcoin48.xpm
diff --git a/xpm/bitcoin80.xpm b/src/xpm/bitcoin80.xpm
index c3c816e92d..c3c816e92d 100644
--- a/xpm/bitcoin80.xpm
+++ b/src/xpm/bitcoin80.xpm
diff --git a/xpm/check.xpm b/src/xpm/check.xpm
index e62b656961..e62b656961 100644
--- a/xpm/check.xpm
+++ b/src/xpm/check.xpm
diff --git a/xpm/send16.xpm b/src/xpm/send16.xpm
index 7da44d9c56..7da44d9c56 100644
--- a/xpm/send16.xpm
+++ b/src/xpm/send16.xpm
diff --git a/xpm/send16noshadow.xpm b/src/xpm/send16noshadow.xpm
index f6cef45e0d..f6cef45e0d 100644
--- a/xpm/send16noshadow.xpm
+++ b/src/xpm/send16noshadow.xpm
diff --git a/xpm/send20.xpm b/src/xpm/send20.xpm
index 68e7b1379a..68e7b1379a 100644
--- a/xpm/send20.xpm
+++ b/src/xpm/send20.xpm
diff --git a/ui.rc b/ui.rc
deleted file mode 100644
index 0e0122de2b..0000000000
--- a/ui.rc
+++ /dev/null
@@ -1,15 +0,0 @@
-bitcoin ICON "rc/bitcoin.ico"
-
-#include "wx/msw/wx.rc"
-
-check ICON "rc/check.ico"
-send16 BITMAP "rc/send16.bmp"
-send16mask BITMAP "rc/send16mask.bmp"
-send16masknoshadow BITMAP "rc/send16masknoshadow.bmp"
-send20 BITMAP "rc/send20.bmp"
-send20mask BITMAP "rc/send20mask.bmp"
-addressbook16 BITMAP "rc/addressbook16.bmp"
-addressbook16mask BITMAP "rc/addressbook16mask.bmp"
-addressbook20 BITMAP "rc/addressbook20.bmp"
-addressbook20mask BITMAP "rc/addressbook20mask.bmp"
-favicon ICON "rc/favicon.ico"