Merge bitcoin v0.4.0 into ppcoin
authorSunny King <p2pcoin@gmail.com>
Sat, 17 Dec 2011 16:07:07 +0000 (16:07 +0000)
committerSunny King <p2pcoin@gmail.com>
Sat, 17 Dec 2011 16:07:07 +0000 (16:07 +0000)
95 files changed:
.gitignore
README.md
contrib/Bitcoin.app/Contents/Info.plist
contrib/gitian-descriptors/boost-win32.yml [new file with mode: 0644]
contrib/gitian-descriptors/gitian-win32.yml [new file with mode: 0644]
contrib/gitian-descriptors/gitian.yml [moved from contrib/gitian.yml with 56% similarity]
contrib/gitian-descriptors/wxwidgets-win32.yml [new file with mode: 0644]
contrib/gitian-descriptors/wxwidgets.yml [new file with mode: 0644]
contrib/gitian-downloader/bitcoin-download-config [new file with mode: 0644]
contrib/gitian-downloader/bluematt-key.pgp [new file with mode: 0644]
contrib/gitian-downloader/devrandom-key.pgp [new file with mode: 0644]
contrib/gitian-downloader/gavinandresen-key.pgp [new file with mode: 0644]
contrib/gitian-downloader/sipa-key.pgp [new file with mode: 0644]
contrib/gitian-downloader/tcatm-key.pgp [new file with mode: 0644]
contrib/gitian-win32.yml [deleted file]
contrib/pyminer/README [new file with mode: 0644]
contrib/pyminer/example-config.cfg [new file with mode: 0644]
contrib/pyminer/pyminer.py [new file with mode: 0755]
contrib/wx-patches/README [deleted file]
contrib/wx-patches/toplevel.cpp.diff [deleted file]
contrib/wx-patches/toplevel.h.diff [deleted file]
doc/README
doc/README_windows.txt
doc/build-msw.txt
doc/build-osx.txt
doc/build-unix.txt
doc/coding.txt
doc/release-process.txt
locale/cs/LC_MESSAGES/bitcoin.mo
locale/cs/LC_MESSAGES/bitcoin.po
locale/de/LC_MESSAGES/bitcoin.mo
locale/de/LC_MESSAGES/bitcoin.po
locale/es/LC_MESSAGES/bitcoin.po
locale/fr/LC_MESSAGES/bitcoin.mo
locale/nl/LC_MESSAGES/bitcoin.mo
locale/nl/LC_MESSAGES/bitcoin.po
locale/pl/LC_MESSAGES/bitcoin.po
locale/pt/LC_MESSAGES/bitcoin.mo
locale/readme.txt
locale/ro/LC_MESSAGES/bitcoin.mo [new file with mode: 0644]
locale/ro/LC_MESSAGES/bitcoin.po [new file with mode: 0644]
locale/ru/LC_MESSAGES/bitcoin.mo
locale/ru/LC_MESSAGES/bitcoin.po
locale/zh_cn/LC_MESSAGES/bitcoin.po
share/pixmaps/bitcoin.ico
share/pixmaps/nsis-header.bmp [new file with mode: 0644]
share/pixmaps/nsis-wizard.bmp [new file with mode: 0644]
share/setup.nsi
share/uiproject.fbp
src/base58.h
src/bignum.h
src/crypter.cpp [new file with mode: 0644]
src/crypter.h [new file with mode: 0644]
src/cryptopp/cpu.cpp
src/db.cpp
src/db.h
src/headers.h
src/init.cpp
src/init.h
src/irc.cpp
src/irc.h
src/key.h
src/keystore.cpp
src/keystore.h
src/main.cpp
src/main.h
src/makefile.linux-mingw
src/makefile.mingw
src/makefile.osx
src/makefile.unix
src/makefile.vc
src/net.cpp
src/net.h
src/noui.h
src/protocol.cpp [new file with mode: 0644]
src/protocol.h [new file with mode: 0644]
src/rpc.cpp
src/rpc.h
src/script.cpp
src/script.h
src/serialize.h
src/test/script_tests.cpp [new file with mode: 0644]
src/test/test_bitcoin.cpp
src/test/transaction_tests.cpp [new file with mode: 0644]
src/test/uint160_tests.cpp
src/test/uint256_tests.cpp
src/ui.cpp
src/ui.h
src/uibase.cpp
src/uibase.h
src/uint256.h
src/util.cpp
src/util.h
src/wallet.cpp
src/wallet.h

index aeeef17..c1d06a3 100644 (file)
@@ -3,3 +3,9 @@ src/bitcoin
 src/bitcoind
 .*.swp
 *.*~*
+*.bak
+*.rej
+*.orig
+*.o
+*.patch
+.bitcoin
index ab328ad..92635bb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,16 +1,30 @@
+
 Bitcoin integration/staging tree
 
 Development process
 ===================
 
-Developers work in their own trees, then submit pull requests when they think their feature or bug fix is ready.
+Developers work in their own trees, then submit pull requests when
+they think their feature or bug fix is ready.
+
+If it is a simple/trivial/non-controversial change, then one of the
+bitcoin development team members simply pulls it.
 
-If it is a simple/trivial/non-controversial change, then one of the bitcoin development team members simply pulls it.
+If it is a more complicated or potentially controversial
+change, then the patch submitter will be asked to start a
+discussion (if they haven't already) on the mailing list:
+http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development
 
-If it is a more complicated or potentially controversial change, then the patch submitter will be asked to start a discussion (if they haven't already) on the development forums:  http://www.bitcoin.org/smf/index.php?board=6.0
-The patch will be accepted if there is broad consensus that it is a good thing.  Developers should expect to rework and resubmit patches if they don't match the project's coding conventions (see coding.txt) or are controversial.
+The patch will be accepted if there is broad consensus that it is a
+good thing.  Developers should expect to rework and resubmit patches
+if they don't match the project's coding conventions (see coding.txt)
+or are controversial.
 
-The master branch is regularly built and tested (by who? need people willing to be quality assurance testers), and periodically pushed to the subversion repo to become the official, stable, released bitcoin.
+The master branch is regularly built and tested, but is not guaranteed
+to be completely stable. Tags are regularly created to indicate new
+official, stable release versions of Bitcoin. If you would like to
+help test the Bitcoin core, please contact QA@BitcoinTesting.org.
 
+Feature branches are created when there are major new features being
+worked on by several people.
 
-Feature branches are created when there are major new features being worked on by several people.
index 9a2eccc..a5c7da1 100644 (file)
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>0.3.24</string>
+       <string>0.4.00</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>324</string>
+       <string>400</string>
        <key>LSMinimumSystemVersion</key>
        <string>10.5</string>
        <key>CFBundleIconFile</key>
diff --git a/contrib/gitian-descriptors/boost-win32.yml b/contrib/gitian-descriptors/boost-win32.yml
new file mode 100644 (file)
index 0000000..61ea50e
--- /dev/null
@@ -0,0 +1,38 @@
+---
+name: "boost"
+suites:
+- "lucid"
+architectures:
+- "i386"
+packages: 
+- "mingw32"
+- "faketime"
+- "zip"
+reference_datetime: "2011-01-30 00:00:00"
+remotes: []
+files:
+- "boost_1_47_0.tar.bz2"
+script: |
+  TMPDIR="$HOME/tmpdir"
+  mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
+  tar xjf boost_1_47_0.tar.bz2
+  cd boost_1_47_0
+  echo "using gcc : 4.4 : i586-mingw32msvc-g++
+        :
+        <rc>i586-mingw32msvc-windres
+        <archiver>i586-mingw32msvc-ar
+        <cxxflags>-frandom-seed=boost1
+  ;" > user-config.jam
+  ./bootstrap.sh --without-icu
+  ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
+  for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do
+      mkdir $lib
+      (cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a)
+      mv $lib $TMPDIR/bin/$GBUILD_BITS
+  done
+  cp -a boost $TMPDIR/include
+  cd $TMPDIR
+  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
+  export FAKETIME=$REFERENCE_DATETIME
+  zip -r boost-win32-1.47.0-gitian.zip *
+  cp boost-win32-1.47.0-gitian.zip $OUTDIR
diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml
new file mode 100644 (file)
index 0000000..52b10bc
--- /dev/null
@@ -0,0 +1,92 @@
+---
+name: "bitcoin"
+suites:
+- "lucid"
+architectures:
+- "i386"
+packages: 
+- "mingw32"
+- "git-core"
+- "unzip"
+- "nsis"
+- "faketime"
+- "wine"
+reference_datetime: "2011-01-30 00:00:00"
+remotes:
+- "url": "https://github.com/bitcoin/bitcoin.git"
+  "dir": "bitcoin"
+files:
+- "wxwidgets-win32-2.9.2-gitian.zip"
+- "boost-win32-1.47.0-gitian.zip"
+- "openssl-1.0.0d.tar.gz"
+- "db-4.8.30.NC.tar.gz"
+- "miniupnpc-1.6.tar.gz"
+script: |
+  #
+  mkdir wxWidgets-2.9.2
+  cd wxWidgets-2.9.2
+  mkdir lib
+  unzip ../wxwidgets-win32-2.9.2-gitian.zip
+  cd bin/$GBUILD_BITS
+  for lib in wx_mswu; do
+    i586-mingw32msvc-ar rc ../../lib/lib${lib}-2.9-i586-mingw32msvc.a $lib/*.o
+    i586-mingw32msvc-ranlib ../../lib/lib${lib}-2.9-i586-mingw32msvc.a
+  done
+  cp -a wx ../../lib
+  cd ../..
+  mv include/wx-2.9/wx include
+  cd ..
+  #
+  mkdir boost_1_47_0
+  cd boost_1_47_0
+  mkdir -p stage/lib
+  unzip ../boost-win32-1.47.0-gitian.zip
+  cd bin/$GBUILD_BITS
+  for lib in *; do
+    i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o
+    i586-mingw32msvc-ranlib ../../stage/lib/libboost_${lib}-mt-s.a
+  done
+  cd ../..
+  mv include/boost .
+  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.8.30.NC.tar.gz
+  cd db-4.8.30.NC/build_unix
+  ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include"
+  make $MAKEOPTS
+  cd ../..
+  #
+  tar xzf miniupnpc-1.6.tar.gz
+  cd miniupnpc-1.6
+  sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw
+  sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw
+  make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar
+  cd ..
+  mv miniupnpc-1.6 miniupnpc
+  #
+  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)/-frandom-seed=bitcoin/' -i makefile.linux-mingw
+  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
+  export FAKETIME=$REFERENCE_DATETIME
+  export TZ=UTC
+  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
similarity index 56%
rename from contrib/gitian.yml
rename to contrib/gitian-descriptors/gitian.yml
index 90be893..efa9cb8 100644 (file)
@@ -6,40 +6,42 @@ architectures:
 - "i386"
 - "amd64"
 packages: 
-- "libdb4.7++-dev"
+- "libdb4.8++-dev"
 - "libxxf86vm-dev"
 - "libgtk2.0-dev"
 - "libboost-all-dev"
 - "libssl-dev"
 - "git-core"
+- "unzip"
 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"
-- "miniupnpc-1.5.tar.gz"
-- "toplevel.h.diff"
-- "toplevel.cpp.diff"
+- "wxWidgets-2.9.2-x64-gitian.zip"
+- "wxWidgets-2.9.2-x32-gitian.zip"
+- "miniupnpc-1.6.tar.gz"
 script: |
   INSTDIR="$HOME/install"
   export LIBRARY_PATH="$INSTDIR/lib"
   #
-  tar xzf miniupnpc-1.5.tar.gz
-  cd miniupnpc-1.5
+  tar xzf miniupnpc-1.6.tar.gz
+  cd miniupnpc-1.6
   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
+  mkdir -p $INSTDIR/bin $INSTDIR/lib/wx $INSTDIR/include
+  mkdir wxWidgets-2.9.2
+  cd wxWidgets-2.9.2
+  unzip ../wxWidgets-2.9.2-x32-gitian.zip
+  unzip -o ../wxWidgets-2.9.2-x64-gitian.zip
+  cp -a bin/$GBUILD_BITS/wx/config/gtk2-unicode-static-2.9 $INSTDIR/bin/wx-config
+  for lib in wx_gtk2u wxregexu wxtiff; do
+    ar rc $INSTDIR/lib/lib${lib}-2.9.a bin/$GBUILD_BITS/$lib/*.o
+    ranlib $INSTDIR/lib/lib${lib}-2.9.a
+  done
+  cp -a include/wx-2.9/* $INSTDIR/include
+  cp -a bin/$GBUILD_BITS/wx/include $INSTDIR/lib/wx
   cd ..
   #
   cd bitcoin
@@ -50,7 +52,7 @@ script: |
   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
+  sed 's/$(DEBUGFLAGS)//' -i 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
diff --git a/contrib/gitian-descriptors/wxwidgets-win32.yml b/contrib/gitian-descriptors/wxwidgets-win32.yml
new file mode 100644 (file)
index 0000000..3d49d7b
--- /dev/null
@@ -0,0 +1,40 @@
+---
+name: "wxwidgets"
+suites:
+- "lucid"
+architectures:
+- "i386"
+packages: 
+- "mingw32"
+- "faketime"
+- "zip"
+reference_datetime: "2011-01-30 00:00:00"
+remotes: []
+files:
+- "wxWidgets-2.9.2.tar.bz2"
+script: |
+  INSTDIR="$HOME/install"
+  TMPDIR="$HOME/tmpdir"
+  export LIBRARY_PATH="$INSTDIR/lib"
+  #
+  tar xjf wxWidgets-2.9.2.tar.bz2
+  cd wxWidgets-2.9.2
+  CXXFLAGS=-frandom-seed=wx1 ./configure --host=i586-mingw32msvc --build=i686-linux --prefix=$INSTDIR --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 install
+  mkdir $TMPDIR
+  cd $TMPDIR
+  cp -af $INSTDIR/include .
+  mkdir -p $TMPDIR/bin/$GBUILD_BITS
+  cd $TMPDIR/bin/$GBUILD_BITS
+  cp -af $INSTDIR/lib/wx .
+  for lib in wx_mswu; do
+      mkdir $lib
+      (cd $lib ; ar xf $INSTDIR/lib/lib${lib}-2.9-i586-mingw32msvc.a)
+  done
+  chmod -R +w $TMPDIR
+  cd $TMPDIR
+  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
+  export FAKETIME=$REFERENCE_DATETIME
+  zip -r wxwidgets-win32-2.9.2-gitian.zip *
+  cp wxwidgets-win32-2.9.2-gitian.zip $OUTDIR
diff --git a/contrib/gitian-descriptors/wxwidgets.yml b/contrib/gitian-descriptors/wxwidgets.yml
new file mode 100644 (file)
index 0000000..0509615
--- /dev/null
@@ -0,0 +1,42 @@
+---
+name: "wxwidgets"
+suites:
+- "lucid"
+architectures:
+- "i386"
+- "amd64"
+packages: 
+- "libxxf86vm-dev"
+- "libgtk2.0-dev"
+- "faketime"
+- "zip"
+reference_datetime: "2011-01-30 00:00:00"
+remotes: []
+files:
+- "wxWidgets-2.9.2.tar.bz2"
+script: |
+  INSTDIR="$HOME/install"
+  TMPDIR="$HOME/tmpdir"
+  export LIBRARY_PATH="$INSTDIR/lib"
+  #
+  tar xjf wxWidgets-2.9.2.tar.bz2
+  cd wxWidgets-2.9.2
+  ./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
+  mkdir $TMPDIR
+  cd $TMPDIR
+  cp -af $INSTDIR/include .
+  mkdir -p $TMPDIR/bin/$GBUILD_BITS
+  cd $TMPDIR/bin/$GBUILD_BITS
+  cp -af $INSTDIR/lib/wx .
+  for lib in wxtiff wxregexu wx_gtk2u; do
+      mkdir $lib
+      (cd $lib ; ar xf $INSTDIR/lib/lib${lib}-2.9.a)
+  done
+  chmod -R +w $TMPDIR
+  cd $TMPDIR
+  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
+  export FAKETIME=$REFERENCE_DATETIME
+  zip -r wxWidgets-2.9.2-x$GBUILD_BITS-gitian.zip *
+  cp wxWidgets-2.9.2-x$GBUILD_BITS-gitian.zip $OUTDIR
diff --git a/contrib/gitian-downloader/bitcoin-download-config b/contrib/gitian-downloader/bitcoin-download-config
new file mode 100644 (file)
index 0000000..d21bb07
--- /dev/null
@@ -0,0 +1,30 @@
+--- 
+name: bitcoin
+urls:
+- http://bitcoin.org/bitcoin-latest-linux-gitian.zip
+rss:
+- url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss
+  xpath: //item/link/text()
+  pattern: bitcoin-\d+.\d+.\d+-linux-gitian.zip
+signers:
+  0A82509767C7D4A5D14DA2301AE1D35043E08E54:
+    weight: 40
+    name: BlueMatt
+    key: bluematt
+  BF6273FAEF7CC0BA1F562E50989F6B3048A116B5:
+    weight: 40
+    name: Devrandom
+    key: devrandom
+  D762373D24904A3E42F33B08B9A408E71DAAC974:
+    weight: 40
+    name: Sipa
+    key: sipa
+  77E72E69DA7EE0A148C06B21B34821D4944DE5F7:
+    weight: 40
+    name: tcatm
+    key: tcatm
+  01CDF4627A3B88AAE4A571C87588242FBE38D3A8:
+    weight: 40
+    name: "Gavin Andresen"
+    key: gavinandresen
+minimum_weight: 120
diff --git a/contrib/gitian-downloader/bluematt-key.pgp b/contrib/gitian-downloader/bluematt-key.pgp
new file mode 100644 (file)
index 0000000..fb6d9eb
Binary files /dev/null and b/contrib/gitian-downloader/bluematt-key.pgp differ
diff --git a/contrib/gitian-downloader/devrandom-key.pgp b/contrib/gitian-downloader/devrandom-key.pgp
new file mode 100644 (file)
index 0000000..7189812
Binary files /dev/null and b/contrib/gitian-downloader/devrandom-key.pgp differ
diff --git a/contrib/gitian-downloader/gavinandresen-key.pgp b/contrib/gitian-downloader/gavinandresen-key.pgp
new file mode 100644 (file)
index 0000000..f81f44e
Binary files /dev/null and b/contrib/gitian-downloader/gavinandresen-key.pgp differ
diff --git a/contrib/gitian-downloader/sipa-key.pgp b/contrib/gitian-downloader/sipa-key.pgp
new file mode 100644 (file)
index 0000000..086c9eb
Binary files /dev/null and b/contrib/gitian-downloader/sipa-key.pgp differ
diff --git a/contrib/gitian-downloader/tcatm-key.pgp b/contrib/gitian-downloader/tcatm-key.pgp
new file mode 100644 (file)
index 0000000..baaec76
Binary files /dev/null and b/contrib/gitian-downloader/tcatm-key.pgp differ
diff --git a/contrib/gitian-win32.yml b/contrib/gitian-win32.yml
deleted file mode 100644 (file)
index 07d31c7..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
----
-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/pyminer/README b/contrib/pyminer/README
new file mode 100644 (file)
index 0000000..d159657
--- /dev/null
@@ -0,0 +1,6 @@
+
+This is a 'getwork' CPU mining client for bitcoin.
+
+It is pure-python, and therefore very, very slow.  The purpose is to
+provide a reference implementation of a miner, for study.
+
diff --git a/contrib/pyminer/example-config.cfg b/contrib/pyminer/example-config.cfg
new file mode 100644 (file)
index 0000000..103e7c1
--- /dev/null
@@ -0,0 +1,32 @@
+
+#
+# RPC login details
+#
+host=127.0.0.1
+port=8332
+
+rpcuser=myusername
+rpcpass=mypass
+
+
+#
+# mining details
+#
+
+threads=4
+
+# periodic rate for requesting new work, if solution not found
+scantime=60
+
+
+#
+# misc.
+#
+
+# not really used right now
+logdir=/tmp/pyminer
+
+# set to 1, to enable hashmeter output
+hashmeter=0
+
+
diff --git a/contrib/pyminer/pyminer.py b/contrib/pyminer/pyminer.py
new file mode 100755 (executable)
index 0000000..2887aba
--- /dev/null
@@ -0,0 +1,252 @@
+#!/usr/bin/python
+#
+# 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.
+#
+
+import time
+import json
+import pprint
+import hashlib
+import struct
+import re
+import base64
+import httplib
+import sys
+from multiprocessing import Process
+
+ERR_SLEEP = 15
+MAX_NONCE = 1000000L
+
+settings = {}
+pp = pprint.PrettyPrinter(indent=4)
+
+class BitcoinRPC:
+       OBJID = 1
+
+       def __init__(self, host, port, username, password):
+               authpair = "%s:%s" % (username, password)
+               self.authhdr = "Basic %s" % (base64.b64encode(authpair))
+               self.conn = httplib.HTTPConnection(host, port, False, 30)
+       def rpc(self, method, params=None):
+               self.OBJID += 1
+               obj = { 'version' : '1.1',
+                       'method' : method,
+                       'id' : self.OBJID }
+               if params is None:
+                       obj['params'] = []
+               else:
+                       obj['params'] = params
+               self.conn.request('POST', '/', json.dumps(obj),
+                       { 'Authorization' : self.authhdr,
+                         'Content-type' : 'application/json' })
+
+               resp = self.conn.getresponse()
+               if resp is None:
+                       print "JSON-RPC: no response"
+                       return None
+
+               body = resp.read()
+               resp_obj = json.loads(body)
+               if resp_obj is None:
+                       print "JSON-RPC: cannot JSON-decode body"
+                       return None
+               if 'error' in resp_obj and resp_obj['error'] != None:
+                       return resp_obj['error']
+               if 'result' not in resp_obj:
+                       print "JSON-RPC: no result in object"
+                       return None
+
+               return resp_obj['result']
+       def getblockcount(self):
+               return self.rpc('getblockcount')
+       def getwork(self, data=None):
+               return self.rpc('getwork', data)
+
+def uint32(x):
+       return x & 0xffffffffL
+
+def bytereverse(x):
+       return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) |
+                       (((x) >> 8) & 0x0000ff00) | ((x) >> 24) ))
+
+def bufreverse(in_buf):
+       out_words = []
+       for i in range(0, len(in_buf), 4):
+               word = struct.unpack('@I', in_buf[i:i+4])[0]
+               out_words.append(struct.pack('@I', bytereverse(word)))
+       return ''.join(out_words)
+
+def wordreverse(in_buf):
+       out_words = []
+       for i in range(0, len(in_buf), 4):
+               out_words.append(in_buf[i:i+4])
+       out_words.reverse()
+       return ''.join(out_words)
+
+class Miner:
+       def __init__(self, id):
+               self.id = id
+               self.max_nonce = MAX_NONCE
+
+       def work(self, datastr, targetstr):
+               # decode work data hex string to binary
+               static_data = datastr.decode('hex')
+               static_data = bufreverse(static_data)
+
+               # the first 76b of 80b do not change
+               blk_hdr = static_data[:76]
+
+               # decode 256-bit target value
+               targetbin = targetstr.decode('hex')
+               targetbin = targetbin[::-1]     # byte-swap and dword-swap
+               targetbin_str = targetbin.encode('hex')
+               target = long(targetbin_str, 16)
+
+               # pre-hash first 76b of block header
+               static_hash = hashlib.sha256()
+               static_hash.update(blk_hdr)
+
+               for nonce in xrange(self.max_nonce):
+
+                       # encode 32-bit nonce value
+                       nonce_bin = struct.pack("<I", nonce)
+
+                       # hash final 4b, the nonce value
+                       hash1_o = static_hash.copy()
+                       hash1_o.update(nonce_bin)
+                       hash1 = hash1_o.digest()
+
+                       # sha256 hash of sha256 hash
+                       hash_o = hashlib.sha256()
+                       hash_o.update(hash1)
+                       hash = hash_o.digest()
+
+                       # quick test for winning solution: high 32 bits zero?
+                       if hash[-4:] != '\0\0\0\0':
+                               continue
+
+                       # convert binary hash to 256-bit Python long
+                       hash = bufreverse(hash)
+                       hash = wordreverse(hash)
+
+                       hash_str = hash.encode('hex')
+                       l = long(hash_str, 16)
+
+                       # proof-of-work test:  hash < target
+                       if l < target:
+                               print time.asctime(), "PROOF-OF-WORK found: %064x" % (l,)
+                               return (nonce + 1, nonce_bin)
+                       else:
+                               print time.asctime(), "PROOF-OF-WORK false positive %064x" % (l,)
+#                              return (nonce + 1, nonce_bin)
+
+               return (nonce + 1, None)
+
+       def submit_work(self, rpc, original_data, nonce_bin):
+               nonce_bin = bufreverse(nonce_bin)
+               nonce = nonce_bin.encode('hex')
+               solution = original_data[:152] + nonce + original_data[160:256]
+               param_arr = [ solution ]
+               result = rpc.getwork(param_arr)
+               print time.asctime(), "--> Upstream RPC result:", result
+
+       def iterate(self, rpc):
+               work = rpc.getwork()
+               if work is None:
+                       time.sleep(ERR_SLEEP)
+                       return
+               if 'data' not in work or 'target' not in work:
+                       time.sleep(ERR_SLEEP)
+                       return
+
+               time_start = time.time()
+
+               (hashes_done, nonce_bin) = self.work(work['data'],
+                                                    work['target'])
+
+               time_end = time.time()
+               time_diff = time_end - time_start
+
+               self.max_nonce = long(
+                       (hashes_done * settings['scantime']) / time_diff)
+               if self.max_nonce > 0xfffffffaL:
+                       self.max_nonce = 0xfffffffaL
+
+               if settings['hashmeter']:
+                       print "HashMeter(%d): %d hashes, %.2f Khash/sec" % (
+                             self.id, hashes_done,
+                             (hashes_done / 1000.0) / time_diff)
+
+               if nonce_bin is not None:
+                       self.submit_work(rpc, work['data'], nonce_bin)
+
+       def loop(self):
+               rpc = BitcoinRPC(settings['host'], settings['port'],
+                                settings['rpcuser'], settings['rpcpass'])
+               if rpc is None:
+                       return
+
+               while True:
+                       self.iterate(rpc)
+
+def miner_thread(id):
+       miner = Miner(id)
+       miner.loop()
+
+if __name__ == '__main__':
+       if len(sys.argv) != 2:
+               print "Usage: pyminer.py CONFIG-FILE"
+               sys.exit(1)
+
+       f = open(sys.argv[1])
+       for line in f:
+               # skip comment lines
+               m = re.search('^\s*#', line)
+               if m:
+                       continue
+
+               # parse key=value lines
+               m = re.search('^(\w+)\s*=\s*(\S.*)$', line)
+               if m is None:
+                       continue
+               settings[m.group(1)] = m.group(2)
+       f.close()
+
+       if 'host' not in settings:
+               settings['host'] = '127.0.0.1'
+       if 'port' not in settings:
+               settings['port'] = 8332
+       if 'threads' not in settings:
+               settings['threads'] = 1
+       if 'hashmeter' not in settings:
+               settings['hashmeter'] = 0
+       if 'scantime' not in settings:
+               settings['scantime'] = 30L
+       if 'rpcuser' not in settings or 'rpcpass' not in settings:
+               print "Missing username and/or password in cfg file"
+               sys.exit(1)
+
+       settings['port'] = int(settings['port'])
+       settings['threads'] = int(settings['threads'])
+       settings['hashmeter'] = int(settings['hashmeter'])
+       settings['scantime'] = long(settings['scantime'])
+
+       thr_list = []
+       for thr_id in range(settings['threads']):
+               p = Process(target=miner_thread, args=(thr_id,))
+               p.start()
+               thr_list.append(p)
+               time.sleep(1)                   # stagger threads
+
+       print settings['threads'], "mining threads started"
+
+       print time.asctime(), "Miner Starts - %s:%s" % (settings['host'], settings['port'])
+       try:
+               for thr_proc in thr_list:
+                       thr_proc.join()
+       except KeyboardInterrupt:
+               pass
+       print time.asctime(), "Miner Stops - %s:%s" % (settings['host'], settings['port'])
+
diff --git a/contrib/wx-patches/README b/contrib/wx-patches/README
deleted file mode 100644 (file)
index 2afb4a9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644 (file)
index 359abf2..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
---- /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67326)\r
-+++ /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67496)\r
-@@ -72,4 +72,8 @@\r
- // send any activate events at all\r
- static int g_sendActivateEvent = -1;\r
-+\r
-+// Whether _NET_REQUEST_FRAME_EXTENTS support is working\r
-+//   0 == not tested yet, 1 == working, 2 == broken\r
-+static int gs_requestFrameExtentsStatus;\r
\r
- //-----------------------------------------------------------------------------\r
-@@ -432,4 +436,12 @@\r
-     if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property)\r
-     {\r
-+        if (win->m_netFrameExtentsTimerId)\r
-+        {\r
-+            // WM support for _NET_REQUEST_FRAME_EXTENTS is working\r
-+            gs_requestFrameExtentsStatus = 1;\r
-+            g_source_remove(win->m_netFrameExtentsTimerId);\r
-+            win->m_netFrameExtentsTimerId = 0;\r
-+        }\r
-+\r
-         wxSize decorSize = win->m_decorSize;\r
-         int left, right, top, bottom;\r
-@@ -439,4 +451,22 @@\r
-         win->GTKUpdateDecorSize(decorSize);\r
-     }\r
-+    return false;\r
-+}\r
-+}\r
-+\r
-+extern "C" {\r
-+static gboolean request_frame_extents_timeout(void* data)\r
-+{\r
-+    // WM support for _NET_REQUEST_FRAME_EXTENTS is broken\r
-+    gs_requestFrameExtentsStatus = 2;\r
-+    gdk_threads_enter();\r
-+    wxTopLevelWindowGTK* win = static_cast<wxTopLevelWindowGTK*>(data);\r
-+    win->m_netFrameExtentsTimerId = 0;\r
-+    wxSize decorSize = win->m_decorSize;\r
-+    int left, right, top, bottom;\r
-+    if (wxGetFrameExtents(gtk_widget_get_window(win->m_widget), &left, &right, &top, &bottom))\r
-+        decorSize.Set(left + right, top + bottom);\r
-+    win->GTKUpdateDecorSize(decorSize);\r
-+    gdk_threads_leave();\r
-     return false;\r
- }\r
-@@ -459,4 +489,5 @@\r
-     m_deferShowAllowed = true;\r
-     m_updateDecorSize = true;\r
-+    m_netFrameExtentsTimerId = 0;\r
\r
-     m_urgency_hint = -2;\r
-@@ -811,5 +842,6 @@\r
-     if (deferShow)\r
-     {\r
--        deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget);\r
-+        deferShow = gs_requestFrameExtentsStatus != 2 &&\r
-+            m_deferShowAllowed && !gtk_widget_get_realized(m_widget);\r
-         if (deferShow)\r
-         {\r
-@@ -829,11 +861,4 @@\r
-             // GetSize()/SetSize() because it makes window bigger between each\r
-             // restore and save.\r
--            m_updateDecorSize = deferShow;\r
--        }\r
--        if (deferShow)\r
--        {\r
--            // Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken\r
--            const char* name = gdk_x11_screen_get_window_manager_name(screen);\r
--            deferShow = strcmp(name, "Fluxbox") != 0;\r
-             m_updateDecorSize = deferShow;\r
-         }\r
-@@ -875,4 +900,12 @@\r
-             (XEvent*)&xevent);\r
\r
-+        if (gs_requestFrameExtentsStatus == 0)\r
-+        {\r
-+            // if WM does not respond to request within 1 second,\r
-+            // we assume support for _NET_REQUEST_FRAME_EXTENTS is not working\r
-+            m_netFrameExtentsTimerId =\r
-+                g_timeout_add(1000, request_frame_extents_timeout, this);\r
-+        }\r
-+\r
-         // defer calling gtk_widget_show()\r
-         m_isShown = true;\r
diff --git a/contrib/wx-patches/toplevel.h.diff b/contrib/wx-patches/toplevel.h.diff
deleted file mode 100644 (file)
index c2718d4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
---- /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 65373)\r
-+++ /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 67496)\r
-@@ -114,4 +114,6 @@\r
-     // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.\r
-     int m_urgency_hint;\r
-+    // timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling\r
-+    unsigned m_netFrameExtentsTimerId;\r
\r
-     // return the size of the window without WM decorations\r
index a4df4c2..772fd7f 100644 (file)
@@ -1,4 +1,4 @@
-Bitcoin 0.3.24 BETA
+Bitcoin 0.4.0rc1 BETA
 
 Copyright (c) 2009-2011 Bitcoin Developers
 Distributed under the MIT/X11 software license, see the accompanying
@@ -24,6 +24,93 @@ 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
+passphrase 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 your 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.
+
+
+Technical details of wallet encryption
+--------------------------------------
+Wallet encryption uses AES-256-CBC to encrypt only the private keys
+that are held in a wallet.  The keys are encrypted with a master key
+which is entirely random.  This master key is then encrypted with
+AES-256-CBC with a key derived from the passphrase using SHA512 and
+OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by
+the speed of the machine which does the initial encryption (and is
+updated based on the speed of a computer which does a subsequent
+passphrase change).  Although the underlying code supports multiple
+encrypted copies of the same master key (and thus multiple passphrases)
+the client does not yet have a method to add additional passphrases.
+
+At runtime, the client loads the wallet as it normally would, however
+the keystore stores the keys in encrypted form.  When the passphrase
+is required (to top up keypool or send coins) it will either be queried
+by a GUI prompt, or must first be entered with the walletpassphrase
+RPC command.  This will change the wallet to "unlocked" state where the
+unencrypted master key is stored in memory (in the case of GUI, only for
+long enough to complete the requested operation, in RPC, for as long as
+is specified by the second parameter to walletpassphrase).  The wallet is
+then locked (or can be manually locked using the walletlock RPC command)
+and the unencrypted master key is removed from memory.
+
+Implementation details of wallet encryption
+-------------------------------------------
+When the wallet is locked, calls to sendtoaddress, sendfrom, sendmany,
+and keypoolrefill will return Error -13: "Error: Please enter the wallet 
+passphrase with walletpassphrase first."
+
+When the wallet is unlocked, calls to walletpassphrase will fail.
+
+When a wallet is encrypted, the passphrase is required to top up the
+keypool, thus, if the passphrase is rarely entered, it is possible that
+keypool might run out.  In this case, the default key will be used as the
+target for payouts for mining, and calls to getnewaddress and getaccount
+address will return an error.  In order to prevent such cases, the keypool
+is automatically refilled when walletpassphrase is called with a correct
+passphrase and when topupkeypool is called (while the wallet is unlocked).
+Note that the keypool continues to be topped up on various occasions when
+a new key from pool is used and the wallet is unlocked (or unencrypted).
+
+
+
 See the documentation at the bitcoin wiki:
   https://en.bitcoin.it/wiki/Main_Page
 
index a19dcc9..8378ae5 100644 (file)
@@ -1,4 +1,4 @@
-Bitcoin 0.3.24 BETA\r
+Bitcoin 0.4.00rc1 BETA\r
 \r
 Copyright (c) 2009-2011 Bitcoin Developers\r
 Distributed under the MIT/X11 software license, see the accompanying\r
index 1911008..d08e3a2 100644 (file)
@@ -27,11 +27,11 @@ Dependencies
 Libraries you need to download separately and build:
 
                 default path               download
-wxWidgets       \wxwidgets-2.9.1-mgw       http://www.wxwidgets.org/downloads/
+wxWidgets       \wxwidgets-2.9.2-mgw       http://www.wxwidgets.org/downloads/
 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/
+Berkeley DB     \db-4.8.30.NC-mgw          http://www.oracle.com/technology/software/products/berkeley-db/index.html
+Boost           \boost-1.47.0-mgw          http://www.boost.org/users/download/
+miniupnpc       \miniupnpc-1.6-mgw         http://miniupnp.tuxfamily.org/files/
 
 Their licenses:
 wxWidgets      LGPL 2.1 with very liberal exceptions
@@ -41,11 +41,11 @@ Boost          MIT-like license
 miniupnpc      New (3-clause) BSD license
 
 Versions used in this release:
-wxWidgets    2.9.1
+wxWidgets    2.9.2
 OpenSSL      1.0.0d
-Berkeley DB  4.7.25.NC
-Boost        1.43.0
-miniupnpc    1.5-20110215
+Berkeley DB  4.8.30.NC
+Boost        1.47.0
+miniupnpc    1.6
 
 
 Notes
@@ -57,7 +57,7 @@ classes that do the rote work of constructing all the UI elements.
 wxWidgets
 ---------
 DOS shell:
-cd \wxWidgets-2.9.1-mgw\build\msw
+cd \wxWidgets-2.9.2-mgw\build\msw
 mingw32-make -f makefile.gcc
 
 OpenSSL
@@ -73,30 +73,26 @@ make
 Berkeley DB
 -----------
 MSYS shell:
-cd /c/db-4.7.25.NC-mgw/build_unix
+cd /c/db-4.8.30.NC-mgw/build_unix
 sh ../dist/configure --enable-mingw --enable-cxx
 make
 
-
 Boost
 -----
 DOS prompt:
 downloaded boost jam 3.1.18
-cd \boost-1.43.0-mgw
+cd \boost-1.47.0-mgw
 bjam toolset=gcc --build-type=complete stage
 
-Note:
-building with boost 1.45.0 failed because of boost ticket 4614, 4258
-builds fine with boost 1.43.0
-
 MiniUPnPc
 ---------
-Building miniupnpc failed on Windows Server 2003, thus it is expected that a binary copy will be used.
-See http://miniupnp.tuxfamily.org/forum/viewtopic.php?t=642
 UPnP support is optional, make with USE_UPNP= to disable it.
 
-Get upnpc-exe-win32-20110215.zip and unzip it to \upnpc-exe-win32-20110215
-Get miniupnpc-1.5.20110215.tar.gz and copy *.h to \upnpc-exe-win32-20110215\miniupnpc
+MSYS shell:
+cd /c/miniupnpc-1.6-mgw
+make -f Makefile.mingw
+mkdir miniupnpc
+cp *.h miniupnpc/
 
 Bitcoin
 -------
index ddf0250..52d876d 100644 (file)
@@ -135,18 +135,18 @@ The process for miniupnpc (optional) is similar to that of OpenSSL.
 Download from http://miniupnp.tuxfamily.org/files/.
 
 cd ~/bitcoin/deps
-tar xvf ~/Downloads/miniupnpc-1.5.tar
-mv miniupnpc-1.5 miniupnpc-1.5-x86_64
-tar xvf ~/Downloads/miniupnpc-1.5.tar
-mv miniupnpc-1.5 miniupnpc-1.5-i386
+tar xvf ~/Downloads/miniupnpc-1.6.tar
+mv miniupnpc-1.6 miniupnpc-1.6-x86_64
+tar xvf ~/Downloads/miniupnpc-1.6.tar
+mv miniupnpc-1.6 miniupnpc-1.6-i386
 # build x86_64 (64 bit intel) binary
-cd miniupnpc-1.5-x86_64
+cd miniupnpc-1.6-x86_64
 export CFLAGS="-arch x86_64"
 export LDFLAGS="-arch x86_64"
 export PREFIX="/Users/macuser/bitcoin/deps"
 make && make install
 # build i386 (32 bit intel) binary
-cd miniupnpc-1.5-i386
+cd miniupnpc-1.6-i386
 export CFLAGS="-arch i386"
 export LDFLAGS="-arch i386"
 export PREFIX="/Users/macuser/bitcoin/deps"
@@ -154,7 +154,7 @@ make
 
 # combine the libs
 cd ~/bitcoin/deps
-lipo -arch i386 miniupnpc-1.5-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.5-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create
+lipo -arch i386 miniupnpc-1.6-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.6-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create
 
 Verify your binaries
 
@@ -175,8 +175,8 @@ Berkeley DB
 Download from http://freshmeat.net/projects/berkeleydb/
 
 cd ~/bitcoin/deps
-tar xvf ~/Downloads/db-4.8.26.tar
-cd db-4.8.26/build_unix
+tar xvf ~/Downloads/db-4.8.30.tar
+cd db-4.8.30/build_unix
 ../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install
 
 
index 0c4e88e..4ecf15a 100644 (file)
@@ -25,15 +25,14 @@ Dependencies
 sudo apt-get install build-essential
 sudo apt-get install libgtk2.0-dev
 sudo apt-get install libssl-dev
-sudo apt-get install libdb4.7-dev
-sudo apt-get install libdb4.7++-dev
+sudo apt-get install libdb4.8-dev
+sudo apt-get install libdb4.8++-dev
 Boost 1.40+: sudo apt-get install libboost-all-dev
 or Boost 1.37: sudo apt-get install libboost1.37-dev
 
 If using Boost 1.37, append -mt to the boost libraries in the makefile.
 
-Requires wxWidgets 2.9.0 or greater, which uses UTF-8.  Don't try 2.8, it
-won't work.
+Requires wxWidgets 2.9.1 or newer.
 
 You need to download wxWidgets from http://www.wxwidgets.org/downloads/
 and build it yourself.  See the build instructions and configure parameters
@@ -55,10 +54,10 @@ miniupnpc      New (3-clause) BSD license
 Versions used in this release:
 GCC          4.3.3
 OpenSSL      0.9.8g
-wxWidgets    2.9.0
-Berkeley DB  4.7.25.NC
+wxWidgets    2.9.2
+Berkeley DB  4.8.30.NC
 Boost        1.37
-miniupnpc    1.5
+miniupnpc    1.6
 
 
 Notes
@@ -74,8 +73,8 @@ symbols, which reduces the executable size by about 90%.
 wxWidgets
 ---------
 cd /usr/local
-tar -xzvf wxWidgets-2.9.0.tar.gz
-cd wxWidgets-2.9.0
+tar -xzvf wxWidgets-2.9.2.tar.gz
+cd wxWidgets-2.9.2
 mkdir buildgtk
 cd buildgtk
 ../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg
@@ -87,8 +86,8 @@ ldconfig
 
 miniupnpc
 ---------
-tar -xzvf miniupnpc-1.5.tar.gz
-cd miniupnpc-1.5
+tar -xzvf miniupnpc-1.6.tar.gz
+cd miniupnpc-1.6
 make
 sudo su
 make install
@@ -96,8 +95,7 @@ make install
 
 Berkeley DB
 -----------
-You need Berkeley DB 4.7.  Don't use 4.8, the database/log0000* files
-are incompatible.  If you have to build Berkeley DB yourself:
+You need Berkeley DB 4.8.  If you have to build Berkeley DB yourself:
 ../dist/configure --enable-cxx
 make
 
index 4707476..b3c812a 100644 (file)
@@ -39,3 +39,61 @@ v       vector or similar list objects
 map     map or multimap\r
 set     set or multiset\r
 bn      CBigNum\r
+\r
+-------------------------\r
+Locking/mutex usage notes\r
+\r
+The code is multi-threaded, and uses mutexes and the\r
+CRITICAL_BLOCK/TRY_CRITICAL_BLOCK macros to protect data structures.\r
+\r
+Deadlocks due to inconsistent lock ordering (thread 1 locks cs_main\r
+and then cs_wallet, while thread 2 locks them in the opposite order:\r
+result, deadlock as each waits for the other to release its lock) are\r
+a problem. Compile with -DDEBUG_LOCKORDER to get lock order\r
+inconsistencies reported in the debug.log file.\r
+\r
+Re-architecting the core code so there are better-defined interfaces\r
+between the various components is a goal, with any necessary locking\r
+done by the components (e.g. see the self-contained CKeyStore class\r
+and its cs_KeyStore lock for example).\r
+\r
+-------\r
+Threads\r
+\r
+StartNode : Starts other threads.\r
+\r
+ThreadGetMyExternalIP : Determines outside-the-firewall IP address,\r
+sends addr message to connected peers when it determines it. \r
+\r
+ThreadIRCSeed : Joins IRC bootstrapping channel, watching for new\r
+peers and advertising this node's IP address. \r
+\r
+ThreadSocketHandler : Sends/Receives data from peers on port 8333.\r
+\r
+ThreadMessageHandler : Higher-level message handling (sending and\r
+receiving).\r
+\r
+ThreadOpenConnections : Initiates new connections to peers.\r
+\r
+ThreadTopUpKeyPool : replenishes the keystore's keypool.\r
+\r
+ThreadCleanWalletPassphrase : re-locks an encrypted wallet after user\r
+has unlocked it for a period of time. \r
+\r
+SendingDialogStartTransfer : used by pay-via-ip-address code (obsolete)\r
+\r
+ThreadDelayedRepaint : repaint the gui \r
+\r
+ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used\r
+in 500ms.\r
+\r
+ThreadRPCServer : Remote procedure call handler, listens on port 8332\r
+for connections and services them.\r
+\r
+ThreadBitcoinMiner : Generates bitcoins\r
+\r
+ThreadMapPort : Universal plug-and-play startup/shutdown\r
+\r
+Shutdown : Does an orderly shutdown of everything\r
+\r
+ExitTimeout : Windows-only, sleeps 5 seconds then exits application\r
index 4940afe..bcda64d 100644 (file)
@@ -1,6 +1,9 @@
 * update (commit) version in sources
+  src/serialize.h
+  share/setup.nsi
 
 * update (commit) version in OSX app bundle
+ contrib/Bitcoin.app/Contents/Info.plist
 
   * CFBundleShortVersionString should have value like 0.3.23
   * CFBundleVersion should have value like 323
index 80354cf..8b6e444 100644 (file)
Binary files a/locale/cs/LC_MESSAGES/bitcoin.mo and b/locale/cs/LC_MESSAGES/bitcoin.mo differ
index 51fe182..2275d90 100644 (file)
@@ -5,8 +5,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-05-26 21:44+0200\n"
-"PO-Revision-Date: 2011-05-26 22:31+0100\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"
@@ -17,114 +17,541 @@ msgstr ""
 "X-Poedit-Basepath: .\n"
 "X-Poedit-SearchPath-0: ../../..\n"
 
-#: ../../../src/net.cpp:1503
+#: ../../../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 "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ěží."
+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/ui.cpp:204
+#: ../../../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:303
+#: ../../../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:304
+#: ../../../src/ui.cpp:354
 msgid "Date"
 msgstr "Datum"
 
-#: ../../../src/ui.cpp:305
+#: ../../../src/ui.cpp:355
 msgid "Description"
 msgstr "Popis"
 
-#: ../../../src/ui.cpp:306
+#: ../../../src/ui.cpp:356
 msgid "Debit"
 msgstr "Výdaje"
 
-#: ../../../src/ui.cpp:307
+#: ../../../src/ui.cpp:357
 msgid "Credit"
 msgstr "Příjmy"
 
-#: ../../../src/ui.cpp:513
+#: ../../../src/ui.cpp:568
 #, c-format
 msgid "Open for %d blocks"
 msgstr "Otevřeno pro %d bloků"
 
-#: ../../../src/ui.cpp:515
+#: ../../../src/ui.cpp:570
 #, c-format
 msgid "Open until %s"
 msgstr "Otřevřeno dokud %s"
 
-#: ../../../src/ui.cpp:521
+#: ../../../src/ui.cpp:576
 #, c-format
 msgid "%d/offline?"
 msgstr "%d/offline?"
 
-#: ../../../src/ui.cpp:523
+#: ../../../src/ui.cpp:578
 #, c-format
 msgid "%d/unconfirmed"
 msgstr "%d/nepotvrzeno"
 
-#: ../../../src/ui.cpp:525
+#: ../../../src/ui.cpp:580
 #, c-format
 msgid "%d confirmations"
 msgstr "%d potvrzení"
 
-#: ../../../src/ui.cpp:610
+#: ../../../src/ui.cpp:665
 msgid "Generated"
 msgstr "Vygenerováno"
 
-#: ../../../src/ui.cpp:618
+#: ../../../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:622
+#: ../../../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:626
+#: ../../../src/ui.cpp:681
 msgid "Generated (not accepted)"
 msgstr "Vygenerováno (neakceptováno)"
 
-#: ../../../src/ui.cpp:636
+#: ../../../src/ui.cpp:691
 msgid "From: "
 msgstr "Od: "
 
-#: ../../../src/ui.cpp:660
+#: ../../../src/ui.cpp:715
 msgid "Received with: "
 msgstr "Přijato adresou: "
 
-#: ../../../src/ui.cpp:706
+#: ../../../src/ui.cpp:760
 msgid "Payment to yourself"
 msgstr "Platba pro sebe sama"
 
-#: ../../../src/ui.cpp:740
+#: ../../../src/ui.cpp:794
 msgid "To: "
 msgstr "Pro: "
 
-#: ../../../src/ui.cpp:1055
+#: ../../../src/ui.cpp:1109
 msgid "    Generating"
 msgstr "    Generuji"
 
-#: ../../../src/ui.cpp:1057
+#: ../../../src/ui.cpp:1111
 msgid "(not connected)"
 msgstr "(nepřipojen)"
 
-#: ../../../src/ui.cpp:1060
+#: ../../../src/ui.cpp:1114
 #, c-format
 msgid "     %d connections     %d blocks     %d transactions"
 msgstr "     %d spojení     %d bloků     %d transakcí"
 
-#: ../../../src/ui.cpp:1165
-#: ../../../src/ui.cpp:2529
+#: ../../../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:1166
-#: ../../../src/ui.cpp:2530
+#: ../../../src/ui.cpp:1383
+#: ../../../src/ui.cpp:2816
 msgid ""
 "You should use a new address for each payment you receive.\n"
 "\n"
@@ -134,248 +561,226 @@ msgstr ""
 "\n"
 "Označení"
 
-#: ../../../src/ui.cpp:1235
+#: ../../../src/ui.cpp:1467
 msgid "<b>Status:</b> "
 msgstr "<b>Stav:</b> "
 
-#: ../../../src/ui.cpp:1240
+#: ../../../src/ui.cpp:1472
 msgid ", has not been successfully broadcast yet"
 msgstr ", ještě nebylo rozesláno"
 
-#: ../../../src/ui.cpp:1242
+#: ../../../src/ui.cpp:1474
 #, c-format
 msgid ", broadcast through %d node"
 msgstr ", rozesláno přes %d uzel"
 
-#: ../../../src/ui.cpp:1244
+#: ../../../src/ui.cpp:1476
 #, c-format
 msgid ", broadcast through %d nodes"
 msgstr ", rozesláno přes %d uzlů"
 
-#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1480
 msgid "<b>Date:</b> "
 msgstr "<b>Datum:</b> "
 
-#: ../../../src/ui.cpp:1256
+#: ../../../src/ui.cpp:1488
 msgid "<b>Source:</b> Generated<br>"
 msgstr "<b>Zdroj:</b> Vygenerováno<br>"
 
-#: ../../../src/ui.cpp:1262
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1494
+#: ../../../src/ui.cpp:1511
 msgid "<b>From:</b> "
 msgstr "<b>Od:</b> "
 
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1511
 msgid "unknown"
 msgstr "neznámo"
 
-#: ../../../src/ui.cpp:1281
-#: ../../../src/ui.cpp:1305
-#: ../../../src/ui.cpp:1364
+#: ../../../src/ui.cpp:1512
+#: ../../../src/ui.cpp:1536
+#: ../../../src/ui.cpp:1595
 msgid "<b>To:</b> "
 msgstr "<b>Pro:</b> "
 
-#: ../../../src/ui.cpp:1284
+#: ../../../src/ui.cpp:1515
 msgid " (yours, label: "
 msgstr " (tvoje, označení: "
 
-#: ../../../src/ui.cpp:1286
+#: ../../../src/ui.cpp:1517
 msgid " (yours)"
 msgstr " (tvoje)"
 
-#: ../../../src/ui.cpp:1323
-#: ../../../src/ui.cpp:1335
-#: ../../../src/ui.cpp:1381
-#: ../../../src/ui.cpp:1398
+#: ../../../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:1325
+#: ../../../src/ui.cpp:1556
 #, c-format
 msgid "(%s matures in %d more blocks)"
 msgstr "(%s dozraje po %d blocích)"
 
-#: ../../../src/ui.cpp:1327
+#: ../../../src/ui.cpp:1558
 msgid "(not accepted)"
 msgstr "(neakceptováno)"
 
-#: ../../../src/ui.cpp:1372
-#: ../../../src/ui.cpp:1380
-#: ../../../src/ui.cpp:1395
+#: ../../../src/ui.cpp:1603
+#: ../../../src/ui.cpp:1611
+#: ../../../src/ui.cpp:1626
 msgid "<b>Debit:</b> "
 msgstr "<b>Výdaj:</b> "
 
-#: ../../../src/ui.cpp:1386
+#: ../../../src/ui.cpp:1617
 msgid "<b>Transaction fee:</b> "
 msgstr "<b>Transakční poplatek:</b> "
 
-#: ../../../src/ui.cpp:1402
+#: ../../../src/ui.cpp:1633
 msgid "<b>Net amount:</b> "
 msgstr "<b>Čistá částka:</b> "
 
-#: ../../../src/ui.cpp:1409
+#: ../../../src/ui.cpp:1640
 msgid "Message:"
 msgstr "Zpráva:"
 
-#: ../../../src/ui.cpp:1411
+#: ../../../src/ui.cpp:1642
 msgid "Comment:"
 msgstr "Komentář:"
 
-#: ../../../src/ui.cpp:1414
+#: ../../../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:1594
+#: ../../../src/ui.cpp:1825
 msgid "Cannot write autostart/bitcoin.desktop file"
 msgstr "Nemohu zapisovat do souboru autostart/bitcoin.desktop"
 
-#: ../../../src/ui.cpp:1630
+#: ../../../src/ui.cpp:1861
 msgid "Main"
 msgstr "Hlavní"
 
-#: ../../../src/ui.cpp:1638
+#: ../../../src/ui.cpp:1871
 msgid "&Start Bitcoin on window system startup"
 msgstr "&Spustit Bitcoin při startu okenního systému"
 
-#: ../../../src/ui.cpp:1645
+#: ../../../src/ui.cpp:1878
 msgid "&Minimize on close"
 msgstr "&Zavřením pouze skrýt"
 
-#: ../../../src/ui.cpp:1787
+#: ../../../src/ui.cpp:2020
 #, c-format
 msgid "version %s"
 msgstr "verze %s"
 
-#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:2143
 msgid "Error in amount  "
 msgstr "Chyba v částce"
 
-#: ../../../src/ui.cpp:1899
-#: ../../../src/ui.cpp:1904
-#: ../../../src/ui.cpp:1909
-#: ../../../src/ui.cpp:1944
-#: ../../../src/uibase.cpp:55
-msgid "Send Coins"
-msgstr "Pošli mince"
-
-#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:2148
 msgid "Amount exceeds your balance  "
 msgstr "Částka překračuje stav účtu"
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2153
 msgid "Total exceeds your balance when the "
 msgstr "Celková částka přesahuje stav tvého účtu, když "
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2153
 msgid " transaction fee is included  "
 msgstr " transakční poplatek je zahrnut"
 
-#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:2176
 msgid "Payment sent  "
 msgstr "Platba odeslána"
 
-#: ../../../src/ui.cpp:1927
-#: ../../../src/ui.cpp:1932
-#: ../../../src/ui.cpp:2076
-#: ../../../src/ui.cpp:2229
-#: ../../../src/main.cpp:3997
-msgid "Sending..."
-msgstr "Posílám..."
-
-#: ../../../src/ui.cpp:1944
+#: ../../../src/ui.cpp:2202
 msgid "Invalid address  "
 msgstr "Neplatná adresa"
 
-#: ../../../src/ui.cpp:1997
+#: ../../../src/ui.cpp:2257
 #, c-format
 msgid "Sending %s to %s"
 msgstr "Posílám %s %s"
 
-#: ../../../src/ui.cpp:2070
-#: ../../../src/ui.cpp:2103
+#: ../../../src/ui.cpp:2330
+#: ../../../src/ui.cpp:2363
 msgid "CANCELLED"
 msgstr "ZRUŠENO"
 
-#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2334
 msgid "Cancelled"
 msgstr "Zrušeno"
 
-#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2336
 msgid "Transfer cancelled  "
 msgstr "Převod zrušen"
 
-#: ../../../src/ui.cpp:2129
+#: ../../../src/ui.cpp:2389
 msgid "Error: "
 msgstr "Chyba: "
 
-#: ../../../src/ui.cpp:2143
-#: ../../../src/ui.cpp:2214
-#: ../../../src/main.cpp:4016
-msgid "Insufficient funds"
-msgstr "Nedostatek peněz"
-
-#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2408
 msgid "Connecting..."
 msgstr "Připojuji..."
 
-#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2413
 msgid "Unable to connect"
 msgstr "Nemohu se připojit"
 
-#: ../../../src/ui.cpp:2158
+#: ../../../src/ui.cpp:2418
 msgid "Requesting public key..."
 msgstr "Požaduji veřejný klíč..."
 
-#: ../../../src/ui.cpp:2170
+#: ../../../src/ui.cpp:2430
 msgid "Received public key..."
 msgstr "Přijat veřejný klíč..."
 
-#: ../../../src/ui.cpp:2184
+#: ../../../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:2186
+#: ../../../src/ui.cpp:2446
 msgid "Transfer was not accepted"
 msgstr "Převod nebyl akceptován"
 
-#: ../../../src/ui.cpp:2195
+#: ../../../src/ui.cpp:2455
 msgid "Invalid response received"
 msgstr "Přišla neplatná odpověď"
 
-#: ../../../src/ui.cpp:2210
+#: ../../../src/ui.cpp:2470
 msgid "Creating transaction..."
 msgstr "Vytvářím transakci..."
 
-#: ../../../src/ui.cpp:2222
+#: ../../../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:2224
+#: ../../../src/ui.cpp:2491
 msgid "Transaction creation failed"
 msgstr "Vytvoření transakce selhalo"
 
-#: ../../../src/ui.cpp:2231
+#: ../../../src/ui.cpp:2502
 msgid "Transaction aborted"
 msgstr "Transakce zrušena"
 
-#: ../../../src/ui.cpp:2239
+#: ../../../src/ui.cpp:2510
 msgid "Lost connection, transaction cancelled"
 msgstr "Spojení se ztratilo, takže transakce byla zrušena"
 
-#: ../../../src/ui.cpp:2255
+#: ../../../src/ui.cpp:2526
 msgid "Sending payment..."
 msgstr "Posílám platbu..."
 
-#: ../../../src/ui.cpp:2261
+#: ../../../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:2270
+#: ../../../src/ui.cpp:2541
 msgid "Waiting for confirmation..."
 msgstr "Čekám na potvrzení..."
 
-#: ../../../src/ui.cpp:2288
+#: ../../../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"
@@ -385,518 +790,202 @@ msgstr ""
 "Transakce je zaznamenána a bude připsána příjemci,\n"
 "ale poznámka u platby bude prázdná."
 
-#: ../../../src/ui.cpp:2297
+#: ../../../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:2303
+#: ../../../src/ui.cpp:2574
 msgid "Payment completed"
 msgstr "Platba je kompletní"
 
-#: ../../../src/ui.cpp:2334
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2616
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2803
 msgid "Name"
 msgstr "Jméno"
 
-#: ../../../src/ui.cpp:2335
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2617
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2803
 msgid "Address"
 msgstr "Adresa"
 
-#: ../../../src/ui.cpp:2337
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2619
+#: ../../../src/ui.cpp:2775
 msgid "Label"
 msgstr "Označení"
 
-#: ../../../src/ui.cpp:2338
-#: ../../../src/uibase.cpp:837
-msgid "Bitcoin Address"
-msgstr "Bitcoinová adresa"
-
-#: ../../../src/ui.cpp:2462
+#: ../../../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:2480
-#: ../../../src/ui.cpp:2486
+#: ../../../src/ui.cpp:2763
+#: ../../../src/ui.cpp:2769
 msgid "Edit Address"
 msgstr "Upravit adresu"
 
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2775
 msgid "Edit Address Label"
 msgstr "Upravit označení adresy"
 
-#: ../../../src/ui.cpp:2517
-#: ../../../src/ui.cpp:2523
+#: ../../../src/ui.cpp:2803
+#: ../../../src/ui.cpp:2809
 msgid "Add Address"
 msgstr "Přidat adresu"
 
-#: ../../../src/ui.cpp:2600
+#: ../../../src/ui.cpp:2897
 msgid "Bitcoin"
 msgstr "Bitcoin"
 
-#: ../../../src/ui.cpp:2602
+#: ../../../src/ui.cpp:2899
 msgid "Bitcoin - Generating"
 msgstr "Bitcoin - Generování"
 
-#: ../../../src/ui.cpp:2604
+#: ../../../src/ui.cpp:2901
 msgid "Bitcoin - (not connected)"
 msgstr "Bitcoin - (nepřipojen)"
 
-#: ../../../src/ui.cpp:2683
+#: ../../../src/ui.cpp:2980
 msgid "&Open Bitcoin"
 msgstr "&Otevřít Bitcoin"
 
-#: ../../../src/ui.cpp:2684
+#: ../../../src/ui.cpp:2981
 msgid "&Send Bitcoins"
 msgstr "&Poslat Bitcoiny"
 
-#: ../../../src/ui.cpp:2685
+#: ../../../src/ui.cpp:2982
 msgid "O&ptions..."
 msgstr "&Možnosti..."
 
-#: ../../../src/ui.cpp:2688
-#: ../../../src/uibase.cpp:25
-msgid "E&xit"
-msgstr "&Konec"
-
-#: ../../../src/ui.cpp:2904
+#: ../../../src/ui.cpp:3211
 msgid "Program has crashed and will terminate.  "
 msgstr "Program havaroval a bude ukončen."
 
-#: ../../../src/main.cpp:1866
-msgid "Warning: Disk space is low  "
-msgstr "Upozornění: Na disku je málo místa"
-
-#: ../../../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 "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/main.cpp:3992
-msgid "Error: Transaction creation failed  "
-msgstr "Chyba: Vytvoření transakce selhalo"
-
-#: ../../../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 "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/main.cpp:4014
-msgid "Invalid amount"
-msgstr "Neplatná částka"
-
-#: ../../../src/main.cpp:4021
-msgid "Invalid bitcoin address"
-msgstr "Neplatná Bitcoinová adresa"
-
-#: ../../../src/rpc.cpp:1802
-#: ../../../src/rpc.cpp:1804
-#, c-format
-msgid "To use the %s option"
-msgstr "Pro použití volby %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 ""
-"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: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 ""
-"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: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 "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:899
-msgid "beta"
-msgstr "beta"
-
-#: ../../../src/uibase.cpp:28
-msgid "&File"
-msgstr "&Soubor"
-
-#: ../../../src/uibase.cpp:32
-msgid "&Your Receiving Addresses..."
-msgstr "Tvá Bitcoinová &adresa..."
-
-#: ../../../src/uibase.cpp:36
-msgid "&Options..."
-msgstr "M&ožnosti"
-
-#: ../../../src/uibase.cpp:39
-msgid "&Settings"
-msgstr "Nas&tavení"
-
-#: ../../../src/uibase.cpp:43
-msgid "&About..."
-msgstr "&O programu"
-
-#: ../../../src/uibase.cpp:46
-msgid "&Help"
-msgstr "&Nápověda"
-
-#: ../../../src/uibase.cpp:56
-msgid "Address Book"
-msgstr "Adresář"
-
-#: ../../../src/uibase.cpp:69
-msgid "Your Bitcoin Address:"
-msgstr "Tvá Bitcoinová adresa:"
-
-#: ../../../src/uibase.cpp:76
-msgid " &New... "
-msgstr " &Nová..."
-
-#: ../../../src/uibase.cpp:79
-#: ../../../src/uibase.cpp:780
-#: ../../../src/uibase.cpp:883
-msgid " &Copy to Clipboard "
-msgstr " &Kopírovat do schránky"
-
-#: ../../../src/uibase.cpp:93
-msgid "Balance:"
-msgstr "Stav účtu:"
-
-#: ../../../src/uibase.cpp:109
-msgid " All"
-msgstr " Vše"
-
-#: ../../../src/uibase.cpp:109
-msgid " Sent"
-msgstr " Odeslané"
-
-#: ../../../src/uibase.cpp:109
-msgid " Received"
-msgstr " Přijaté"
-
-#: ../../../src/uibase.cpp:109
-msgid " In Progress"
-msgstr " Pracuje se na tom"
-
-#: ../../../src/uibase.cpp:130
-msgid "All Transactions"
-msgstr "Všechny transakce"
-
-#: ../../../src/uibase.cpp:141
-msgid "Sent/Received"
-msgstr "Odeslané/Přijaté"
-
-#: ../../../src/uibase.cpp:152
-msgid "Sent"
-msgstr "Odeslané"
-
-#: ../../../src/uibase.cpp:163
-msgid "Received"
-msgstr "Přijaté"
-
-#: ../../../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 "&Budiž"
-
-#: ../../../src/uibase.cpp:345
-msgid "&Start Bitcoin on system startup"
-msgstr "&Spustit Bitcoin při startu systému"
-
-#: ../../../src/uibase.cpp:348
-msgid "&Minimize to the tray instead of the taskbar"
-msgstr "&Minimalizovávat do ikony v panelu"
-
-#: ../../../src/uibase.cpp:351
-msgid "Map port using &UPnP"
-msgstr "Namapovat port přes &UPnP"
-
-#: ../../../src/uibase.cpp:354
-msgid "M&inimize to the tray on close"
-msgstr "Zavřením &minimalizovat do ikony"
-
-#: ../../../src/uibase.cpp:360
-msgid "&Connect through socks4 proxy: "
-msgstr "&Připojit přes socks4 proxy:"
-
-#: ../../../src/uibase.cpp:371
-msgid "Proxy &IP:"
-msgstr "&IP adresa proxy:"
-
-#: ../../../src/uibase.cpp:379
-msgid " &Port:"
-msgstr " &Port:"
-
-#: ../../../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 "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:399
-msgid "Pay transaction fee:"
-msgstr "Výše transakčního poplatku:"
-
-#: ../../../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 "&Zrušit"
-
-#: ../../../src/uibase.cpp:449
-msgid "&Apply"
-msgstr "&Použít"
-
-#: ../../../src/uibase.cpp:508
-msgid "Bitcoin "
-msgstr "Bitcoin"
-
-#: ../../../src/uibase.cpp:514
-msgid "version"
-msgstr "verze"
-
-#: ../../../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 ""
-"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:581
-msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-msgstr "Vlož Bitcoinovou adresu (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-
-#: ../../../src/uibase.cpp:595
-msgid "Pay &To:"
-msgstr "&Komu:"
-
-#: ../../../src/uibase.cpp:610
-msgid "&Paste"
-msgstr "&Vložit"
-
-#: ../../../src/uibase.cpp:613
-msgid " Address &Book..."
-msgstr " &Adresář..."
-
-#: ../../../src/uibase.cpp:620
-msgid "&Amount:"
-msgstr "&Částka"
-
-#: ../../../src/uibase.cpp:630
-msgid "T&ransfer:"
-msgstr "&Převod:"
-
-#: ../../../src/uibase.cpp:636
-msgid " Standard"
-msgstr " Standard"
-
-#: ../../../src/uibase.cpp:663
-msgid "&Send"
-msgstr "&Poslat"
-
-#: ../../../src/uibase.cpp:711
-msgid ""
-"\n"
-"\n"
-"Connecting..."
-msgstr ""
-"\n"
-"\n"
-"Připojuji..."
-
-#: ../../../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 "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:774
-#: ../../../src/uibase.cpp:886
-msgid "&Edit..."
-msgstr "&Upravit..."
-
-#: ../../../src/uibase.cpp:777
-#: ../../../src/uibase.cpp:889
-msgid " &New Address... "
-msgstr " &Nová adresa..."
-
-#: ../../../src/uibase.cpp:849
-msgid "Sending"
-msgstr "Cizí adresy (pro odesílání)"
-
-#: ../../../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 "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:870
-msgid "Receiving"
-msgstr "Tvoje adresy (pro příjem)"
-
-#: ../../../src/uibase.cpp:880
-msgid "&Delete"
-msgstr "&Smazat"
-
-#: ../../../src/init.cpp:142
+#: ../../../src/init.cpp:163
 msgid "Bitcoin version"
 msgstr "Bitcoin verze"
 
-#: ../../../src/init.cpp:143
+#: ../../../src/init.cpp:164
 msgid "Usage:"
 msgstr "Užití:"
 
-#: ../../../src/init.cpp:145
+#: ../../../src/init.cpp:166
 msgid "Send command to -server or bitcoind\n"
 msgstr "Poslat příkaz pro -server nebo bitcoind\n"
 
-#: ../../../src/init.cpp:146
+#: ../../../src/init.cpp:167
 msgid "List commands\n"
 msgstr "Výpis příkazů\n"
 
-#: ../../../src/init.cpp:147
+#: ../../../src/init.cpp:168
 msgid "Get help for a command\n"
 msgstr "Získat nápovědu pro příkaz\n"
 
-#: ../../../src/init.cpp:148
+#: ../../../src/init.cpp:169
 msgid "Options:\n"
 msgstr "Možnosti:\n"
 
-#: ../../../src/init.cpp:149
+#: ../../../src/init.cpp:170
 msgid "Specify configuration file (default: bitcoin.conf)\n"
 msgstr "Konfigurační soubor (výchozí: bitcoin.conf)\n"
 
-#: ../../../src/init.cpp:150
+#: ../../../src/init.cpp:171
 msgid "Specify pid file (default: bitcoind.pid)\n"
 msgstr "PID soubor (výchozí: bitcoind.pid)\n"
 
-#: ../../../src/init.cpp:151
+#: ../../../src/init.cpp:172
 msgid "Generate coins\n"
 msgstr "Generovat mince\n"
 
-#: ../../../src/init.cpp:152
+#: ../../../src/init.cpp:173
 msgid "Don't generate coins\n"
 msgstr "Negenerovat mince\n"
 
-#: ../../../src/init.cpp:153
+#: ../../../src/init.cpp:174
 msgid "Start minimized\n"
 msgstr "Startovat minimalizovaně\n"
 
-#: ../../../src/init.cpp:154
+#: ../../../src/init.cpp:175
 msgid "Specify data directory\n"
 msgstr "Adresář pro data\n"
 
-#: ../../../src/init.cpp:155
+#: ../../../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:156
+#: ../../../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:157
+#: ../../../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:158
+#: ../../../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:159
+#: ../../../src/init.cpp:181
 msgid "Don't accept connections from outside\n"
 msgstr "Nepřijímat připojení zvenčí\n"
 
-#: ../../../src/init.cpp:162
+#: ../../../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:164
+#: ../../../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:167
+#: ../../../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:169
+#: ../../../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:172
+#: ../../../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:174
+#: ../../../src/init.cpp:196
 msgid "Use the test network\n"
 msgstr "Použít testovací síť\n"
 
-#: ../../../src/init.cpp:175
+#: ../../../src/init.cpp:197
 msgid "Username for JSON-RPC connections\n"
 msgstr "Uživatelské jméno pro JSON-RPC spojení\n"
 
-#: ../../../src/init.cpp:176
+#: ../../../src/init.cpp:198
 msgid "Password for JSON-RPC connections\n"
 msgstr "Heslo pro JSON-RPC spojení\n"
 
-#: ../../../src/init.cpp:177
+#: ../../../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:178
+#: ../../../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:179
+#: ../../../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:180
+#: ../../../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:181
+#: ../../../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:185
+#: ../../../src/init.cpp:207
 msgid ""
 "\n"
 "SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
@@ -904,68 +993,87 @@ msgstr ""
 "\n"
 "Možnosti SSL: (viz instrukce nastavení SSL v Bitcoin Wiki)\n"
 
-#: ../../../src/init.cpp:186
+#: ../../../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:187
+#: ../../../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:188
+#: ../../../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:189
+#: ../../../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:193
+#: ../../../src/init.cpp:215
 msgid "This help message\n"
 msgstr "Tato nápověda\n"
 
-#: ../../../src/init.cpp:330
+#: ../../../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:356
+#: ../../../src/init.cpp:379
 msgid "Error loading addr.dat      \n"
 msgstr "Chyba při načítání addr.dat      \n"
 
-#: ../../../src/init.cpp:362
+#: ../../../src/init.cpp:385
 msgid "Error loading blkindex.dat      \n"
 msgstr "Chyba při načítání blkindex.dat      \n"
 
-#: ../../../src/init.cpp:369
+#: ../../../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:449
+#: ../../../src/init.cpp:489
 msgid "Invalid -proxy address"
 msgstr "Neplatná -proxy adresa"
 
-#: ../../../src/init.cpp:472
+#: ../../../src/init.cpp:514
 msgid "Invalid amount for -paytxfee=<amount>"
 msgstr "Neplatná částka pro -paytxfee=<částka>"
 
-#: ../../../src/init.cpp:476
+#: ../../../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/uibase.h:147
+#: ../../../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:199
+#: ../../../src/uibase.h:203
 msgid "Options"
 msgstr "Možnosti"
 
-#: ../../../src/uibase.h:228
+#: ../../../src/uibase.h:232
 msgid "About Bitcoin"
 msgstr "O Bitcoinu"
 
-#: ../../../src/uibase.h:337
+#: ../../../src/uibase.h:341
 msgid "Your Bitcoin Addresses"
 msgstr "Tvá Bitcoinová adresa"
 
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "Neplatná Bitcoinová adresa"
index bcea1d3..bd03fd2 100644 (file)
Binary files a/locale/de/LC_MESSAGES/bitcoin.mo and b/locale/de/LC_MESSAGES/bitcoin.mo differ
index a0519f0..59381c1 100644 (file)
@@ -3,128 +3,436 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-05-15 18:18+0100\n"
-"PO-Revision-Date: 2011-05-26 22:34+0100\n"
-"Last-Translator: Jakob Kramer <censored@gmail.com>\n"
+"POT-Creation-Date: 2011-08-07 01:46+0100\n"
+"PO-Revision-Date: 2011-08-07 01:47+0100\n"
+"Last-Translator: Michael Bemmerl <mail@mx-server.de>\n"
 "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
-"Language: de\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"
 
-#: ../../../src/net.cpp:1499
+#: ../../../src/init.cpp:162
+msgid "Bitcoin version"
+msgstr "Bitcoin Version"
+
+#: ../../../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"
+
+#: ../../../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"
+
+#: ../../../src/init.cpp:172
+msgid "Don't generate coins\n"
+msgstr "Keine Münzen erzeugen\n"
+
+#: ../../../src/init.cpp:173
+msgid "Start minimized\n"
+msgstr "Minimiert starten\n"
+
+#: ../../../src/init.cpp:174
+msgid "Specify data directory\n"
+msgstr "Datenverzeichnis festlegen\n"
+
+#: ../../../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"
+
+#: ../../../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"
+
+#: ../../../src/init.cpp:179
+msgid "Connect only to the specified node\n"
+msgstr "Nur zu dem angegebenen Teilnehmer verbinden\n"
+
+#: ../../../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"
+
+#: ../../../src/init.cpp:352
+#, 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:378
+msgid "Error loading addr.dat      \n"
+msgstr "Fehler beim Laden von addr.dat      \n"
+
+#: ../../../src/init.cpp:384
+msgid "Error loading blkindex.dat      \n"
+msgstr "Fehler beim Laden von blkindex.dat      \n"
+
+#: ../../../src/init.cpp:395
+msgid "Error loading wallet.dat: Wallet corrupted      \n"
+msgstr "Fehler beim Laden von wallet.dat: Brieftasche beschädigt      \n"
+
+#: ../../../src/init.cpp:397
+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:399
+msgid "Error loading wallet.dat      \n"
+msgstr "Fehler beim Laden von wallet.dat      \n"
+
+#: ../../../src/init.cpp:488
+msgid "Invalid -proxy address"
+msgstr "Ungültige -Proxy Adresse"
+
+#: ../../../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."
+
+#: ../../../src/main.cpp:1427
+msgid "Warning: Disk space is low  "
+msgstr "Warnung: Festplatte fast voll  "
+
+#: ../../../src/net.cpp:1616
 #, c-format
 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."
 
-#: ../../../src/ui.cpp:202
+#: ../../../src/rpc.cpp:2086
+#: ../../../src/rpc.cpp:2088
+#, c-format
+msgid "To use the %s option"
+msgstr "Um die %s-Option zu nutzen"
+
+#: ../../../src/rpc.cpp:2090
+#, 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"
+
+#: ../../../src/rpc.cpp:2263
+#, 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."
+
+#: ../../../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?"
 
-#: ../../../src/ui.cpp:301
+#: ../../../src/ui.cpp:260
+#: ../../../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:261
+#: ../../../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:267
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Bitte geben Sie die derzeitige Passphrase zur Entschlüsselung der Brieftasche an."
+
+#: ../../../src/ui.cpp:275
+#: ../../../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:352
 msgid "Status"
 msgstr "Status"
 
-#: ../../../src/ui.cpp:302
+#: ../../../src/ui.cpp:353
 msgid "Date"
 msgstr "Datum"
 
-#: ../../../src/ui.cpp:303
+#: ../../../src/ui.cpp:354
 msgid "Description"
 msgstr "Beschreibung"
 
-#: ../../../src/ui.cpp:304
+#: ../../../src/ui.cpp:355
 msgid "Debit"
 msgstr "Belastungen"
 
-#: ../../../src/ui.cpp:305
+#: ../../../src/ui.cpp:356
 msgid "Credit"
 msgstr "Gutschriften"
 
-#: ../../../src/ui.cpp:511
+#: ../../../src/ui.cpp:567
 #, c-format
 msgid "Open for %d blocks"
 msgstr "Offen für %d Blöcke"
 
-#: ../../../src/ui.cpp:513
+#: ../../../src/ui.cpp:569
 #, c-format
 msgid "Open until %s"
 msgstr "Offen bis %s"
 
-#: ../../../src/ui.cpp:519
+#: ../../../src/ui.cpp:575
 #, c-format
 msgid "%d/offline?"
 msgstr "%d/Offline?"
 
-#: ../../../src/ui.cpp:521
+#: ../../../src/ui.cpp:577
 #, c-format
 msgid "%d/unconfirmed"
 msgstr "%d/nicht bestätigt"
 
-#: ../../../src/ui.cpp:523
+#: ../../../src/ui.cpp:579
 #, c-format
 msgid "%d confirmations"
 msgstr "%d Bestätigungen"
 
-#: ../../../src/ui.cpp:608
+#: ../../../src/ui.cpp:664
 msgid "Generated"
 msgstr "Erzeugt"
 
-#: ../../../src/ui.cpp:616
+#: ../../../src/ui.cpp:672
 #, c-format
 msgid "Generated (%s matures in %d more blocks)"
 msgstr "Erzeugt (%s reifen nach %d weiteren Blöcken)"
 
-#: ../../../src/ui.cpp:620
+#: ../../../src/ui.cpp:676
 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!"
 
-#: ../../../src/ui.cpp:624
+#: ../../../src/ui.cpp:680
 msgid "Generated (not accepted)"
 msgstr "Erzeugt (nicht akzeptiert)"
 
-#: ../../../src/ui.cpp:634
+#: ../../../src/ui.cpp:690
 msgid "From: "
 msgstr "Von: "
 
-#: ../../../src/ui.cpp:658
+#: ../../../src/ui.cpp:714
 msgid "Received with: "
 msgstr "Empfangen durch: "
 
-#: ../../../src/ui.cpp:704
+#: ../../../src/ui.cpp:759
 msgid "Payment to yourself"
 msgstr "Überweisung an Sie selbst"
 
-#: ../../../src/ui.cpp:738
+#: ../../../src/ui.cpp:793
 msgid "To: "
 msgstr "An: "
 
-#: ../../../src/ui.cpp:1053
+#: ../../../src/ui.cpp:1108
 msgid "    Generating"
 msgstr "    Erzeugen"
 
-#: ../../../src/ui.cpp:1055
+#: ../../../src/ui.cpp:1110
 msgid "(not connected)"
 msgstr "(nicht verbunden)"
 
-#: ../../../src/ui.cpp:1058
+#: ../../../src/ui.cpp:1113
 #, c-format
 msgid "     %d connections     %d blocks     %d transactions"
 msgstr "     %d Verbindungen     %d Blöcke     %d Überweisungen"
 
-#: ../../../src/ui.cpp:1163
-#: ../../../src/ui.cpp:2527
+#: ../../../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:2814
 msgid "New Receiving Address"
 msgstr "&Neue Empfangs-Adresse"
 
-#: ../../../src/ui.cpp:1164
-#: ../../../src/ui.cpp:2528
+#: ../../../src/ui.cpp:1382
+#: ../../../src/ui.cpp:2815
 msgid ""
 "You should use a new address for each payment you receive.\n"
 "\n"
@@ -134,248 +442,248 @@ msgstr ""
 "\n"
 "Beschreibung"
 
-#: ../../../src/ui.cpp:1233
+#: ../../../src/ui.cpp:1466
 msgid "<b>Status:</b> "
 msgstr "<b>Status:</b> "
 
-#: ../../../src/ui.cpp:1238
+#: ../../../src/ui.cpp:1471
 msgid ", has not been successfully broadcast yet"
 msgstr ", wurde noch nicht erfolgreich übertragen"
 
-#: ../../../src/ui.cpp:1240
+#: ../../../src/ui.cpp:1473
 #, c-format
 msgid ", broadcast through %d node"
 msgstr ", durch %d Teilnehmer übertragen"
 
-#: ../../../src/ui.cpp:1242
+#: ../../../src/ui.cpp:1475
 #, c-format
 msgid ", broadcast through %d nodes"
 msgstr ", durch %d Teilnehmer übertragen"
 
-#: ../../../src/ui.cpp:1246
+#: ../../../src/ui.cpp:1479
 msgid "<b>Date:</b> "
 msgstr "<b>Datum</b> "
 
-#: ../../../src/ui.cpp:1254
+#: ../../../src/ui.cpp:1487
 msgid "<b>Source:</b> Generated<br>"
 msgstr "<b>Quelle:</b> Erzeugt<br>"
 
-#: ../../../src/ui.cpp:1260
-#: ../../../src/ui.cpp:1278
+#: ../../../src/ui.cpp:1493
+#: ../../../src/ui.cpp:1510
 msgid "<b>From:</b> "
 msgstr "<b>Von:</b> "
 
-#: ../../../src/ui.cpp:1278
+#: ../../../src/ui.cpp:1510
 msgid "unknown"
 msgstr "Unbekannt"
 
-#: ../../../src/ui.cpp:1279
-#: ../../../src/ui.cpp:1303
-#: ../../../src/ui.cpp:1362
+#: ../../../src/ui.cpp:1511
+#: ../../../src/ui.cpp:1535
+#: ../../../src/ui.cpp:1594
 msgid "<b>To:</b> "
 msgstr "<b>An:</b> "
 
-#: ../../../src/ui.cpp:1282
+#: ../../../src/ui.cpp:1514
 msgid " (yours, label: "
 msgstr " (Eigene, Beschreibung: "
 
-#: ../../../src/ui.cpp:1284
+#: ../../../src/ui.cpp:1516
 msgid " (yours)"
 msgstr " (Eigene)"
 
-#: ../../../src/ui.cpp:1321
-#: ../../../src/ui.cpp:1333
-#: ../../../src/ui.cpp:1379
-#: ../../../src/ui.cpp:1396
+#: ../../../src/ui.cpp:1553
+#: ../../../src/ui.cpp:1565
+#: ../../../src/ui.cpp:1611
+#: ../../../src/ui.cpp:1628
 msgid "<b>Credit:</b> "
 msgstr "<b>Gutschrift:</b> "
 
-#: ../../../src/ui.cpp:1323
+#: ../../../src/ui.cpp:1555
 #, c-format
 msgid "(%s matures in %d more blocks)"
 msgstr "(%s reifen nach %d weiteren Blöcken)"
 
-#: ../../../src/ui.cpp:1325
+#: ../../../src/ui.cpp:1557
 msgid "(not accepted)"
 msgstr "(nicht akzeptiert)"
 
-#: ../../../src/ui.cpp:1370
-#: ../../../src/ui.cpp:1378
-#: ../../../src/ui.cpp:1393
+#: ../../../src/ui.cpp:1602
+#: ../../../src/ui.cpp:1610
+#: ../../../src/ui.cpp:1625
 msgid "<b>Debit:</b> "
 msgstr "<b>Belastung:</b> "
 
-#: ../../../src/ui.cpp:1384
+#: ../../../src/ui.cpp:1616
 msgid "<b>Transaction fee:</b> "
 msgstr "<b>Überweisungsgebühr:</b> "
 
-#: ../../../src/ui.cpp:1400
+#: ../../../src/ui.cpp:1632
 msgid "<b>Net amount:</b> "
 msgstr "<b>Nettobetrag:</b> "
 
-#: ../../../src/ui.cpp:1407
+#: ../../../src/ui.cpp:1639
 msgid "Message:"
 msgstr "Nachricht:"
 
-#: ../../../src/ui.cpp:1409
+#: ../../../src/ui.cpp:1641
 msgid "Comment:"
 msgstr "Kommentar:"
 
-#: ../../../src/ui.cpp:1412
+#: ../../../src/ui.cpp:1644
 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."
 
-#: ../../../src/ui.cpp:1592
+#: ../../../src/ui.cpp:1824
 msgid "Cannot write autostart/bitcoin.desktop file"
 msgstr "Kann Datei autostart/bitcoin.desktop nicht schreiben"
 
-#: ../../../src/ui.cpp:1628
+#: ../../../src/ui.cpp:1860
 msgid "Main"
 msgstr "Haupt"
 
-#: ../../../src/ui.cpp:1636
+#: ../../../src/ui.cpp:1870
 msgid "&Start Bitcoin on window system startup"
 msgstr "Bitcoin beim &Systemstart ausführen"
 
-#: ../../../src/ui.cpp:1643
+#: ../../../src/ui.cpp:1877
 msgid "&Minimize on close"
-msgstr "Beim schließen &Minimieren"
+msgstr "Beim Schließen &minimieren"
 
-#: ../../../src/ui.cpp:1785
+#: ../../../src/ui.cpp:2019
 #, c-format
 msgid "version %s"
-msgstr "version %s"
+msgstr "Version %s"
 
-#: ../../../src/ui.cpp:1897
+#: ../../../src/ui.cpp:2142
 msgid "Error in amount  "
 msgstr "Fehler in Betrag  "
 
-#: ../../../src/ui.cpp:1897
-#: ../../../src/ui.cpp:1902
-#: ../../../src/ui.cpp:1907
-#: ../../../src/ui.cpp:1942
-#: ../../../src/uibase.cpp:55
+#: ../../../src/ui.cpp:2142
+#: ../../../src/ui.cpp:2147
+#: ../../../src/ui.cpp:2152
+#: ../../../src/ui.cpp:2201
+#: ../../../src/uibase.cpp:61
 msgid "Send Coins"
 msgstr "Überweisen"
 
-#: ../../../src/ui.cpp:1902
+#: ../../../src/ui.cpp:2147
 msgid "Amount exceeds your balance  "
 msgstr "Der Betrag übersteigt Ihr Guthaben  "
 
-#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:2152
 msgid "Total exceeds your balance when the "
 msgstr "Der Betrag übersteigt Ihr Guthaben, wenn man die "
 
-#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:2152
 msgid " transaction fee is included  "
 msgstr " Überweisungsgebühr berücksichtigt  "
 
-#: ../../../src/ui.cpp:1925
+#: ../../../src/ui.cpp:2175
 msgid "Payment sent  "
 msgstr "Zahlung überwiesen  "
 
-#: ../../../src/ui.cpp:1925
-#: ../../../src/ui.cpp:1930
-#: ../../../src/ui.cpp:2074
-#: ../../../src/ui.cpp:2227
-#: ../../../src/main.cpp:3999
+#: ../../../src/ui.cpp:2175
+#: ../../../src/ui.cpp:2184
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2499
+#: ../../../src/wallet.cpp:1099
 msgid "Sending..."
 msgstr "Überweise ..."
 
-#: ../../../src/ui.cpp:1942
+#: ../../../src/ui.cpp:2201
 msgid "Invalid address  "
 msgstr "Ungültige Adresse  "
 
-#: ../../../src/ui.cpp:1995
+#: ../../../src/ui.cpp:2256
 #, c-format
 msgid "Sending %s to %s"
 msgstr "Überweise %s an %s"
 
-#: ../../../src/ui.cpp:2068
-#: ../../../src/ui.cpp:2101
+#: ../../../src/ui.cpp:2329
+#: ../../../src/ui.cpp:2362
 msgid "CANCELLED"
 msgstr "ANNULLIERT"
 
-#: ../../../src/ui.cpp:2072
+#: ../../../src/ui.cpp:2333
 msgid "Cancelled"
 msgstr "Annulliert"
 
-#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2335
 msgid "Transfer cancelled  "
 msgstr "Überweisung annulliert  "
 
-#: ../../../src/ui.cpp:2127
+#: ../../../src/ui.cpp:2388
 msgid "Error: "
 msgstr "Fehler: "
 
-#: ../../../src/ui.cpp:2141
-#: ../../../src/ui.cpp:2212
-#: ../../../src/main.cpp:4018
+#: ../../../src/ui.cpp:2402
+#: ../../../src/ui.cpp:2473
+#: ../../../src/wallet.cpp:1118
 msgid "Insufficient funds"
 msgstr "Unzureichende Geldmittel"
 
-#: ../../../src/ui.cpp:2146
+#: ../../../src/ui.cpp:2407
 msgid "Connecting..."
 msgstr "Verbinde ..."
 
-#: ../../../src/ui.cpp:2151
+#: ../../../src/ui.cpp:2412
 msgid "Unable to connect"
 msgstr "Kann nicht verbinden"
 
-#: ../../../src/ui.cpp:2156
+#: ../../../src/ui.cpp:2417
 msgid "Requesting public key..."
 msgstr "Fordere öffentlichen Schlüssel an ..."
 
-#: ../../../src/ui.cpp:2168
+#: ../../../src/ui.cpp:2429
 msgid "Received public key..."
 msgstr "Öffentlicher Schlüssel empfangen ..."
 
-#: ../../../src/ui.cpp:2182
+#: ../../../src/ui.cpp:2443
 msgid "Recipient is not accepting transactions sent by IP address"
 msgstr "Empfänger akzeptiert keine Überweisungen von IP-Adressen"
 
-#: ../../../src/ui.cpp:2184
+#: ../../../src/ui.cpp:2445
 msgid "Transfer was not accepted"
 msgstr "Überweisung wurde nicht akzeptiert"
 
-#: ../../../src/ui.cpp:2193
+#: ../../../src/ui.cpp:2454
 msgid "Invalid response received"
 msgstr "Ungültige Antwort erhalten"
 
-#: ../../../src/ui.cpp:2208
+#: ../../../src/ui.cpp:2469
 msgid "Creating transaction..."
 msgstr "Erstelle Überweisung ..."
 
-#: ../../../src/ui.cpp:2220
+#: ../../../src/ui.cpp:2488
 #, 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 "Diese Überweisung benötigt eine Überweisungsgebühr von mindestens %s wegen ihres Betrags, Komplexität oder der Benutzung kürzlich erhaltener Geldmittel"
 
-#: ../../../src/ui.cpp:2222
+#: ../../../src/ui.cpp:2490
 msgid "Transaction creation failed"
 msgstr "Überweisung konnte nicht erzeugt werden."
 
-#: ../../../src/ui.cpp:2229
+#: ../../../src/ui.cpp:2501
 msgid "Transaction aborted"
 msgstr "Überweisung abgebrochen"
 
-#: ../../../src/ui.cpp:2237
+#: ../../../src/ui.cpp:2509
 msgid "Lost connection, transaction cancelled"
 msgstr "Verbindung verloren, Überweisungsvorgang abgebrochen"
 
-#: ../../../src/ui.cpp:2253
+#: ../../../src/ui.cpp:2525
 msgid "Sending payment..."
 msgstr "Überweise Zahlung ..."
 
-#: ../../../src/ui.cpp:2259
+#: ../../../src/ui.cpp:2531
 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."
 
-#: ../../../src/ui.cpp:2268
+#: ../../../src/ui.cpp:2540
 msgid "Waiting for confirmation..."
 msgstr "Warte auf Bestätigung ..."
 
-#: ../../../src/ui.cpp:2286
+#: ../../../src/ui.cpp:2558
 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"
@@ -383,304 +691,251 @@ 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."
 
-#: ../../../src/ui.cpp:2295
+#: ../../../src/ui.cpp:2567
 msgid "Payment was sent, but an invalid response was received"
 msgstr "Die Zahlung wurde überwiesen, aber die Antwort war fehlerhaft"
 
-#: ../../../src/ui.cpp:2301
+#: ../../../src/ui.cpp:2573
 msgid "Payment completed"
 msgstr "Zahlung ausgeführt"
 
-#: ../../../src/ui.cpp:2332
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2615
+#: ../../../src/ui.cpp:2762
+#: ../../../src/ui.cpp:2802
 msgid "Name"
 msgstr "Name"
 
-#: ../../../src/ui.cpp:2333
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2616
+#: ../../../src/ui.cpp:2762
+#: ../../../src/ui.cpp:2802
 msgid "Address"
 msgstr "Adresse"
 
-#: ../../../src/ui.cpp:2335
-#: ../../../src/ui.cpp:2490
+#: ../../../src/ui.cpp:2618
+#: ../../../src/ui.cpp:2774
 msgid "Label"
 msgstr "Beschreibung"
 
-#: ../../../src/ui.cpp:2336
-#: ../../../src/uibase.cpp:837
+#: ../../../src/ui.cpp:2619
+#: ../../../src/uibase.cpp:847
 msgid "Bitcoin Address"
 msgstr "Bitcoin-Adresse"
 
-#: ../../../src/ui.cpp:2460
+#: ../../../src/ui.cpp:2744
 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.  "
 
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2484
+#: ../../../src/ui.cpp:2762
+#: ../../../src/ui.cpp:2768
 msgid "Edit Address"
 msgstr "Adresse bearbeiten"
 
-#: ../../../src/ui.cpp:2490
+#: ../../../src/ui.cpp:2774
 msgid "Edit Address Label"
 msgstr "Beschreibung der Adresse bearbeiten"
 
-#: ../../../src/ui.cpp:2515
-#: ../../../src/ui.cpp:2521
+#: ../../../src/ui.cpp:2802
+#: ../../../src/ui.cpp:2808
 msgid "Add Address"
 msgstr "Adresse hinzufügen"
 
-#: ../../../src/ui.cpp:2598
+#: ../../../src/ui.cpp:2896
 msgid "Bitcoin"
 msgstr "Bitcoin"
 
-#: ../../../src/ui.cpp:2600
+#: ../../../src/ui.cpp:2898
 msgid "Bitcoin - Generating"
 msgstr "Bitcoin - Erzeuge"
 
-#: ../../../src/ui.cpp:2602
+#: ../../../src/ui.cpp:2900
 msgid "Bitcoin - (not connected)"
 msgstr "Bitcoin - (nicht verbunden)"
 
-#: ../../../src/ui.cpp:2681
+#: ../../../src/ui.cpp:2979
 msgid "&Open Bitcoin"
-msgstr "Bitcoin Ö&ffnen"
+msgstr "Bitcoin ö&ffnen"
 
-#: ../../../src/ui.cpp:2682
+#: ../../../src/ui.cpp:2980
 msgid "&Send Bitcoins"
 msgstr "Bitcoins &senden"
 
-#: ../../../src/ui.cpp:2683
+#: ../../../src/ui.cpp:2981
 msgid "O&ptions..."
 msgstr "O&ptionen ..."
 
-#: ../../../src/ui.cpp:2686
+#: ../../../src/ui.cpp:2984
 #: ../../../src/uibase.cpp:25
 msgid "E&xit"
 msgstr "B&eenden"
 
-#: ../../../src/ui.cpp:2902
+#: ../../../src/ui.cpp:3210
 msgid "Program has crashed and will terminate.  "
 msgstr "Das Programm ist abgestürzt und wird beendet.  "
 
-#: ../../../src/main.cpp:1868
-msgid "Warning: Disk space is low  "
-msgstr "Warnung: Festplatte fast voll  "
-
-#: ../../../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 "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/main.cpp:3994
-msgid "Error: Transaction creation failed  "
-msgstr "Fehler: Überweisung konnte nicht erzeugt werden.  "
-
-#: ../../../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 "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/main.cpp:4016
-msgid "Invalid amount"
-msgstr "Ungültiger Betrag"
-
-#: ../../../src/main.cpp:4023
-msgid "Invalid bitcoin address"
-msgstr "Ungültige Bitcoin-Adresse"
-
-#: ../../../src/rpc.cpp:1800
-#: ../../../src/rpc.cpp:1802
-#, c-format
-msgid "To use the %s option"
-msgstr "Um die %s Option zu nutzen"
-
-#: ../../../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 ""
-"Warnung: %s, Sie müssen rpcpassword=<password> einstellen\n"
-"in der Konfigurationsdatei: %s\n"
-"Wenn die Datei nicht existiert, erstellen Sie sie mit ausschließlich Besitzer-Leserechten.\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 ""
-"Sie müssen rpcpassword=<password> in der Konfigurationsdatei einstellen:\n"
-"%s\n"
-"Wenn die Datei nicht existiert, erstellen Sie sie mit ausschließlich Besitzer-Leserechten."
-
-#: ../../../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 "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:898
-msgid "beta"
-msgstr "Beta"
-
 #: ../../../src/uibase.cpp:28
 msgid "&File"
 msgstr "&Datei"
 
 #: ../../../src/uibase.cpp:32
 msgid "&Your Receiving Addresses..."
-msgstr "&Ihre Empfangs-Adressen ..."
+msgstr "&Ihre Empfangs-Adressen..."
+
+#: ../../../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:36
+#: ../../../src/uibase.cpp:42
 msgid "&Options..."
-msgstr "&Optionen ..."
+msgstr "&Optionen..."
 
-#: ../../../src/uibase.cpp:39
+#: ../../../src/uibase.cpp:45
 msgid "&Settings"
 msgstr "&Einstellungen"
 
-#: ../../../src/uibase.cpp:43
+#: ../../../src/uibase.cpp:49
 msgid "&About..."
 msgstr "Ü&ber..."
 
-#: ../../../src/uibase.cpp:46
+#: ../../../src/uibase.cpp:52
 msgid "&Help"
 msgstr "&Hilfe"
 
-#: ../../../src/uibase.cpp:56
+#: ../../../src/uibase.cpp:62
 msgid "Address Book"
 msgstr "Adressbuch"
 
-#: ../../../src/uibase.cpp:69
+#: ../../../src/uibase.cpp:75
 msgid "Your Bitcoin Address:"
 msgstr "Ihre Bitcoin-Adresse:"
 
-#: ../../../src/uibase.cpp:76
+#: ../../../src/uibase.cpp:82
 msgid " &New... "
-msgstr " &Neu ... "
+msgstr " &Neu... "
 
-#: ../../../src/uibase.cpp:79
-#: ../../../src/uibase.cpp:780
-#: ../../../src/uibase.cpp:883
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
 msgid " &Copy to Clipboard "
 msgstr " In die Zwischenablage &kopieren "
 
-#: ../../../src/uibase.cpp:93
+#: ../../../src/uibase.cpp:99
 msgid "Balance:"
 msgstr "Kontostand:"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " All"
 msgstr " Alle"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Sent"
 msgstr " Überwiesen"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Received"
 msgstr " Erhalten"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " In Progress"
 msgstr " In Bearbeitung"
 
-#: ../../../src/uibase.cpp:130
+#: ../../../src/uibase.cpp:136
 msgid "All Transactions"
 msgstr "Alle Überweisungen"
 
-#: ../../../src/uibase.cpp:141
+#: ../../../src/uibase.cpp:147
 msgid "Sent/Received"
 msgstr "Überwiesen/Erhalten"
 
-#: ../../../src/uibase.cpp:152
+#: ../../../src/uibase.cpp:158
 msgid "Sent"
 msgstr "Überwiesen"
 
-#: ../../../src/uibase.cpp:163
+#: ../../../src/uibase.cpp:169
 msgid "Received"
 msgstr "Erhalten"
 
-#: ../../../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
+#: ../../../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:345
+#: ../../../src/uibase.cpp:355
 msgid "&Start Bitcoin on system startup"
 msgstr "Bitcoin beim &Systemstart ausführen"
 
-#: ../../../src/uibase.cpp:348
+#: ../../../src/uibase.cpp:358
 msgid "&Minimize to the tray instead of the taskbar"
 msgstr "In den Infobereich statt in die Taskleiste &minimieren"
 
-#: ../../../src/uibase.cpp:351
+#: ../../../src/uibase.cpp:361
 msgid "Map port using &UPnP"
 msgstr "Portweiterleitung via &UPnP"
 
-#: ../../../src/uibase.cpp:354
+#: ../../../src/uibase.cpp:364
 msgid "M&inimize to the tray on close"
 msgstr "Beim Schließen in den Infobereich m&inimieren"
 
-#: ../../../src/uibase.cpp:360
-msgid "&Connect through socks4 proxy: "
-msgstr "&Per Socks4-Proxy verbinden: "
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "&Per Socks4-Proxy verbinden (erfordert einen Neustart): "
 
-#: ../../../src/uibase.cpp:371
+#: ../../../src/uibase.cpp:381
 msgid "Proxy &IP:"
-msgstr "Proxy &IP:"
+msgstr "Proxy-&IP:"
 
-#: ../../../src/uibase.cpp:379
+#: ../../../src/uibase.cpp:389
 msgid " &Port:"
 msgstr " &Port:"
 
-#: ../../../src/uibase.cpp:392
+#: ../../../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:399
+#: ../../../src/uibase.cpp:409
 msgid "Pay transaction fee:"
 msgstr "Überweisungsgebühr:"
 
-#: ../../../src/uibase.cpp:420
+#: ../../../src/uibase.cpp:430
 msgid "// [don't translate] Test panel 2 for future expansion"
 msgstr ""
 
-#: ../../../src/uibase.cpp:424
+#: ../../../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:446
-#: ../../../src/uibase.cpp:668
-#: ../../../src/uibase.cpp:727
-#: ../../../src/uibase.cpp:786
-#: ../../../src/uibase.cpp:895
-#: ../../../src/uibase.cpp:984
+#: ../../../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"
 
-#: ../../../src/uibase.cpp:449
+#: ../../../src/uibase.cpp:459
 msgid "&Apply"
 msgstr "&Anwenden"
 
-#: ../../../src/uibase.cpp:508
+#: ../../../src/uibase.cpp:518
 msgid "Bitcoin "
 msgstr "Bitcoin "
 
-#: ../../../src/uibase.cpp:514
+#: ../../../src/uibase.cpp:524
 msgid "version"
 msgstr "Version"
 
-#: ../../../src/uibase.cpp:525
+#: ../../../src/uibase.cpp:535
 msgid ""
 "Copyright (c) 2009-2011 Bitcoin Developers\n"
 "\n"
@@ -705,39 +960,39 @@ msgstr ""
 "kryptographische Software von Eric Young (eay@cryptsoft.com)\n"
 "und UPnP-Software, entwickelt von Thomas Bernard."
 
-#: ../../../src/uibase.cpp:581
+#: ../../../src/uibase.cpp:591
 msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 msgstr "Geben Sie eine Bitcoin-Adresse ein (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 
-#: ../../../src/uibase.cpp:595
+#: ../../../src/uibase.cpp:605
 msgid "Pay &To:"
 msgstr "Überweisen &An:"
 
-#: ../../../src/uibase.cpp:610
+#: ../../../src/uibase.cpp:620
 msgid "&Paste"
 msgstr "&Einfügen"
 
-#: ../../../src/uibase.cpp:613
+#: ../../../src/uibase.cpp:623
 msgid " Address &Book..."
 msgstr " Address&buch..."
 
-#: ../../../src/uibase.cpp:620
+#: ../../../src/uibase.cpp:630
 msgid "&Amount:"
 msgstr "&Betrag:"
 
-#: ../../../src/uibase.cpp:630
+#: ../../../src/uibase.cpp:640
 msgid "T&ransfer:"
 msgstr "Ü&berweisung:"
 
-#: ../../../src/uibase.cpp:636
+#: ../../../src/uibase.cpp:646
 msgid " Standard"
 msgstr " Standard"
 
-#: ../../../src/uibase.cpp:663
+#: ../../../src/uibase.cpp:673
 msgid "&Send"
 msgstr "Ü&berweisen"
 
-#: ../../../src/uibase.cpp:711
+#: ../../../src/uibase.cpp:721
 msgid ""
 "\n"
 "\n"
@@ -747,229 +1002,80 @@ msgstr ""
 "\n"
 "Verbinde ..."
 
-#: ../../../src/uibase.cpp:761
+#: ../../../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."
 
-#: ../../../src/uibase.cpp:774
-#: ../../../src/uibase.cpp:886
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
 msgid "&Edit..."
-msgstr "&Bearbeiten ..."
+msgstr "&Bearbeiten..."
 
-#: ../../../src/uibase.cpp:777
-#: ../../../src/uibase.cpp:889
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
 msgid " &New Address... "
-msgstr " &Neue Adresse ... "
+msgstr " &Neue Adresse... "
 
-#: ../../../src/uibase.cpp:849
+#: ../../../src/uibase.cpp:859
 msgid "Sending"
 msgstr "Überweise"
 
-#: ../../../src/uibase.cpp:857
+#: ../../../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."
 
-#: ../../../src/uibase.cpp:870
+#: ../../../src/uibase.cpp:880
 msgid "Receiving"
 msgstr "Empfange"
 
-#: ../../../src/uibase.cpp:880
+#: ../../../src/uibase.cpp:890
 msgid "&Delete"
 msgstr "&Löschen"
 
-#: ../../../src/init.cpp:147
-msgid "Bitcoin version"
-msgstr "Bitcoin "
-
-#: ../../../src/init.cpp:148
-msgid "Usage:"
-msgstr "Benutz:"
-
-#: ../../../src/init.cpp:150
-msgid "Send command to -server or bitcoind\n"
-msgstr "Sende Befehl zu -server oder bitcoind\n"
-
-#: ../../../src/init.cpp:151
-msgid "List commands\n"
-msgstr "Liste Befehle auf\n"
-
-#: ../../../src/init.cpp:152
-msgid "Get help for a command\n"
-msgstr "Hilfe für einen Befehl erhalten\n"
-
-#: ../../../src/init.cpp:153
-msgid "Options:\n"
-msgstr "Optionen:\n"
-
-#: ../../../src/init.cpp:154
-msgid "Specify configuration file (default: bitcoin.conf)\n"
-msgstr "Konfigurationsdatei bestimmen (Standard: bitcoin.conf)\n"
-
-#: ../../../src/init.cpp:155
-msgid "Specify pid file (default: bitcoind.pid)\n"
-msgstr "pid-Datei bestimmen (Standard: bitcoind.pid)\n"
-
-#: ../../../src/init.cpp:156
-msgid "Generate coins\n"
-msgstr "Münzen erzeugen\n"
-
-#: ../../../src/init.cpp:157
-msgid "Don't generate coins\n"
-msgstr "Keine Münzen erzeugen\n"
-
-#: ../../../src/init.cpp:158
-msgid "Start minimized\n"
-msgstr "Minimiert starten\n"
-
-#: ../../../src/init.cpp:159
-msgid "Specify data directory\n"
-msgstr "Datenverzeichnis festlegen\n"
-
-#: ../../../src/init.cpp:160
-msgid "Connect through socks4 proxy\n"
-msgstr "Socks4-Proxy verwenden\n"
-
-#: ../../../src/init.cpp:161
-msgid "Specify connection timeout (in milliseconds)\n"
-msgstr "Verbindungs-Timeout in Milisekunden\n"
-
-#: ../../../src/init.cpp:161
-msgid "Allow DNS lookups for addnode and connect\n"
-msgstr "DNS-Auflösung für addnode und connect erlauben\n"
-
-#: ../../../src/init.cpp:162
-msgid "Add a node to connect to\n"
-msgstr "Einen Teilnehmer hinzufügen, zu dem verbunden werden soll\n"
-
-#: ../../../src/init.cpp:163
-msgid "Connect only to the specified node\n"
-msgstr "Nur zu dem angegebenen Teilnehmer verbinden\n"
-
-#: ../../../src/init.cpp:164
-msgid "Don't accept connections from outside\n"
-msgstr "Akzeptiere keine externen Verbindungen\n"
-
-#: ../../../src/init.cpp:167
-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:169
-msgid "Attempt to use UPnP to map the listening port\n"
-msgstr "Versuche, UPnP zur Portweiterleitung zu nutzen\n"
-
-#: ../../../src/init.cpp:172
-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:174
-msgid "Accept command line and JSON-RPC commands\n"
-msgstr "Akzeptiere Kommandozeile und JSON-RPC-Befehle\n"
-
-#: ../../../src/init.cpp:177
-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:179
-msgid "Use the test network\n"
-msgstr "Nutze das Testnetzwerk\n"
-
-#: ../../../src/init.cpp:180
-msgid "Username for JSON-RPC connections\n"
-msgstr "Benutzername für JSON-RPC-Verbindungen\n"
-
-#: ../../../src/init.cpp:181
-msgid "Password for JSON-RPC connections\n"
-msgstr "Passwort für JSON-RPC-Verbindungen\n"
-
-#: ../../../src/init.cpp:182
-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:183
-msgid "Allow JSON-RPC connections from specified IP address\n"
-msgstr "Erlaube JSON-RPC-Verbindungen von bestimmter IP-Adresse\n"
-
-#: ../../../src/init.cpp:184
-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:185
-msgid "Set key pool size to <n> (default: 100)\n"
-msgstr "Setze Key-Pool-Größe auf <n> (Standard: 100)\n"
-
-#: ../../../src/init.cpp:186
-msgid "Rescan the block chain for missing wallet transactions\n"
-msgstr "Frage die Block-Kette nach fehlenden Brieftaschen-Überweisungen ab\n"
-
-#: ../../../src/init.cpp:190
-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:191
-msgid "Use OpenSSL (https) for JSON-RPC connections\n"
-msgstr "Nutze OpenSSL (https) für JSON-RPC-Verbindungen\n"
-
-#: ../../../src/init.cpp:192
-msgid "Server certificate file (default: server.cert)\n"
-msgstr "Server-Zertifikatsdatei (Standard: server.cert)\n"
+#: ../../../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/init.cpp:193
-msgid "Server private key (default: server.pem)\n"
-msgstr "Server-Geheimschlüssel (Standard: server.pem)\n"
+#: ../../../src/util.cpp:903
+msgid "beta"
+msgstr "Beta"
 
-#: ../../../src/init.cpp:194
-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/wallet.cpp:1083
+msgid "Error: Wallet locked, unable to create transaction  "
+msgstr "Fehler: Brieftasche ist verschlossen; Überweisung konnte nicht erstellt werden  "
 
-#: ../../../src/init.cpp:198
-msgid "This help message\n"
-msgstr "Diese Anleitung\n"
-
-#: ../../../src/init.cpp:335
+#: ../../../src/wallet.cpp:1091
 #, c-format
-msgid "Cannot obtain a lock on data directory %s.  Bitcoin is probably already running."
-msgstr "Erhalte keinen Lock für Datenverzeichnis %s. Bitcoin läuft wahrscheinlich bereits."
-
-#: ../../../src/init.cpp:361
-msgid "Error loading addr.dat      \n"
-msgstr "Fehler beim Laden von addr.dat      \n"
-
-#: ../../../src/init.cpp:367
-msgid "Error loading blkindex.dat      \n"
-msgstr "Fehler beim Laden von blkindex.dat      \n"
-
-#: ../../../src/init.cpp:374
-msgid "Error loading wallet.dat      \n"
-msgstr "Fehler beim Laden von wallet.dat      \n"
+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/init.cpp:454
-msgid "Invalid -proxy address"
-msgstr "Ungültige -Proxy Adresse"
+#: ../../../src/wallet.cpp:1093
+msgid "Error: Transaction creation failed  "
+msgstr "Fehler: Überweisung konnte nicht erzeugt werden.  "
 
-#: ../../../src/init.cpp:477
-msgid "Invalid amount for -paytxfee=<amount>"
-msgstr "Ungültiger Betrag für -paytxfee=<amount>"
+#: ../../../src/wallet.cpp:1103
+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/init.cpp:481
-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ürs Senden einer Überweisung zahlen."
+#: ../../../src/wallet.cpp:1116
+msgid "Invalid amount"
+msgstr "Ungültiger Betrag"
 
-#: ../../../src/uibase.h:147
+#: ../../../src/uibase.h:151
 msgid "Transaction Details"
 msgstr "Überweisungsdetails"
 
-#: ../../../src/uibase.h:199
+#: ../../../src/uibase.h:203
 msgid "Options"
 msgstr "Optionen"
 
-#: ../../../src/uibase.h:228
+#: ../../../src/uibase.h:232
 msgid "About Bitcoin"
 msgstr "Über Bitcoin"
 
-#: ../../../src/uibase.h:337
+#: ../../../src/uibase.h:341
 msgid "Your Bitcoin Addresses"
 msgstr "Ihre Bitcoin-Adressen"
+
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "Ungültige Bitcoin-Adresse"
index c67886e..1787c48 100644 (file)
@@ -2,126 +2,433 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \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"
+"POT-Creation-Date: 2011-09-06 21:58+0100\n"
+"PO-Revision-Date: 2011-09-06 22:19+0100\n"
+"Last-Translator: Alex B <paraipanakos@gmail.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"
+"Language: \n"
 "X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
 "X-Poedit-Basepath: .\n"
 "X-Poedit-SearchPath-0: ../../..\n"
 
-#: ../../../src/net.cpp:1503
+#: ../../../src/init.cpp:163
+msgid "Bitcoin version"
+msgstr "versión Bitcoin"
+
+#: ../../../src/init.cpp:164
+msgid "Usage:"
+msgstr "Uso:"
+
+#: ../../../src/init.cpp:166
+msgid "Send command to -server or bitcoind\n"
+msgstr "Envia comando a bitcoin lanzado con -server u bitcoind\n"
+
+#: ../../../src/init.cpp:167
+msgid "List commands\n"
+msgstr "Muestra comandos\n"
+
+#: ../../../src/init.cpp:168
+msgid "Get help for a command\n"
+msgstr "Recibir ayuda para un comando\n"
+
+#: ../../../src/init.cpp:169
+msgid "Options:\n"
+msgstr "Opciones:\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Especifica archivo de configuración (predeterminado: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:171
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Especifica archivo pid (predeterminado: bitcoin.pid)\n"
+
+#: ../../../src/init.cpp:172
+msgid "Generate coins\n"
+msgstr "Genera monedas\n"
+
+#: ../../../src/init.cpp:173
+msgid "Don't generate coins\n"
+msgstr "No generar monedas\n"
+
+#: ../../../src/init.cpp:174
+msgid "Start minimized\n"
+msgstr "Arranca minimizado\n"
+
+#: ../../../src/init.cpp:175
+msgid "Specify data directory\n"
+msgstr "Especifica directorio para los datos\n"
+
+#: ../../../src/init.cpp:176
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Especifica tiempo de espera para conexion (en milisegundos)\n"
+
+#: ../../../src/init.cpp:177
+msgid "Connect through socks4 proxy\n"
+msgstr "Conecta mediante proxy socks4\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Permite búsqueda DNS para addnode y connect\n"
+
+#: ../../../src/init.cpp:179
+msgid "Add a node to connect to\n"
+msgstr "Agrega un nodo para conectarse\n"
+
+#: ../../../src/init.cpp:180
+msgid "Connect only to the specified node\n"
+msgstr "Conecta solo al nodo especificado\n"
+
+#: ../../../src/init.cpp:181
+msgid "Don't accept connections from outside\n"
+msgstr "No aceptar conexiones desde el exterior\n"
+
+#: ../../../src/init.cpp:184
+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:186
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Intenta usar UPnP para mapear el puerto de escucha.\n"
+
+#: ../../../src/init.cpp:189
+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:191
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Aceptar comandos consola y JSON-RPC\n"
+
+#: ../../../src/init.cpp:194
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Correr como demonio y acepta comandos\n"
+
+#: ../../../src/init.cpp:196
+msgid "Use the test network\n"
+msgstr "Usa la red de pruebas\n"
+
+#: ../../../src/init.cpp:197
+msgid "Username for JSON-RPC connections\n"
+msgstr "Usuario para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:198
+msgid "Password for JSON-RPC connections\n"
+msgstr "Contraseña para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:199
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Escucha conexiones JSON-RPC en el puerto <port> (predeterminado: 8332)\n"
+
+#: ../../../src/init.cpp:200
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Permite conexiones JSON-RPC desde la dirección IP especificada\n"
+
+#: ../../../src/init.cpp:201
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Envia comando al nodo situado en <ip> (predeterminado: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:202
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Ajusta el numero de claves en reserva <n> (predeterminado: 100)\n"
+
+#: ../../../src/init.cpp:203
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Rescanea la cadena de bloques para transacciones perdidas de la cartera\n"
+
+#: ../../../src/init.cpp:207
+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:208
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Usa OpenSSL (https) para las conexiones JSON-RPC\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Archivo de certificado del servidor (Predeterminado: server.cert)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Server private key (default: server.pem)\n"
+msgstr "Clave privada del servidor (Predeterminado: server.pem)\n"
+
+#: ../../../src/init.cpp:211
+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:215
+msgid "This help message\n"
+msgstr "Este mensaje de ayuda\n"
+
+#: ../../../src/init.cpp:353
+#, c-format
+msgid "Cannot obtain a lock on data directory %s.  Bitcoin is probably already running."
+msgstr "No se puede obtener permiso de trabajo en la carpeta de datos %s. Probablemente Bitcoin ya se está ejecutando."
+
+#: ../../../src/init.cpp:379
+msgid "Error loading addr.dat      \n"
+msgstr "Error cargando addr.dat      \n"
+
+#: ../../../src/init.cpp:385
+msgid "Error loading blkindex.dat      \n"
+msgstr "Error cargando blkindex.dat      \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet corrupted      \n"
+msgstr "Error cargando wallet.dat: Cartera dañada      \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin      \n"
+msgstr "Error cargando el archivo wallet.dat: Se necesita una versión mas nueva de Bitcoin      \n"
+
+#: ../../../src/init.cpp:400
+msgid "Error loading wallet.dat      \n"
+msgstr "Error cargando wallet.dat      \n"
+
+#: ../../../src/init.cpp:489
+msgid "Invalid -proxy address"
+msgstr "Dirección -proxy no valida"
+
+#: ../../../src/init.cpp:514
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Cantidad inválida para -paytxfee=<amount>"
+
+#: ../../../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 "Precaución: -paytxfee es muy alta. Esta es la comisión que pagarás si envias una transacción."
+
+#: ../../../src/main.cpp:1398
+msgid "Warning: Disk space is low  "
+msgstr "Cuidado: Poco espacio en el disco duro"
+
+#: ../../../src/net.cpp:1610
 #, c-format
 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."
+msgstr "No es posible escuchar en el puerto %d en este ordenador. Probablemente Bitcoin ya se está ejecutando."
 
-#: ../../../src/ui.cpp:204
+#: ../../../src/rpc.cpp:2005
+#: ../../../src/rpc.cpp:2007
+#, c-format
+msgid "To use the %s option"
+msgstr "Para usar la opción %s"
+
+#: ../../../src/rpc.cpp:2009
+#, 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:2185
+#, 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/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 "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?"
+msgstr "Esta transacción supera el límite. Puedes seguir enviandola incluyendo una comisión de %s que se va a repartir entre los nodos que procesan su transacción y ayudan a mantener la red. ¿Quieres seguir con la transacción?"
+
+#: ../../../src/ui.cpp:261
+#: ../../../src/ui.cpp:1247
+msgid "Enter the current passphrase to the wallet."
+msgstr "Introduce la contraseña actual de la cartera."
 
-#: ../../../src/ui.cpp:303
+#: ../../../src/ui.cpp:262
+#: ../../../src/ui.cpp:1183
+#: ../../../src/ui.cpp:1200
+#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1272
+#: ../../../src/ui.cpp:1292
+msgid "Passphrase"
+msgstr "Contraseña"
+
+#: ../../../src/ui.cpp:268
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Por favor introduce la contraseña actual de la cartera."
+
+#: ../../../src/ui.cpp:276
+#: ../../../src/ui.cpp:1257
+#: ../../../src/ui.cpp:1314
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "La contraseña introducida para decriptar la cartera es incorrecta."
+
+#: ../../../src/ui.cpp:353
 msgid "Status"
 msgstr "Estado"
 
-#: ../../../src/ui.cpp:304
+#: ../../../src/ui.cpp:354
 msgid "Date"
 msgstr "Fecha"
 
-#: ../../../src/ui.cpp:305
+#: ../../../src/ui.cpp:355
 msgid "Description"
 msgstr "Descripción"
 
-#: ../../../src/ui.cpp:306
+#: ../../../src/ui.cpp:356
 msgid "Debit"
 msgstr "Débito"
 
-#: ../../../src/ui.cpp:307
+#: ../../../src/ui.cpp:357
 msgid "Credit"
 msgstr "Crédito"
 
-#: ../../../src/ui.cpp:513
+#: ../../../src/ui.cpp:568
 #, c-format
 msgid "Open for %d blocks"
 msgstr "Abrir para %d bloques"
 
-#: ../../../src/ui.cpp:515
+#: ../../../src/ui.cpp:570
 #, c-format
 msgid "Open until %s"
 msgstr "Abrir hasta %s"
 
-#: ../../../src/ui.cpp:521
+#: ../../../src/ui.cpp:576
 #, c-format
 msgid "%d/offline?"
 msgstr "%d/desconectado?"
 
-#: ../../../src/ui.cpp:523
+#: ../../../src/ui.cpp:578
 #, c-format
 msgid "%d/unconfirmed"
 msgstr "%d/no confirmado"
 
-#: ../../../src/ui.cpp:525
+#: ../../../src/ui.cpp:580
 #, c-format
 msgid "%d confirmations"
 msgstr "%d confirmaciones"
 
-#: ../../../src/ui.cpp:610
+#: ../../../src/ui.cpp:665
 msgid "Generated"
 msgstr "Generado"
 
-#: ../../../src/ui.cpp:618
+#: ../../../src/ui.cpp:673
 #, c-format
 msgid "Generated (%s matures in %d more blocks)"
 msgstr "Generado (%s madura en %d bloques)"
 
-#: ../../../src/ui.cpp:622
+#: ../../../src/ui.cpp:677
 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 recibió de otros nodos y probablemente no sea aceptado!"
 
-#: ../../../src/ui.cpp:626
+#: ../../../src/ui.cpp:681
 msgid "Generated (not accepted)"
 msgstr "Generado (no aceptado)"
 
-#: ../../../src/ui.cpp:636
+#: ../../../src/ui.cpp:691
 msgid "From: "
 msgstr "De: "
 
-#: ../../../src/ui.cpp:660
+#: ../../../src/ui.cpp:715
 msgid "Received with: "
 msgstr "Recibido con: "
 
-#: ../../../src/ui.cpp:706
+#: ../../../src/ui.cpp:760
 msgid "Payment to yourself"
-msgstr "Pago para usted mismo"
+msgstr "Pago a ti mismo"
 
-#: ../../../src/ui.cpp:740
+#: ../../../src/ui.cpp:794
 msgid "To: "
 msgstr "Para: "
 
-#: ../../../src/ui.cpp:1055
+#: ../../../src/ui.cpp:1109
 msgid "    Generating"
 msgstr "    Generando"
 
-#: ../../../src/ui.cpp:1057
+#: ../../../src/ui.cpp:1111
 msgid "(not connected)"
 msgstr "(no conectado)"
 
-#: ../../../src/ui.cpp:1060
+#: ../../../src/ui.cpp:1114
 #, c-format
 msgid "     %d connections     %d blocks     %d transactions"
 msgstr "     %d conexiones     %d bloques     %d transacciones"
 
-#: ../../../src/ui.cpp:1165
-#: ../../../src/ui.cpp:2529
+#: ../../../src/ui.cpp:1171
+msgid "Wallet already encrypted."
+msgstr "La cartera ya esta encriptada."
+
+#: ../../../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 ""
+"Introduce la nueva contraseña de cartera.\n"
+"Por favor utiliza un contraseña de 10 o mas caracteres aleatorios, u ocho o mas palabras."
+
+#: ../../../src/ui.cpp:1189
+#: ../../../src/ui.cpp:1280
+msgid "Error: The supplied passphrase was too short."
+msgstr "Error: La contraseña introducida es demasiado corta."
+
+#: ../../../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 ""
+"ATENCION: ¡Si encriptas tu cartera y pierdes la contraseña perderas TODOS TUS BITCOINS!\n"
+"¿Seguro que quieres seguir encriptando la cartera?"
+
+#: ../../../src/ui.cpp:1199
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Por favor vuelve introducir la nueva contraseña."
+
+#: ../../../src/ui.cpp:1208
+#: ../../../src/ui.cpp:1302
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Error: las contraseñas no son identicas."
+
+#: ../../../src/ui.cpp:1218
+msgid "Wallet encryption failed."
+msgstr "Encriptacion de cartera fallida."
+
+#: ../../../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 ""
+"Cartera Encriptada.\n"
+"Recuerda que encriptando tu cartera no garantiza mantener a salvo tus bitcoins en caso de tener viruses en el ordenador."
+
+#: ../../../src/ui.cpp:1236
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Cartera no encriptada, intenta encriptar primero."
+
+#: ../../../src/ui.cpp:1271
+msgid "Enter the new passphrase for the wallet."
+msgstr "Introduce la nueva contraseña para la cartera."
+
+#: ../../../src/ui.cpp:1291
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Reintroduce la nueva contraseña para la cartera."
+
+#: ../../../src/ui.cpp:1323
+msgid "Wallet Passphrase Changed."
+msgstr "Contraseña de cartera cambiada."
+
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:2825
 msgid "New Receiving Address"
 msgstr "Nueva dirección de recepción"
 
-#: ../../../src/ui.cpp:1166
-#: ../../../src/ui.cpp:2530
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:2826
 msgid ""
 "You should use a new address for each payment you receive.\n"
 "\n"
@@ -131,399 +438,338 @@ msgstr ""
 "\n"
 "Etiqueta"
 
-#: ../../../src/ui.cpp:1235
+#: ../../../src/ui.cpp:1464
 msgid "<b>Status:</b> "
 msgstr "<b>Estado:</b> "
 
-#: ../../../src/ui.cpp:1240
+#: ../../../src/ui.cpp:1469
 msgid ", has not been successfully broadcast yet"
 msgstr ", no ha sido emitido satisfactoriamente todavía"
 
-#: ../../../src/ui.cpp:1242
+#: ../../../src/ui.cpp:1471
 #, c-format
 msgid ", broadcast through %d node"
 msgstr ", emitido mediante %d nodo"
 
-#: ../../../src/ui.cpp:1244
+#: ../../../src/ui.cpp:1473
 #, c-format
 msgid ", broadcast through %d nodes"
 msgstr ", emitido mediante %d nodos"
 
-#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1477
 msgid "<b>Date:</b> "
 msgstr "<b>Fecha:</b> "
 
-#: ../../../src/ui.cpp:1256
+#: ../../../src/ui.cpp:1485
 msgid "<b>Source:</b> Generated<br>"
 msgstr "<b>Fuente:</b> Generado<br>"
 
-#: ../../../src/ui.cpp:1262
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1491
+#: ../../../src/ui.cpp:1508
 msgid "<b>From:</b> "
 msgstr "<b>De:</b> "
 
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1508
 msgid "unknown"
 msgstr "desconocido"
 
-#: ../../../src/ui.cpp:1281
-#: ../../../src/ui.cpp:1305
-#: ../../../src/ui.cpp:1364
+#: ../../../src/ui.cpp:1509
+#: ../../../src/ui.cpp:1533
+#: ../../../src/ui.cpp:1592
 msgid "<b>To:</b> "
 msgstr "<b>Para:</b> "
 
-#: ../../../src/ui.cpp:1284
+#: ../../../src/ui.cpp:1512
 msgid " (yours, label: "
-msgstr "(suya, etiqueta: "
+msgstr "(tuya, etiqueta: "
 
-#: ../../../src/ui.cpp:1286
+#: ../../../src/ui.cpp:1514
 msgid " (yours)"
-msgstr "(suya)"
+msgstr "(tuya)"
 
-#: ../../../src/ui.cpp:1323
-#: ../../../src/ui.cpp:1335
-#: ../../../src/ui.cpp:1381
-#: ../../../src/ui.cpp:1398
+#: ../../../src/ui.cpp:1551
+#: ../../../src/ui.cpp:1563
+#: ../../../src/ui.cpp:1609
+#: ../../../src/ui.cpp:1626
 msgid "<b>Credit:</b> "
 msgstr "<b>Crédito:</b> "
 
-#: ../../../src/ui.cpp:1325
+#: ../../../src/ui.cpp:1553
 #, c-format
 msgid "(%s matures in %d more blocks)"
 msgstr "(%s madura en %d bloques)"
 
-#: ../../../src/ui.cpp:1327
+#: ../../../src/ui.cpp:1555
 msgid "(not accepted)"
 msgstr "(no aceptada)"
 
-#: ../../../src/ui.cpp:1372
-#: ../../../src/ui.cpp:1380
-#: ../../../src/ui.cpp:1395
+#: ../../../src/ui.cpp:1600
+#: ../../../src/ui.cpp:1608
+#: ../../../src/ui.cpp:1623
 msgid "<b>Debit:</b> "
 msgstr "<b>Débito:</b> "
 
-#: ../../../src/ui.cpp:1386
+#: ../../../src/ui.cpp:1614
 msgid "<b>Transaction fee:</b> "
 msgstr "<b>Comisión transacción:</b> "
 
-#: ../../../src/ui.cpp:1402
+#: ../../../src/ui.cpp:1630
 msgid "<b>Net amount:</b> "
-msgstr "<b>Cantidad de la red:</b> "
+msgstr "<b>Cantidad total:</b> "
 
-#: ../../../src/ui.cpp:1409
+#: ../../../src/ui.cpp:1637
 msgid "Message:"
 msgstr "Mensaje:"
 
-#: ../../../src/ui.cpp:1411
+#: ../../../src/ui.cpp:1639
 msgid "Comment:"
 msgstr "Comentario:"
 
-#: ../../../src/ui.cpp:1414
+#: ../../../src/ui.cpp:1642
 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 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."
+msgstr "Las monedas generadas deben esperar 120 bloques antes de ser gastadas. Cuando has generado este bloque se emitió a la red para ser agregado en la cadena de bloques. Si falla al incluirse en la cadena, cambiará a \"no aceptado\" y no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque casi al mismo tiempo que el tuyo."
 
-#: ../../../src/ui.cpp:1594
+#: ../../../src/ui.cpp:1826
 msgid "Cannot write autostart/bitcoin.desktop file"
 msgstr "No se puede escribir el fichero autostart/bitcoin.desktop"
 
-#: ../../../src/ui.cpp:1630
+#: ../../../src/ui.cpp:1862
 msgid "Main"
 msgstr "Principal"
 
-#: ../../../src/ui.cpp:1638
+#: ../../../src/ui.cpp:1872
 msgid "&Start Bitcoin on window system startup"
-msgstr "&Arrancar Bitcoin al iniciar el sistema"
+msgstr "&Arranca Bitcoin al iniciar el sistema"
 
-#: ../../../src/ui.cpp:1645
+#: ../../../src/ui.cpp:1879
 msgid "&Minimize on close"
-msgstr "&Minimizar al cerrar"
+msgstr "&Minimiza al cerrar"
 
-#: ../../../src/ui.cpp:1787
+#: ../../../src/ui.cpp:2021
 #, c-format
 msgid "version %s"
 msgstr "versión %s"
 
-#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:2144
 msgid "Error in amount  "
 msgstr "Error en la cantidad  "
 
-#: ../../../src/ui.cpp:1899
-#: ../../../src/ui.cpp:1904
-#: ../../../src/ui.cpp:1909
-#: ../../../src/ui.cpp:1944
-#: ../../../src/uibase.cpp:55
+#: ../../../src/ui.cpp:2144
+#: ../../../src/ui.cpp:2149
+#: ../../../src/ui.cpp:2154
+#: ../../../src/ui.cpp:2207
+#: ../../../src/uibase.cpp:61
 msgid "Send Coins"
-msgstr "Enviar monedas"
+msgstr "Envia monedas"
 
-#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:2149
 msgid "Amount exceeds your balance  "
 msgstr "La cantidad excede su balance  "
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2154
 msgid "Total exceeds your balance when the "
 msgstr "El total excede su balance cuando el "
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2154
 msgid " transaction fee is included  "
-msgstr " la comisión de la transaccion está incluida  "
+msgstr " la comisión de la transacción está incluida "
 
-#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:2181
 msgid "Payment sent  "
 msgstr "Pago enviado  "
 
-#: ../../../src/ui.cpp:1927
-#: ../../../src/ui.cpp:1932
-#: ../../../src/ui.cpp:2076
-#: ../../../src/ui.cpp:2229
-#: ../../../src/main.cpp:3997
+#: ../../../src/ui.cpp:2181
+#: ../../../src/ui.cpp:2191
+#: ../../../src/ui.cpp:2341
+#: ../../../src/ui.cpp:2506
+#: ../../../src/wallet.cpp:1088
 msgid "Sending..."
 msgstr "Enviando..."
 
-#: ../../../src/ui.cpp:1944
+#: ../../../src/ui.cpp:2207
 msgid "Invalid address  "
 msgstr "Dirección inválida  "
 
-#: ../../../src/ui.cpp:1997
+#: ../../../src/ui.cpp:2262
 #, c-format
 msgid "Sending %s to %s"
 msgstr "Enviando %s a %s"
 
-#: ../../../src/ui.cpp:2070
-#: ../../../src/ui.cpp:2103
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2368
 msgid "CANCELLED"
 msgstr "CANCELADO"
 
-#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2339
 msgid "Cancelled"
 msgstr "Cancelado"
 
-#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2341
 msgid "Transfer cancelled  "
 msgstr "Transferencia cancelada  "
 
-#: ../../../src/ui.cpp:2129
+#: ../../../src/ui.cpp:2394
 msgid "Error: "
 msgstr "Error: "
 
-#: ../../../src/ui.cpp:2143
-#: ../../../src/ui.cpp:2214
-#: ../../../src/main.cpp:4016
+#: ../../../src/ui.cpp:2408
+#: ../../../src/ui.cpp:2477
+#: ../../../src/wallet.cpp:1106
 msgid "Insufficient funds"
 msgstr "Fondos insuficientes"
 
-#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2413
 msgid "Connecting..."
 msgstr "Conectando..."
 
-#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2418
 msgid "Unable to connect"
 msgstr "No es posible conectar"
 
-#: ../../../src/ui.cpp:2158
+#: ../../../src/ui.cpp:2423
 msgid "Requesting public key..."
 msgstr "Pidiendo clave pública..."
 
-#: ../../../src/ui.cpp:2170
+#: ../../../src/ui.cpp:2435
 msgid "Received public key..."
 msgstr "Clave pública recibida..."
 
-#: ../../../src/ui.cpp:2184
+#: ../../../src/ui.cpp:2449
 msgid "Recipient is not accepting transactions sent by IP address"
-msgstr "El destinatario no está aceptando transacciones enviadas por direcciones IP"
+msgstr "El destinatario no accepta transacciones enviadas a direcciones IP"
 
-#: ../../../src/ui.cpp:2186
+#: ../../../src/ui.cpp:2451
 msgid "Transfer was not accepted"
 msgstr "La transferencia no fue aceptada"
 
-#: ../../../src/ui.cpp:2195
+#: ../../../src/ui.cpp:2460
 msgid "Invalid response received"
 msgstr "Respuesta inválida recibida"
 
-#: ../../../src/ui.cpp:2210
+#: ../../../src/ui.cpp:2473
 msgid "Creating transaction..."
 msgstr "Creando transacción..."
 
-#: ../../../src/ui.cpp:2222
+#: ../../../src/ui.cpp:2496
 #, 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 "Esta transacción requiere de una comisión de al menos %s por su cantidad, complejidad o uso de fondos recibidos recientemente"
+msgstr "Esta transacción requiere una comisión de al menos %s por su cantidad, complejidad o uso de fondos recibidos recientemente"
 
-#: ../../../src/ui.cpp:2224
+#: ../../../src/ui.cpp:2498
 msgid "Transaction creation failed"
 msgstr "Fallo al crear la transacción."
 
-#: ../../../src/ui.cpp:2231
+#: ../../../src/ui.cpp:2508
 msgid "Transaction aborted"
 msgstr "Transacción abortada"
 
-#: ../../../src/ui.cpp:2239
+#: ../../../src/ui.cpp:2516
 msgid "Lost connection, transaction cancelled"
 msgstr "Conexión perdida, transacción cancelada"
 
-#: ../../../src/ui.cpp:2255
+#: ../../../src/ui.cpp:2532
 msgid "Sending payment..."
 msgstr "Enviando pago..."
 
-#: ../../../src/ui.cpp:2261
+#: ../../../src/ui.cpp:2544
 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 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."
+msgstr "La transacción fue rechazada. Esto puede haber ocurrido si alguna de las monedas ya estaba gastada o si ha usado una copia de wallet.dat y las monedas se gastaron en la copia pero no se han marcado como gastadas aqui."
 
-#: ../../../src/ui.cpp:2270
+#: ../../../src/ui.cpp:2553
 msgid "Waiting for confirmation..."
 msgstr "Esperando confirmación..."
 
-#: ../../../src/ui.cpp:2288
+#: ../../../src/ui.cpp:2570
 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 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."
+"El pago se ha enviado, pero el receptor no pudo verificarlo.\n"
+"La transacción se grabó y el saldo fue transferido\n"
+"pero la información de los comentarios quedará en blanco."
 
-#: ../../../src/ui.cpp:2297
+#: ../../../src/ui.cpp:2579
 msgid "Payment was sent, but an invalid response was received"
 msgstr "El pago fue enviado, pero se recibió una respuesta inválida"
 
-#: ../../../src/ui.cpp:2303
+#: ../../../src/ui.cpp:2585
 msgid "Payment completed"
 msgstr "Pago completado"
 
-#: ../../../src/ui.cpp:2334
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2627
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
 msgid "Name"
 msgstr "Nombre"
 
-#: ../../../src/ui.cpp:2335
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2628
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
 msgid "Address"
 msgstr "Dirección"
 
-#: ../../../src/ui.cpp:2337
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2630
+#: ../../../src/ui.cpp:2785
 msgid "Label"
 msgstr "Etiqueta"
 
-#: ../../../src/ui.cpp:2338
-#: ../../../src/uibase.cpp:837
+#: ../../../src/ui.cpp:2631
+#: ../../../src/uibase.cpp:847
 msgid "Bitcoin Address"
 msgstr "Dirección Bitcoin"
 
-#: ../../../src/ui.cpp:2462
+#: ../../../src/ui.cpp:2755
 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.  "
 
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2486
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2779
 msgid "Edit Address"
 msgstr "Editar dirección"
 
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2785
 msgid "Edit Address Label"
 msgstr "Editar etiqueta dirección"
 
-#: ../../../src/ui.cpp:2517
-#: ../../../src/ui.cpp:2523
+#: ../../../src/ui.cpp:2813
+#: ../../../src/ui.cpp:2819
 msgid "Add Address"
 msgstr "Agregar dirección"
 
-#: ../../../src/ui.cpp:2600
+#: ../../../src/ui.cpp:2906
 msgid "Bitcoin"
 msgstr "Bitcoin"
 
-#: ../../../src/ui.cpp:2602
+#: ../../../src/ui.cpp:2908
 msgid "Bitcoin - Generating"
 msgstr "Bitcoin - Generando"
 
-#: ../../../src/ui.cpp:2604
+#: ../../../src/ui.cpp:2910
 msgid "Bitcoin - (not connected)"
 msgstr "Bitcoin - (no conectado)"
 
-#: ../../../src/ui.cpp:2683
+#: ../../../src/ui.cpp:2989
 msgid "&Open Bitcoin"
 msgstr "&Abrir Bitcoin"
 
-#: ../../../src/ui.cpp:2684
+#: ../../../src/ui.cpp:2990
 msgid "&Send Bitcoins"
 msgstr "&Enviar Bitcoin"
 
-#: ../../../src/ui.cpp:2685
+#: ../../../src/ui.cpp:2991
 msgid "O&ptions..."
 msgstr "O&pciones"
 
-#: ../../../src/ui.cpp:2688
+#: ../../../src/ui.cpp:2994
 #: ../../../src/uibase.cpp:25
 msgid "E&xit"
 msgstr "S&alir"
 
-#: ../../../src/ui.cpp:2904
+#: ../../../src/ui.cpp:3220
 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"
@@ -532,152 +778,160 @@ msgstr "&Archivo"
 msgid "&Your Receiving Addresses..."
 msgstr "&Tus direcciones de recepción..."
 
-#: ../../../src/uibase.cpp:36
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "&Encriptar cartera..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "&Cambiar contraseña de cartera..."
+
+#: ../../../src/uibase.cpp:42
 msgid "&Options..."
 msgstr "&Opciones..."
 
-#: ../../../src/uibase.cpp:39
+#: ../../../src/uibase.cpp:45
 msgid "&Settings"
 msgstr "&Configuración"
 
-#: ../../../src/uibase.cpp:43
+#: ../../../src/uibase.cpp:49
 msgid "&About..."
 msgstr "&Acerca de..."
 
-#: ../../../src/uibase.cpp:46
+#: ../../../src/uibase.cpp:52
 msgid "&Help"
 msgstr "&Ayuda"
 
-#: ../../../src/uibase.cpp:56
+#: ../../../src/uibase.cpp:62
 msgid "Address Book"
 msgstr "Libreta de direcciones"
 
-#: ../../../src/uibase.cpp:69
+#: ../../../src/uibase.cpp:75
 msgid "Your Bitcoin Address:"
 msgstr "Su dirección Bitcoin:"
 
-#: ../../../src/uibase.cpp:76
+#: ../../../src/uibase.cpp:82
 msgid " &New... "
 msgstr " &Nuevo... "
 
-#: ../../../src/uibase.cpp:79
-#: ../../../src/uibase.cpp:780
-#: ../../../src/uibase.cpp:883
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
 msgid " &Copy to Clipboard "
 msgstr " &Copiar al portapapeles "
 
-#: ../../../src/uibase.cpp:93
+#: ../../../src/uibase.cpp:99
 msgid "Balance:"
 msgstr "Balance:"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " All"
 msgstr " Todo"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Sent"
 msgstr " Enviado"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Received"
 msgstr " Recibido"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " In Progress"
 msgstr " En progreso"
 
-#: ../../../src/uibase.cpp:130
+#: ../../../src/uibase.cpp:136
 msgid "All Transactions"
 msgstr "Todas las transacciones"
 
-#: ../../../src/uibase.cpp:141
+#: ../../../src/uibase.cpp:147
 msgid "Sent/Received"
 msgstr "Enviado/Recibido"
 
-#: ../../../src/uibase.cpp:152
+#: ../../../src/uibase.cpp:158
 msgid "Sent"
 msgstr "Enviado"
 
-#: ../../../src/uibase.cpp:163
+#: ../../../src/uibase.cpp:169
 msgid "Received"
 msgstr "Recibido"
 
-#: ../../../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
+#: ../../../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:345
+#: ../../../src/uibase.cpp:355
 msgid "&Start Bitcoin on system startup"
-msgstr "&Arrancar Bitcoin al iniciar el sistema"
+msgstr "&Arranca Bitcoin al iniciar el sistema"
 
-#: ../../../src/uibase.cpp:348
+#: ../../../src/uibase.cpp:358
 msgid "&Minimize to the tray instead of the taskbar"
-msgstr "&Minimizar a la bandeja en vez de a la barra de tareas"
+msgstr "&Minimiza a la bandeja en vez de a la barra de tareas"
 
-#: ../../../src/uibase.cpp:351
+#: ../../../src/uibase.cpp:361
 msgid "Map port using &UPnP"
-msgstr "Mapear el puerto usando &UPnP"
+msgstr "Mapea el puerto usando &UPnP"
 
-#: ../../../src/uibase.cpp:354
+#: ../../../src/uibase.cpp:364
 msgid "M&inimize to the tray on close"
-msgstr "M&inimizar a la bandeja al cerrar"
+msgstr "M&inimiza a la bandeja al cerrar"
 
-#: ../../../src/uibase.cpp:360
-msgid "&Connect through socks4 proxy: "
-msgstr "&Conectar usando un proxy socks4: "
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "&Conecta usando un proxy socks4 (necesita reinicio): "
 
-#: ../../../src/uibase.cpp:371
+#: ../../../src/uibase.cpp:381
 msgid "Proxy &IP:"
-msgstr "Proxy &IP:"
+msgstr "&IP proxy:"
 
-#: ../../../src/uibase.cpp:379
+#: ../../../src/uibase.cpp:389
 msgid " &Port:"
 msgstr " &Puerto:"
 
-#: ../../../src/uibase.cpp:392
+#: ../../../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 "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
+#: ../../../src/uibase.cpp:409
 msgid "Pay transaction fee:"
 msgstr "Comisión de la transacción:"
 
-#: ../../../src/uibase.cpp:420
+#: ../../../src/uibase.cpp:430
 msgid "// [don't translate] Test panel 2 for future expansion"
 msgstr ""
 
-#: ../../../src/uibase.cpp:424
+#: ../../../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:446
-#: ../../../src/uibase.cpp:668
-#: ../../../src/uibase.cpp:727
-#: ../../../src/uibase.cpp:786
-#: ../../../src/uibase.cpp:895
-#: ../../../src/uibase.cpp:984
+#: ../../../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 "Cancelar"
 
-#: ../../../src/uibase.cpp:449
+#: ../../../src/uibase.cpp:459
 msgid "&Apply"
 msgstr "&Aplicar"
 
-#: ../../../src/uibase.cpp:508
+#: ../../../src/uibase.cpp:518
 msgid "Bitcoin "
 msgstr "Bitcoin "
 
-#: ../../../src/uibase.cpp:514
+#: ../../../src/uibase.cpp:524
 msgid "version"
 msgstr "versión"
 
-#: ../../../src/uibase.cpp:525
+#: ../../../src/uibase.cpp:535
 msgid ""
 "Copyright (c) 2009-2011 Bitcoin Developers\n"
 "\n"
@@ -701,39 +955,39 @@ msgstr ""
 "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."
 
-#: ../../../src/uibase.cpp:581
+#: ../../../src/uibase.cpp:591
 msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
-msgstr "Ponga una dirección Bitcoin (ejemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Introduce una dirección Bitcoin (ejemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 
-#: ../../../src/uibase.cpp:595
+#: ../../../src/uibase.cpp:605
 msgid "Pay &To:"
 msgstr "Pagar &A:"
 
-#: ../../../src/uibase.cpp:610
+#: ../../../src/uibase.cpp:620
 msgid "&Paste"
 msgstr "&Pegar"
 
-#: ../../../src/uibase.cpp:613
+#: ../../../src/uibase.cpp:623
 msgid " Address &Book..."
 msgstr " Libreta &Direcciones..."
 
-#: ../../../src/uibase.cpp:620
+#: ../../../src/uibase.cpp:630
 msgid "&Amount:"
 msgstr "&Cantidad:"
 
-#: ../../../src/uibase.cpp:630
+#: ../../../src/uibase.cpp:640
 msgid "T&ransfer:"
 msgstr "T&ransferir:"
 
-#: ../../../src/uibase.cpp:636
+#: ../../../src/uibase.cpp:646
 msgid " Standard"
 msgstr " Estándar"
 
-#: ../../../src/uibase.cpp:663
+#: ../../../src/uibase.cpp:673
 msgid "&Send"
-msgstr "&Enviar"
+msgstr "&Envia"
 
-#: ../../../src/uibase.cpp:711
+#: ../../../src/uibase.cpp:721
 msgid ""
 "\n"
 "\n"
@@ -743,225 +997,80 @@ msgstr ""
 "\n"
 "Conenctando..."
 
-#: ../../../src/uibase.cpp:761
+#: ../../../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 "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."
 
-#: ../../../src/uibase.cpp:774
-#: ../../../src/uibase.cpp:886
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
 msgid "&Edit..."
-msgstr "&Editar..."
+msgstr "&Edita..."
 
-#: ../../../src/uibase.cpp:777
-#: ../../../src/uibase.cpp:889
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
 msgid " &New Address... "
 msgstr " &Nueva dirección... "
 
-#: ../../../src/uibase.cpp:849
+#: ../../../src/uibase.cpp:859
 msgid "Sending"
 msgstr "Enviando"
 
-#: ../../../src/uibase.cpp:857
+#: ../../../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 "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."
 
-#: ../../../src/uibase.cpp:870
+#: ../../../src/uibase.cpp:880
 msgid "Receiving"
 msgstr "Recibiendo"
 
-#: ../../../src/uibase.cpp:880
+#: ../../../src/uibase.cpp:890
 msgid "&Delete"
-msgstr "&Borrar"
-
-#: ../../../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"
+msgstr "&Borra"
 
-#: ../../../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/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 "Precaución: Por favor revisa que la fecha y hora de tu ordenador son correctas. Si tu reloj está mal Bitcoin no funcionará correctamente."
 
-#: ../../../src/init.cpp:188
-msgid "Server private key (default: server.pem)\n"
-msgstr "Clave privada del servidor (Predeterminado: server.pem)\n"
+#: ../../../src/util.cpp:904
+msgid "beta"
+msgstr "beta"
 
-#: ../../../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/wallet.cpp:1073
+msgid "Error: Wallet locked, unable to create transaction  "
+msgstr "Error: Cartera bloqueada, no se puede crear la transacción"
 
-#: ../../../src/init.cpp:193
-msgid "This help message\n"
-msgstr "Este mensaje de ayuda\n"
-
-#: ../../../src/init.cpp:330
+#: ../../../src/wallet.cpp:1081
 #, 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"
+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/init.cpp:449
-msgid "Invalid -proxy address"
-msgstr "Dirección proxy - inválida"
+#: ../../../src/wallet.cpp:1083
+msgid "Error: Transaction creation failed  "
+msgstr "Error: La creación de la transacción falló  "
 
-#: ../../../src/init.cpp:472
-msgid "Invalid amount for -paytxfee=<amount>"
-msgstr "Cantidad inválida para -paytxfee=<cantidad>"
+#: ../../../src/wallet.cpp:1092
+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 estaba gastada o si ha usado una copia de wallet.dat y las monedas se gastaron en la copia pero no se han marcado como gastadas aqui."
 
-#: ../../../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/wallet.cpp:1104
+msgid "Invalid amount"
+msgstr "Cantidad erronea"
 
-#: ../../../src/uibase.h:147
+#: ../../../src/uibase.h:151
 msgid "Transaction Details"
 msgstr "Detalles de la transacción"
 
-#: ../../../src/uibase.h:199
+#: ../../../src/uibase.h:203
 msgid "Options"
 msgstr "Opciones"
 
-#: ../../../src/uibase.h:228
+#: ../../../src/uibase.h:232
 msgid "About Bitcoin"
 msgstr "Acerca de Bitcoin"
 
-#: ../../../src/uibase.h:337
+#: ../../../src/uibase.h:341
 msgid "Your Bitcoin Addresses"
 msgstr "Sus direcciones Bitcoin"
+
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "Dirección Bitcoin inválida"
index f4d669b..f60e15b 100644 (file)
Binary files a/locale/fr/LC_MESSAGES/bitcoin.mo and b/locale/fr/LC_MESSAGES/bitcoin.mo differ
index c5ae848..13467f2 100644 (file)
Binary files a/locale/nl/LC_MESSAGES/bitcoin.mo and b/locale/nl/LC_MESSAGES/bitcoin.mo differ
index 97216ad..5074f21 100644 (file)
@@ -2,9 +2,9 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \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"
+"POT-Creation-Date: 2011-09-22 19:03+0100\n"
+"PO-Revision-Date: 2011-09-22 19:19+0100\n"
+"Last-Translator: Pieter Wuille <pieter.wuille@gmail.com>\n"
 "Language-Team: \n"
 "Language: \n"
 "MIME-Version: 1.0\n"
@@ -12,116 +12,488 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
 "X-Poedit-Basepath: .\n"
+"X-Poedit-Language: Dutch\n"
 "X-Poedit-SearchPath-0: ../../..\n"
 
-#: ../../../src/net.cpp:1499
+#: ../../../src/init.cpp:163
+msgid "Bitcoin version"
+msgstr "Bitcoin versie"
+
+#: ../../../src/init.cpp:164
+msgid "Usage:"
+msgstr "Mededeling:"
+
+#: ../../../src/init.cpp:166
+msgid "Send command to -server or bitcoind\n"
+msgstr "Zend commando naar -server of bitcoind\n"
+
+#: ../../../src/init.cpp:167
+msgid "List commands\n"
+msgstr "List van commando's\n"
+
+#: ../../../src/init.cpp:168
+msgid "Get help for a command\n"
+msgstr "Toon hulp voor een commando\n"
+
+#: ../../../src/init.cpp:169
+msgid "Options:\n"
+msgstr "Opties:\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Specifieer configuratiebestand (standaard: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:171
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Specifieer pid-bestand (standaard: bitcoind.pid)\n"
+
+#: ../../../src/init.cpp:172
+msgid "Generate coins\n"
+msgstr "Genereer coins\n"
+
+#: ../../../src/init.cpp:173
+msgid "Don't generate coins\n"
+msgstr "Genereer geen coins\n"
+
+#: ../../../src/init.cpp:174
+msgid "Start minimized\n"
+msgstr "Geminimaliseerd starten\n"
+
+#: ../../../src/init.cpp:175
+msgid "Specify data directory\n"
+msgstr "Stel datamap in\n"
+
+#: ../../../src/init.cpp:176
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Gelieve de time-out tijd te specifieren (in milliseconden)\n"
+
+#: ../../../src/init.cpp:177
+msgid "Connect through socks4 proxy\n"
+msgstr "Verbind via socks4 proxy\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Sta DNS-opzoeking toe voor addnode en connect\n"
+
+#: ../../../src/init.cpp:179
+msgid "Add a node to connect to\n"
+msgstr "Voeg een node toe om mee te verbinden\n"
+
+#: ../../../src/init.cpp:180
+msgid "Connect only to the specified node\n"
+msgstr "Verbind alleen met deze node\n"
+
+#: ../../../src/init.cpp:181
+msgid "Don't accept connections from outside\n"
+msgstr "Sta geen verbindingen van buitenaf toe\n"
+
+#: ../../../src/init.cpp:184
+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:186
+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:189
+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:191
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Aanvaard commandolijn en JSON-RPC commando's\n"
+
+#: ../../../src/init.cpp:194
+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:196
+msgid "Use the test network\n"
+msgstr "Gebruik het test-netwerk\n"
+
+#: ../../../src/init.cpp:197
+msgid "Username for JSON-RPC connections\n"
+msgstr "Gebruikersnaam voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:198
+msgid "Password for JSON-RPC connections\n"
+msgstr "Wachtwoord voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:199
+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:200
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Enkel JSON-RPC verbindingen van opgegeven IP adres toestaan\n"
+
+#: ../../../src/init.cpp:201
+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:202
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Stel sleutelpoelgrootte in op <n> (standaard: 100)\n"
+
+#: ../../../src/init.cpp:203
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Doorzoek de blokken database voor ontbrekende portefeuille-transacties\n"
+
+#: ../../../src/init.cpp:207
+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:208
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Gebruik OpenSSL (https) voor JSON-RPC verbindingen\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Certificaat-bestand voor server (standaard: server.cert)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Server private key (default: server.pem)\n"
+msgstr "Geheime sleutel voor server (standaard: server.pem)\n"
+
+#: ../../../src/init.cpp:211
+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:215
+msgid "This help message\n"
+msgstr "Dit helpbericht\n"
+
+#: ../../../src/init.cpp:353
+#, 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:379
+msgid "Error loading addr.dat      \n"
+msgstr "Fout bij laden van bestand addr.dat      \n"
+
+#: ../../../src/init.cpp:385
+msgid "Error loading blkindex.dat      \n"
+msgstr "Fout bij laden van bestand blkindex.dat      \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet corrupted      \n"
+msgstr "Fout bij laden van bestand wallet.dat: portefeuille beschadigd      \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin      \n"
+msgstr "Fout bij laden van bestand wallet.dat: portefeuille vereist nieuwere versie van Bitcoin\n"
+
+#: ../../../src/init.cpp:400
+msgid "Error loading wallet.dat      \n"
+msgstr "Fout bij laden van bestand wallet.dat      \n"
+
+#: ../../../src/init.cpp:489
+msgid "Invalid -proxy address"
+msgstr "Foutief -proxy adres"
+
+#: ../../../src/init.cpp:514
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Ongeldig bedrag voor -paytxfee=<bedrag>"
+
+#: ../../../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 "Waarschuwing: -paytxfee is zeer hoog ingesteld.  Dit is de fooi die betaald wordt bij het zenden van een transactie."
+
+#: ../../../src/rpc.cpp:2035
+#: ../../../src/rpc.cpp:2037
+#, c-format
+msgid "To use the %s option"
+msgstr "Om de %s optie te gebruiken"
+
+#: ../../../src/rpc.cpp:2039
+#, 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:2215
+#, 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/net.cpp:1616
 #, c-format
 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."
 
-#: ../../../src/ui.cpp:202
+#: ../../../src/util.cpp:1008
+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:1042
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/wallet.cpp:1073
+msgid "Error: Wallet locked, unable to create transaction  "
+msgstr "Fout: portefeuille is op slot, kan geen transactie aanmaken"
+
+#: ../../../src/wallet.cpp:1081
+#, 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/wallet.cpp:1083
+msgid "Error: Transaction creation failed  "
+msgstr "Fout: Aanmaken van transactie mislukt  "
+
+#: ../../../src/wallet.cpp:1088
+msgid "Sending..."
+msgstr "Versturen..."
+
+#: ../../../src/wallet.cpp:1092
+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/wallet.cpp:1104
+msgid "Invalid amount"
+msgstr "Foutieve hoeveelheid"
+
+#: ../../../src/wallet.cpp:1106
+msgid "Insufficient funds"
+msgstr "Onvoldoende saldo"
+
+#: ../../../src/main.cpp:1398
+#: ../../../src/bak/main.cpp:1414
+msgid "Warning: Disk space is low  "
+msgstr "Waarschuwing: Weinig schijfruimte over  "
+
+#: ../../../src/ui.cpp:217
+#: ../../../src/bak/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 "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?"
 
-#: ../../../src/ui.cpp:301
+#: ../../../src/ui.cpp:261
+#: ../../../src/ui.cpp:1247
+msgid "Enter the current passphrase to the wallet."
+msgstr "Geef het huidige wachtwoord voor de portefeuille."
+
+#: ../../../src/ui.cpp:262
+#: ../../../src/ui.cpp:1183
+#: ../../../src/ui.cpp:1200
+#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1272
+#: ../../../src/ui.cpp:1292
+msgid "Passphrase"
+msgstr "Wachtwoord"
+
+#: ../../../src/ui.cpp:268
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Geef het huidige wachtwoord voor de portefeille"
+
+#: ../../../src/ui.cpp:276
+#: ../../../src/ui.cpp:1257
+#: ../../../src/ui.cpp:1314
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "Het wachtwoord voor het openen van de portefeulle is foutief."
+
+#: ../../../src/ui.cpp:353
+#: ../../../src/bak/ui.cpp:316
 msgid "Status"
 msgstr "Status"
 
-#: ../../../src/ui.cpp:302
+#: ../../../src/ui.cpp:354
+#: ../../../src/bak/ui.cpp:317
 msgid "Date"
 msgstr "Datum"
 
-#: ../../../src/ui.cpp:303
+#: ../../../src/ui.cpp:355
+#: ../../../src/bak/ui.cpp:318
 msgid "Description"
 msgstr "Beschrijving"
 
-#: ../../../src/ui.cpp:304
+#: ../../../src/ui.cpp:356
+#: ../../../src/bak/ui.cpp:319
 msgid "Debit"
 msgstr "Debet"
 
-#: ../../../src/ui.cpp:305
+#: ../../../src/ui.cpp:357
+#: ../../../src/bak/ui.cpp:320
 msgid "Credit"
 msgstr "Credit"
 
-#: ../../../src/ui.cpp:511
+#: ../../../src/ui.cpp:568
+#: ../../../src/bak/ui.cpp:526
 #, c-format
 msgid "Open for %d blocks"
 msgstr "Open gedurende %d blokken"
 
-#: ../../../src/ui.cpp:513
+#: ../../../src/ui.cpp:570
+#: ../../../src/bak/ui.cpp:528
 #, c-format
 msgid "Open until %s"
 msgstr "Open tot %s"
 
-#: ../../../src/ui.cpp:519
+#: ../../../src/ui.cpp:576
+#: ../../../src/bak/ui.cpp:534
 #, c-format
 msgid "%d/offline?"
 msgstr "%d/offline?"
 
-#: ../../../src/ui.cpp:521
+#: ../../../src/ui.cpp:578
+#: ../../../src/bak/ui.cpp:536
 #, c-format
 msgid "%d/unconfirmed"
 msgstr "%d/niet bevestigd"
 
-#: ../../../src/ui.cpp:523
+#: ../../../src/ui.cpp:580
+#: ../../../src/bak/ui.cpp:538
 #, c-format
 msgid "%d confirmations"
 msgstr "%d bevestigingen"
 
-#: ../../../src/ui.cpp:608
+#: ../../../src/ui.cpp:665
+#: ../../../src/bak/ui.cpp:623
 msgid "Generated"
 msgstr "Gegenereerd"
 
-#: ../../../src/ui.cpp:616
+#: ../../../src/ui.cpp:673
+#: ../../../src/bak/ui.cpp:631
 #, c-format
 msgid "Generated (%s matures in %d more blocks)"
 msgstr "Gegenereerd (%s wordt volwassen over %d blokken)"
 
-#: ../../../src/ui.cpp:620
+#: ../../../src/ui.cpp:677
+#: ../../../src/bak/ui.cpp:635
 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!"
 
-#: ../../../src/ui.cpp:624
+#: ../../../src/ui.cpp:681
+#: ../../../src/bak/ui.cpp:639
 msgid "Generated (not accepted)"
 msgstr "Gegenereerd (niet geaccepteerd)"
 
-#: ../../../src/ui.cpp:634
+#: ../../../src/ui.cpp:691
+#: ../../../src/bak/ui.cpp:649
 msgid "From: "
 msgstr "Van: "
 
-#: ../../../src/ui.cpp:658
+#: ../../../src/ui.cpp:715
+#: ../../../src/bak/ui.cpp:673
 msgid "Received with: "
-msgstr "Ontvangen op: "
+msgstr "Ontvangen met: "
 
-#: ../../../src/ui.cpp:704
+#: ../../../src/ui.cpp:760
+#: ../../../src/bak/ui.cpp:719
 msgid "Payment to yourself"
 msgstr "Betaling aan uzelf"
 
-#: ../../../src/ui.cpp:738
+#: ../../../src/ui.cpp:794
+#: ../../../src/bak/ui.cpp:753
 msgid "To: "
 msgstr "Naar: "
 
-#: ../../../src/ui.cpp:1053
+#: ../../../src/ui.cpp:1109
+#: ../../../src/bak/ui.cpp:1068
 msgid "    Generating"
 msgstr "    Genereren..."
 
-#: ../../../src/ui.cpp:1055
+#: ../../../src/ui.cpp:1111
+#: ../../../src/bak/ui.cpp:1070
 msgid "(not connected)"
 msgstr "(niet verbonden)"
 
-#: ../../../src/ui.cpp:1058
+#: ../../../src/ui.cpp:1114
+#: ../../../src/bak/ui.cpp:1073
 #, c-format
 msgid "     %d connections     %d blocks     %d transactions"
 msgstr "     %d verbindingen     %d blokken     %d transacties"
 
-#: ../../../src/ui.cpp:1163
-#: ../../../src/ui.cpp:2527
+#: ../../../src/ui.cpp:1171
+msgid "Wallet already encrypted."
+msgstr "Portefeuille reeds versleuteld."
+
+#: ../../../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 ""
+"Geef het nieuwe wachtwoord voor de portefeuille.\n"
+"Gebruik een wachtwoord van 10 of meer willekeurige characters, of 8 of meer woorden."
+
+#: ../../../src/ui.cpp:1189
+#: ../../../src/ui.cpp:1280
+msgid "Error: The supplied passphrase was too short."
+msgstr "Fout: het wachtwoord is kort."
+
+#: ../../../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 ""
+"WAARSCHUWING: Indien u uw portefeuille versleutelt en het wachtwoord verliest, zal u AL UW BITCOINS VERLIEZEN!\n"
+"Bent u zeker dat u de portfeuille wenst te versleutelen?"
+
+#: ../../../src/ui.cpp:1199
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Voer uw portefeuille-wachtwoord opnieuw in."
+
+#: ../../../src/ui.cpp:1208
+#: ../../../src/ui.cpp:1302
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Fout: de ingevoerde wachtwoorden komen niet overeen."
+
+#: ../../../src/ui.cpp:1218
+msgid "Wallet encryption failed."
+msgstr "Versleutelen van de portefeuille mislukt."
+
+#: ../../../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 ""
+"Portefeuille versleuteld.\n"
+"Denk eraan dat uw portefeuille versleutelen geen volledige bescherming biedt tegen malware die uw computer zou geinfecteerd hebben."
+
+#: ../../../src/ui.cpp:1236
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Portefeuille is onversleuteld. Versleutel ze eerst."
+
+#: ../../../src/ui.cpp:1271
+msgid "Enter the new passphrase for the wallet."
+msgstr "Voer nieuw wachtwoord voor de portefeuille in."
+
+#: ../../../src/ui.cpp:1291
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Voer nieuw wachtwoord voor de portefeuille opnieuw in."
+
+#: ../../../src/ui.cpp:1323
+msgid "Wallet Passphrase Changed."
+msgstr "Portefeuille-wachtwoord gewijzigd."
+
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:2825
+#: ../../../src/bak/ui.cpp:1178
+#: ../../../src/bak/ui.cpp:2571
 msgid "New Receiving Address"
 msgstr "Nieuw Ontvangstadres"
 
-#: ../../../src/ui.cpp:1164
-#: ../../../src/ui.cpp:2528
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:2826
+#: ../../../src/bak/ui.cpp:1179
+#: ../../../src/bak/ui.cpp:2572
 msgid ""
 "You should use a new address for each payment you receive.\n"
 "\n"
@@ -131,248 +503,299 @@ msgstr ""
 "\n"
 "Label"
 
-#: ../../../src/ui.cpp:1233
+#: ../../../src/ui.cpp:1464
+#: ../../../src/bak/ui.cpp:1251
 msgid "<b>Status:</b> "
 msgstr "<b>Status:</b> "
 
-#: ../../../src/ui.cpp:1238
+#: ../../../src/ui.cpp:1469
+#: ../../../src/bak/ui.cpp:1256
 msgid ", has not been successfully broadcast yet"
 msgstr ", is nog niet succesvol verstuurd naar het netwerk"
 
-#: ../../../src/ui.cpp:1240
+#: ../../../src/ui.cpp:1471
+#: ../../../src/bak/ui.cpp:1258
 #, c-format
 msgid ", broadcast through %d node"
 msgstr ", verstuurd via %d node"
 
-#: ../../../src/ui.cpp:1242
+#: ../../../src/ui.cpp:1473
+#: ../../../src/bak/ui.cpp:1260
 #, c-format
 msgid ", broadcast through %d nodes"
 msgstr ", verstuurd via %d nodes"
 
-#: ../../../src/ui.cpp:1246
+#: ../../../src/ui.cpp:1477
+#: ../../../src/bak/ui.cpp:1264
 msgid "<b>Date:</b> "
 msgstr "<b>Datum:</b> "
 
-#: ../../../src/ui.cpp:1254
+#: ../../../src/ui.cpp:1485
+#: ../../../src/bak/ui.cpp:1272
 msgid "<b>Source:</b> Generated<br>"
 msgstr "<b>Bron:</b> Gegenereerd<br>"
 
-#: ../../../src/ui.cpp:1260
-#: ../../../src/ui.cpp:1278
+#: ../../../src/ui.cpp:1491
+#: ../../../src/ui.cpp:1508
+#: ../../../src/bak/ui.cpp:1278
+#: ../../../src/bak/ui.cpp:1296
 msgid "<b>From:</b> "
 msgstr "<b>Van:</b> "
 
-#: ../../../src/ui.cpp:1278
+#: ../../../src/ui.cpp:1508
+#: ../../../src/bak/ui.cpp:1296
 msgid "unknown"
 msgstr "onbekend"
 
-#: ../../../src/ui.cpp:1279
-#: ../../../src/ui.cpp:1303
-#: ../../../src/ui.cpp:1362
+#: ../../../src/ui.cpp:1509
+#: ../../../src/ui.cpp:1533
+#: ../../../src/ui.cpp:1592
+#: ../../../src/bak/ui.cpp:1297
+#: ../../../src/bak/ui.cpp:1321
+#: ../../../src/bak/ui.cpp:1380
 msgid "<b>To:</b> "
 msgstr "<b>Naar:</b> "
 
-#: ../../../src/ui.cpp:1282
+#: ../../../src/ui.cpp:1512
+#: ../../../src/bak/ui.cpp:1300
 msgid " (yours, label: "
 msgstr " (van jou, label: "
 
-#: ../../../src/ui.cpp:1284
+#: ../../../src/ui.cpp:1514
+#: ../../../src/bak/ui.cpp:1302
 msgid " (yours)"
 msgstr " (van jou)"
 
-#: ../../../src/ui.cpp:1321
-#: ../../../src/ui.cpp:1333
-#: ../../../src/ui.cpp:1379
-#: ../../../src/ui.cpp:1396
+#: ../../../src/ui.cpp:1551
+#: ../../../src/ui.cpp:1563
+#: ../../../src/ui.cpp:1609
+#: ../../../src/ui.cpp:1626
+#: ../../../src/bak/ui.cpp:1339
+#: ../../../src/bak/ui.cpp:1351
+#: ../../../src/bak/ui.cpp:1397
+#: ../../../src/bak/ui.cpp:1414
 msgid "<b>Credit:</b> "
 msgstr "<b>Credit:</b>"
 
-#: ../../../src/ui.cpp:1323
+#: ../../../src/ui.cpp:1553
+#: ../../../src/bak/ui.cpp:1341
 #, c-format
 msgid "(%s matures in %d more blocks)"
 msgstr "(%s wordt volwassen over %d blokken)"
 
-#: ../../../src/ui.cpp:1325
+#: ../../../src/ui.cpp:1555
+#: ../../../src/bak/ui.cpp:1343
 msgid "(not accepted)"
 msgstr "(niet geaccepteerd)"
 
-#: ../../../src/ui.cpp:1370
-#: ../../../src/ui.cpp:1378
-#: ../../../src/ui.cpp:1393
+#: ../../../src/ui.cpp:1600
+#: ../../../src/ui.cpp:1608
+#: ../../../src/ui.cpp:1623
+#: ../../../src/bak/ui.cpp:1388
+#: ../../../src/bak/ui.cpp:1396
+#: ../../../src/bak/ui.cpp:1411
 msgid "<b>Debit:</b> "
 msgstr "<b>Debet:</b>"
 
-#: ../../../src/ui.cpp:1384
+#: ../../../src/ui.cpp:1614
+#: ../../../src/bak/ui.cpp:1402
 msgid "<b>Transaction fee:</b> "
 msgstr "<b>Transactiefooi:</b> "
 
-#: ../../../src/ui.cpp:1400
+#: ../../../src/ui.cpp:1630
+#: ../../../src/bak/ui.cpp:1418
 msgid "<b>Net amount:</b> "
 msgstr "<b>Nettobedrag:</b> "
 
-#: ../../../src/ui.cpp:1407
+#: ../../../src/ui.cpp:1637
+#: ../../../src/bak/ui.cpp:1425
 msgid "Message:"
 msgstr "Mededeling:"
 
-#: ../../../src/ui.cpp:1409
+#: ../../../src/ui.cpp:1639
+#: ../../../src/bak/ui.cpp:1427
 msgid "Comment:"
 msgstr "Commentaar:"
 
-#: ../../../src/ui.cpp:1412
+#: ../../../src/ui.cpp:1642
+#: ../../../src/bak/ui.cpp:1430
 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."
 
-#: ../../../src/ui.cpp:1592
+#: ../../../src/ui.cpp:1826
+#: ../../../src/bak/ui.cpp:1610
 msgid "Cannot write autostart/bitcoin.desktop file"
 msgstr "Kan niet schrijven naar het bestand autostart/bitcoin.desktop"
 
-#: ../../../src/ui.cpp:1628
+#: ../../../src/ui.cpp:1862
+#: ../../../src/bak/ui.cpp:1646
 msgid "Main"
 msgstr "Algemeen"
 
-#: ../../../src/ui.cpp:1636
+#: ../../../src/ui.cpp:1872
+#: ../../../src/bak/ui.cpp:1656
 msgid "&Start Bitcoin on window system startup"
 msgstr "&Start Bitcoin wanneer het systeem opstart"
 
-#: ../../../src/ui.cpp:1643
+#: ../../../src/ui.cpp:1879
+#: ../../../src/bak/ui.cpp:1663
 msgid "&Minimize on close"
 msgstr "&Minimaliseer bij sluiten van het venster"
 
-#: ../../../src/ui.cpp:1785
+#: ../../../src/ui.cpp:2021
+#: ../../../src/bak/ui.cpp:1805
 #, c-format
 msgid "version %s"
 msgstr "versie %s"
 
-#: ../../../src/ui.cpp:1897
+#: ../../../src/ui.cpp:2144
+#: ../../../src/bak/ui.cpp:1928
 msgid "Error in amount  "
 msgstr "Fout in hoeveelheid  "
 
-#: ../../../src/ui.cpp:1897
-#: ../../../src/ui.cpp:1902
-#: ../../../src/ui.cpp:1907
-#: ../../../src/ui.cpp:1942
-#: ../../../src/uibase.cpp:55
+#: ../../../src/ui.cpp:2144
+#: ../../../src/ui.cpp:2149
+#: ../../../src/ui.cpp:2154
+#: ../../../src/ui.cpp:2207
+#: ../../../src/uibase.cpp:61
+#: ../../../src/bak/ui.cpp:1928
+#: ../../../src/bak/ui.cpp:1933
+#: ../../../src/bak/ui.cpp:1938
+#: ../../../src/bak/ui.cpp:1973
 msgid "Send Coins"
 msgstr "Verstuur coins"
 
-#: ../../../src/ui.cpp:1902
+#: ../../../src/ui.cpp:2149
+#: ../../../src/bak/ui.cpp:1933
 msgid "Amount exceeds your balance  "
 msgstr "Hoeveelheid overschrijdt uw huidige balans  "
 
-#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:2154
+#: ../../../src/bak/ui.cpp:1938
 msgid "Total exceeds your balance when the "
 msgstr "Totaal overschrijdt uw huidige balans wanneer de "
 
-#: ../../../src/ui.cpp:1907
+#: ../../../src/ui.cpp:2154
+#: ../../../src/bak/ui.cpp:1938
 msgid " transaction fee is included  "
 msgstr " transactiefooi is meegerekend  "
 
-#: ../../../src/ui.cpp:1925
+#: ../../../src/ui.cpp:2181
+#: ../../../src/bak/ui.cpp:1956
 msgid "Payment sent  "
 msgstr "Betaling verzonden  "
 
-#: ../../../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
+#: ../../../src/ui.cpp:2207
+#: ../../../src/bak/ui.cpp:1973
 msgid "Invalid address  "
 msgstr "Foutief adres  "
 
-#: ../../../src/ui.cpp:1995
+#: ../../../src/ui.cpp:2262
+#: ../../../src/bak/ui.cpp:2028
 #, c-format
 msgid "Sending %s to %s"
 msgstr "%s versturen naar %s"
 
-#: ../../../src/ui.cpp:2068
-#: ../../../src/ui.cpp:2101
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2368
+#: ../../../src/bak/ui.cpp:2101
+#: ../../../src/bak/ui.cpp:2134
 msgid "CANCELLED"
 msgstr "GEANNULEERD"
 
-#: ../../../src/ui.cpp:2072
+#: ../../../src/ui.cpp:2339
+#: ../../../src/bak/ui.cpp:2105
 msgid "Cancelled"
 msgstr "Geannuleerd"
 
-#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2341
+#: ../../../src/bak/ui.cpp:2107
 msgid "Transfer cancelled  "
 msgstr "Transactie geannuleerd  "
 
-#: ../../../src/ui.cpp:2127
+#: ../../../src/ui.cpp:2394
+#: ../../../src/bak/ui.cpp:2160
 msgid "Error: "
 msgstr "Fout: "
 
-#: ../../../src/ui.cpp:2141
-#: ../../../src/ui.cpp:2212
-#: ../../../src/main.cpp:4018
-msgid "Insufficient funds"
-msgstr "Onvoldoende saldo"
-
-#: ../../../src/ui.cpp:2146
+#: ../../../src/ui.cpp:2413
+#: ../../../src/bak/ui.cpp:2179
 msgid "Connecting..."
 msgstr "Verbinden..."
 
-#: ../../../src/ui.cpp:2151
+#: ../../../src/ui.cpp:2418
+#: ../../../src/bak/ui.cpp:2184
 msgid "Unable to connect"
 msgstr "Kan niet verbinden"
 
-#: ../../../src/ui.cpp:2156
+#: ../../../src/ui.cpp:2423
+#: ../../../src/bak/ui.cpp:2189
 msgid "Requesting public key..."
 msgstr "Aanvragen van publieke sleutel..."
 
-#: ../../../src/ui.cpp:2168
+#: ../../../src/ui.cpp:2435
+#: ../../../src/bak/ui.cpp:2201
 msgid "Received public key..."
 msgstr "Publieke sleutel ontvangen..."
 
-#: ../../../src/ui.cpp:2182
+#: ../../../src/ui.cpp:2449
+#: ../../../src/bak/ui.cpp:2215
 msgid "Recipient is not accepting transactions sent by IP address"
 msgstr "Ontvanger aanvaardt geen transacties via IP adres"
 
-#: ../../../src/ui.cpp:2184
+#: ../../../src/ui.cpp:2451
+#: ../../../src/bak/ui.cpp:2217
 msgid "Transfer was not accepted"
 msgstr "Transactie niet geaccepteerd"
 
-#: ../../../src/ui.cpp:2193
+#: ../../../src/ui.cpp:2460
+#: ../../../src/bak/ui.cpp:2226
 msgid "Invalid response received"
 msgstr "Foutief antwoord ontvangen"
 
-#: ../../../src/ui.cpp:2208
+#: ../../../src/ui.cpp:2473
+#: ../../../src/bak/ui.cpp:2241
 msgid "Creating transaction..."
 msgstr "Transactie aanmaken..."
 
-#: ../../../src/ui.cpp:2220
+#: ../../../src/ui.cpp:2496
+#: ../../../src/bak/ui.cpp:2253
 #, 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 "Deze transactie vergt een fooi van ten minste %s omwille van zijn bedrag, complexiteit, of gebruik van recent ontvangen fonden"
 
-#: ../../../src/ui.cpp:2222
+#: ../../../src/ui.cpp:2498
+#: ../../../src/bak/ui.cpp:2255
 msgid "Transaction creation failed"
 msgstr "Aanmaken van transactie mislukt"
 
-#: ../../../src/ui.cpp:2229
+#: ../../../src/ui.cpp:2508
+#: ../../../src/bak/ui.cpp:2262
 msgid "Transaction aborted"
 msgstr "Transactie geannuleerd"
 
-#: ../../../src/ui.cpp:2237
+#: ../../../src/ui.cpp:2516
+#: ../../../src/bak/ui.cpp:2270
 msgid "Lost connection, transaction cancelled"
 msgstr "Verbinding verloren, transactie geannuleerd"
 
-#: ../../../src/ui.cpp:2253
+#: ../../../src/ui.cpp:2532
+#: ../../../src/bak/ui.cpp:2286
 msgid "Sending payment..."
 msgstr "Betaling versturen..."
 
-#: ../../../src/ui.cpp:2259
+#: ../../../src/ui.cpp:2544
+#: ../../../src/bak/ui.cpp:2292
 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."
 
-#: ../../../src/ui.cpp:2268
+#: ../../../src/ui.cpp:2553
+#: ../../../src/bak/ui.cpp:2301
 msgid "Waiting for confirmation..."
 msgstr "Wachten op bevestiging..."
 
-#: ../../../src/ui.cpp:2286
+#: ../../../src/ui.cpp:2570
+#: ../../../src/bak/ui.cpp:2319
 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"
@@ -382,149 +805,112 @@ msgstr ""
 "De transactie is opgenomen en wordt uitbetaald aan de ontvanger,\n"
 "maar het mededelings-veld blijft blanco."
 
-#: ../../../src/ui.cpp:2295
+#: ../../../src/ui.cpp:2579
+#: ../../../src/bak/ui.cpp:2328
 msgid "Payment was sent, but an invalid response was received"
 msgstr "Betaling is verstuurd, maar een foutief antword is ontvangen."
 
-#: ../../../src/ui.cpp:2301
+#: ../../../src/ui.cpp:2585
+#: ../../../src/bak/ui.cpp:2334
 msgid "Payment completed"
 msgstr "Betaling voltooid"
 
-#: ../../../src/ui.cpp:2332
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2627
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
+#: ../../../src/bak/ui.cpp:2376
+#: ../../../src/bak/ui.cpp:2522
+#: ../../../src/bak/ui.cpp:2559
 msgid "Name"
 msgstr "Naam"
 
-#: ../../../src/ui.cpp:2333
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2515
+#: ../../../src/ui.cpp:2628
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
+#: ../../../src/bak/ui.cpp:2377
+#: ../../../src/bak/ui.cpp:2522
+#: ../../../src/bak/ui.cpp:2559
 msgid "Address"
 msgstr "Adres"
 
-#: ../../../src/ui.cpp:2335
-#: ../../../src/ui.cpp:2490
+#: ../../../src/ui.cpp:2630
+#: ../../../src/ui.cpp:2785
+#: ../../../src/bak/ui.cpp:2379
+#: ../../../src/bak/ui.cpp:2534
 msgid "Label"
 msgstr "Label"
 
-#: ../../../src/ui.cpp:2336
-#: ../../../src/uibase.cpp:837
+#: ../../../src/ui.cpp:2631
+#: ../../../src/uibase.cpp:847
+#: ../../../src/bak/ui.cpp:2380
 msgid "Bitcoin Address"
 msgstr "Bitcoin-adres"
 
-#: ../../../src/ui.cpp:2460
+#: ../../../src/ui.cpp:2755
+#: ../../../src/bak/ui.cpp:2504
 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.  "
 
-#: ../../../src/ui.cpp:2478
-#: ../../../src/ui.cpp:2484
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2779
+#: ../../../src/bak/ui.cpp:2522
+#: ../../../src/bak/ui.cpp:2528
 msgid "Edit Address"
 msgstr "Bewerk adres"
 
-#: ../../../src/ui.cpp:2490
+#: ../../../src/ui.cpp:2785
+#: ../../../src/bak/ui.cpp:2534
 msgid "Edit Address Label"
 msgstr "Bewerk adreslabel"
 
-#: ../../../src/ui.cpp:2515
-#: ../../../src/ui.cpp:2521
+#: ../../../src/ui.cpp:2813
+#: ../../../src/ui.cpp:2819
+#: ../../../src/bak/ui.cpp:2559
+#: ../../../src/bak/ui.cpp:2565
 msgid "Add Address"
 msgstr "Adres toevoegen"
 
-#: ../../../src/ui.cpp:2598
+#: ../../../src/ui.cpp:2906
+#: ../../../src/bak/ui.cpp:2642
 msgid "Bitcoin"
 msgstr "Bitcoin"
 
-#: ../../../src/ui.cpp:2600
+#: ../../../src/ui.cpp:2908
+#: ../../../src/bak/ui.cpp:2644
 msgid "Bitcoin - Generating"
 msgstr "Bitcoin - Genereren..."
 
-#: ../../../src/ui.cpp:2602
+#: ../../../src/ui.cpp:2910
+#: ../../../src/bak/ui.cpp:2646
 msgid "Bitcoin - (not connected)"
 msgstr "Bitcoin - (niet verbonden)"
 
-#: ../../../src/ui.cpp:2681
+#: ../../../src/ui.cpp:2989
+#: ../../../src/bak/ui.cpp:2725
 msgid "&Open Bitcoin"
 msgstr "&Open Bitcoin"
 
-#: ../../../src/ui.cpp:2682
+#: ../../../src/ui.cpp:2990
+#: ../../../src/bak/ui.cpp:2726
 msgid "&Send Bitcoins"
-msgstr "&Open Bitcoin"
+msgstr "&Verstuur Bitcoins"
 
-#: ../../../src/ui.cpp:2683
+#: ../../../src/ui.cpp:2991
+#: ../../../src/bak/ui.cpp:2727
 msgid "O&ptions..."
 msgstr "O&pties"
 
-#: ../../../src/ui.cpp:2686
+#: ../../../src/ui.cpp:2994
 #: ../../../src/uibase.cpp:25
+#: ../../../src/bak/ui.cpp:2730
 msgid "E&xit"
 msgstr "A&fsluiten"
 
-#: ../../../src/ui.cpp:2902
+#: ../../../src/ui.cpp:3220
+#: ../../../src/bak/ui.cpp:2956
 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"
@@ -533,152 +919,160 @@ msgstr "&Bestand"
 msgid "&Your Receiving Addresses..."
 msgstr "&Uw ontvangstadressen..."
 
-#: ../../../src/uibase.cpp:36
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "&Versleutel portefeuille..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "&Wijzig portefeuille-wachtwoord..."
+
+#: ../../../src/uibase.cpp:42
 msgid "&Options..."
 msgstr "&Opties..."
 
-#: ../../../src/uibase.cpp:39
+#: ../../../src/uibase.cpp:45
 msgid "&Settings"
 msgstr "&Eigenschappen"
 
-#: ../../../src/uibase.cpp:43
+#: ../../../src/uibase.cpp:49
 msgid "&About..."
 msgstr "&Over..."
 
-#: ../../../src/uibase.cpp:46
+#: ../../../src/uibase.cpp:52
 msgid "&Help"
 msgstr "&Help"
 
-#: ../../../src/uibase.cpp:56
+#: ../../../src/uibase.cpp:62
 msgid "Address Book"
 msgstr "Adresboek"
 
-#: ../../../src/uibase.cpp:69
+#: ../../../src/uibase.cpp:75
 msgid "Your Bitcoin Address:"
 msgstr "Uw bitcoin-adres:"
 
-#: ../../../src/uibase.cpp:76
+#: ../../../src/uibase.cpp:82
 msgid " &New... "
 msgstr " &Nieuw... "
 
-#: ../../../src/uibase.cpp:79
-#: ../../../src/uibase.cpp:780
-#: ../../../src/uibase.cpp:883
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
 msgid " &Copy to Clipboard "
 msgstr " &Kopieer naar plakbord "
 
-#: ../../../src/uibase.cpp:93
+#: ../../../src/uibase.cpp:99
 msgid "Balance:"
 msgstr "Balans:"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " All"
 msgstr " Alles"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Sent"
 msgstr " Verstuurd"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Received"
 msgstr " Ontvangen"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " In Progress"
 msgstr " Wordt verwerkt"
 
-#: ../../../src/uibase.cpp:130
+#: ../../../src/uibase.cpp:136
 msgid "All Transactions"
 msgstr "Alle transacties"
 
-#: ../../../src/uibase.cpp:141
+#: ../../../src/uibase.cpp:147
 msgid "Sent/Received"
 msgstr "Verstuurd/Ontvangen"
 
-#: ../../../src/uibase.cpp:152
+#: ../../../src/uibase.cpp:158
 msgid "Sent"
 msgstr "Verstuurd"
 
-#: ../../../src/uibase.cpp:163
+#: ../../../src/uibase.cpp:169
 msgid "Received"
 msgstr "Ontvangen"
 
-#: ../../../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
+#: ../../../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:345
+#: ../../../src/uibase.cpp:355
 msgid "&Start Bitcoin on system startup"
 msgstr "&Start Bitcoin wanneer het systeem opstart"
 
-#: ../../../src/uibase.cpp:348
+#: ../../../src/uibase.cpp:358
 msgid "&Minimize to the tray instead of the taskbar"
 msgstr "&Minimaliseer tot systeemvak in plaats van de taakbalk"
 
-#: ../../../src/uibase.cpp:351
+#: ../../../src/uibase.cpp:361
 msgid "Map port using &UPnP"
 msgstr "Portmapping via &UPnP"
 
-#: ../../../src/uibase.cpp:354
+#: ../../../src/uibase.cpp:364
 msgid "M&inimize to the tray on close"
 msgstr "M&inimaliseer tot taakbalk bij sluiten"
 
-#: ../../../src/uibase.cpp:360
-msgid "&Connect through socks4 proxy: "
-msgstr "&Verbind via socks4 proxy: "
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "&Verbind via socks4 proxy (vereist herstart):"
 
-#: ../../../src/uibase.cpp:371
+#: ../../../src/uibase.cpp:381
 msgid "Proxy &IP:"
 msgstr "Proxy &IP:"
 
-#: ../../../src/uibase.cpp:379
+#: ../../../src/uibase.cpp:389
 msgid " &Port:"
 msgstr " &Poort:"
 
-#: ../../../src/uibase.cpp:392
+#: ../../../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 "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
+#: ../../../src/uibase.cpp:409
 msgid "Pay transaction fee:"
 msgstr "Transactiefooi:"
 
-#: ../../../src/uibase.cpp:420
+#: ../../../src/uibase.cpp:430
 msgid "// [don't translate] Test panel 2 for future expansion"
 msgstr ""
 
-#: ../../../src/uibase.cpp:424
+#: ../../../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:446
-#: ../../../src/uibase.cpp:668
-#: ../../../src/uibase.cpp:727
-#: ../../../src/uibase.cpp:786
-#: ../../../src/uibase.cpp:895
-#: ../../../src/uibase.cpp:984
+#: ../../../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 "Annuleren"
 
-#: ../../../src/uibase.cpp:449
+#: ../../../src/uibase.cpp:459
 msgid "&Apply"
 msgstr "&Toepassen"
 
-#: ../../../src/uibase.cpp:508
+#: ../../../src/uibase.cpp:518
 msgid "Bitcoin "
 msgstr "Bitcoin "
 
-#: ../../../src/uibase.cpp:514
+#: ../../../src/uibase.cpp:524
 msgid "version"
 msgstr "versie"
 
-#: ../../../src/uibase.cpp:525
+#: ../../../src/uibase.cpp:535
 msgid ""
 "Copyright (c) 2009-2011 Bitcoin Developers\n"
 "\n"
@@ -703,39 +1097,39 @@ msgstr ""
 "software geschreven door Eric Young (eay@cryptsoft.com)) en UPnP software geschreven\n"
 "door Thomas Bernard."
 
-#: ../../../src/uibase.cpp:581
+#: ../../../src/uibase.cpp:591
 msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 msgstr "Voer een bitcoin-adres (bijvoorbeeld: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 
-#: ../../../src/uibase.cpp:595
+#: ../../../src/uibase.cpp:605
 msgid "Pay &To:"
 msgstr "Betaal &aan:"
 
-#: ../../../src/uibase.cpp:610
+#: ../../../src/uibase.cpp:620
 msgid "&Paste"
 msgstr "&Plakken"
 
-#: ../../../src/uibase.cpp:613
+#: ../../../src/uibase.cpp:623
 msgid " Address &Book..."
 msgstr " Adres&boek..."
 
-#: ../../../src/uibase.cpp:620
+#: ../../../src/uibase.cpp:630
 msgid "&Amount:"
 msgstr "&Hoeveelheid:"
 
-#: ../../../src/uibase.cpp:630
+#: ../../../src/uibase.cpp:640
 msgid "T&ransfer:"
 msgstr "O&verdracht:"
 
-#: ../../../src/uibase.cpp:636
+#: ../../../src/uibase.cpp:646
 msgid " Standard"
 msgstr " Standaard"
 
-#: ../../../src/uibase.cpp:663
+#: ../../../src/uibase.cpp:673
 msgid "&Send"
 msgstr "&Versturen"
 
-#: ../../../src/uibase.cpp:711
+#: ../../../src/uibase.cpp:721
 msgid ""
 "\n"
 "\n"
@@ -745,229 +1139,57 @@ msgstr ""
 "\n"
 "Verbinden..."
 
-#: ../../../src/uibase.cpp:761
+#: ../../../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 "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."
 
-#: ../../../src/uibase.cpp:774
-#: ../../../src/uibase.cpp:886
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
 msgid "&Edit..."
 msgstr "&Bewerken..."
 
-#: ../../../src/uibase.cpp:777
-#: ../../../src/uibase.cpp:889
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
 msgid " &New Address... "
 msgstr " &Nieuw adres... "
 
-#: ../../../src/uibase.cpp:849
+#: ../../../src/uibase.cpp:859
 msgid "Sending"
 msgstr "Versturen..."
 
-#: ../../../src/uibase.cpp:857
+#: ../../../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 "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."
 
-#: ../../../src/uibase.cpp:870
+#: ../../../src/uibase.cpp:880
 msgid "Receiving"
 msgstr "Ontvangen..."
 
-#: ../../../src/uibase.cpp:880
+#: ../../../src/uibase.cpp:890
 msgid "&Delete"
 msgstr "&Verwijderen"
 
-#: ../../../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/bak/wallet.cpp:957
+msgid "Invalid bitcoin address"
+msgstr "Foutief bitcoin-adres"
 
-#: ../../../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/bak/uibase.cpp:360
+msgid "&Connect through socks4 proxy: "
+msgstr "&Verbind via socks4 proxy: "
 
-#: ../../../src/uibase.h:147
+#: ../../../src/uibase.h:151
 msgid "Transaction Details"
 msgstr "Transactiedetails"
 
-#: ../../../src/uibase.h:199
+#: ../../../src/uibase.h:203
 msgid "Options"
 msgstr "Opties"
 
-#: ../../../src/uibase.h:228
+#: ../../../src/uibase.h:232
 msgid "About Bitcoin"
 msgstr "Over Bitcoin"
 
-#: ../../../src/uibase.h:337
+#: ../../../src/uibase.h:341
 msgid "Your Bitcoin Addresses"
 msgstr "Uw bitcoin-adressen"
+
index ef6be0d..17b5f10 100644 (file)
@@ -4,8 +4,8 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2011-06-28 20:11+0100\n"
 "PO-Revision-Date: \n"
-"Last-Translator: Dawid Spiechowicz <spiechu@gmail.com>\n"
-"Language-Team: Spiechu <spiechu@gmail.com>\n"
+"Last-Translator: Krystian Maksymowicz <krystian.maksymowicz@gmail.com>\n"
+"Language-Team: Spiechu <spiechu@gmail.com>, Krystian Maksymowicz <krystian.maksymowicz@gmail.com>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -21,7 +21,7 @@ msgstr ""
 #: ../../../src/net.cpp:1590
 #, 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."
+msgstr "Powiązanie z portem %d nie powiodło się. Prawdopodobnie Bitcoin jest już uruchomiony."
 
 #: ../../../src/init.cpp:162
 msgid "Bitcoin version"
@@ -29,7 +29,7 @@ msgstr "Wersja Bitcoin"
 
 #: ../../../src/init.cpp:163
 msgid "Usage:"
-msgstr "Użycie:"
+msgstr "Zastosowanie:"
 
 #: ../../../src/init.cpp:165
 msgid "Send command to -server or bitcoind\n"
@@ -37,7 +37,7 @@ msgstr "Wyślij polecenie do -server lub bitcoind\n"
 
 #: ../../../src/init.cpp:166
 msgid "List commands\n"
-msgstr "Wyświetl komendy\n"
+msgstr "Lista komend\n"
 
 #: ../../../src/init.cpp:167
 msgid "Get help for a command\n"
@@ -53,7 +53,7 @@ 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"
+msgstr "Określ plik pid (domyślnie: bitcoind.pid)\n"
 
 #: ../../../src/init.cpp:171
 msgid "Generate coins\n"
@@ -69,20 +69,22 @@ msgstr "Uruchom zminimalizowany\n"
 
 #: ../../../src/init.cpp:174
 msgid "Specify data directory\n"
-msgstr "Wybierz katalog z danymi\n"
+msgstr "Określ katalog danych\n"
 
 #: ../../../src/init.cpp:175
 msgid "Specify connection timeout (in milliseconds)\n"
-msgstr "Ustaw czas upływu połączenia (w milisekundach)\n"
+msgstr "Ustaw limit czasu połączenia (w milisekundach)\n"
 
 #: ../../../src/init.cpp:176
 msgid "Connect through socks4 proxy\n"
-msgstr "Połącz przez socks4 proxy\n"
+msgstr "Połącz przez proxy socks4\n"
 
+# 2do
 #: ../../../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"
+msgstr "Umożliwiaj wyszukiwanie DNS przy dodawaniu węzła i połączenia\n"
 
+# 2do
 #: ../../../src/init.cpp:178
 msgid "Add a node to connect to\n"
 msgstr "Dodaj węzeł do którego połączyć\n"
@@ -234,7 +236,7 @@ msgstr ""
 
 #: ../../../src/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 "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ł."
+msgstr "Ostrzeżenie: Sprawdź czy ustawienia daty i czasu komputera są prawidłowe. Jeżeli zegar jest źle ustawiony, Bitcoin nie będzie działał poprawnie."
 
 #: ../../../src/util.cpp:908
 msgid "beta"
@@ -243,11 +245,11 @@ 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ę?"
+msgstr "Ta transakcja przekracza limit wielkości. W dalszym ciągu możesz ją wysłać z prowizją %s, która dotrze do węzłów przetwarzających twoją transakcję i pomoże utrzymać całą sieć. Chcesz zapłacić prowizję?"
 
 #: ../../../src/ui.cpp:316
 msgid "Status"
-msgstr "Status"
+msgstr "Stan"
 
 #: ../../../src/ui.cpp:317
 msgid "Date"
@@ -259,11 +261,11 @@ msgstr "Opis"
 
 #: ../../../src/ui.cpp:319
 msgid "Debit"
-msgstr "Obciążenie"
+msgstr "Debet"
 
 #: ../../../src/ui.cpp:320
 msgid "Credit"
-msgstr "Suma"
+msgstr "Kredyt"
 
 #: ../../../src/ui.cpp:526
 #, c-format
@@ -283,7 +285,7 @@ msgstr "%d/offline?"
 #: ../../../src/ui.cpp:536
 #, c-format
 msgid "%d/unconfirmed"
-msgstr "%d/niepotwierdzono"
+msgstr "%d/niepotwierdzona"
 
 #: ../../../src/ui.cpp:538
 #, c-format
@@ -339,7 +341,7 @@ msgstr "     %d połączeń     %d bloków     %d transakcji"
 #: ../../../src/ui.cpp:1178
 #: ../../../src/ui.cpp:2571
 msgid "New Receiving Address"
-msgstr "Nowy Adres Odbiorczy"
+msgstr "Nowy adres odbiorczy"
 
 #: ../../../src/ui.cpp:1179
 #: ../../../src/ui.cpp:2572
@@ -348,7 +350,7 @@ msgid ""
 "\n"
 "Label"
 msgstr ""
-"Powinieneś użyć nowego adresu dla każdej płatności, którą otrzymasz.\n"
+"Powinieneś używać nowych adresów dla każdej otrzymywanej płatności.\n"
 "\n"
 "Etykieta"
 
@@ -406,7 +408,7 @@ msgstr " (twoja)"
 #: ../../../src/ui.cpp:1397
 #: ../../../src/ui.cpp:1414
 msgid "<b>Credit:</b> "
-msgstr "<b>Suma:</b>"
+msgstr "<b>Kredyt:</b>"
 
 #: ../../../src/ui.cpp:1341
 #, c-format
@@ -421,7 +423,7 @@ msgstr "(nie zaakceptowano)"
 #: ../../../src/ui.cpp:1396
 #: ../../../src/ui.cpp:1411
 msgid "<b>Debit:</b> "
-msgstr "<b>Obciążenie:</b>"
+msgstr "<b>Debet:</b>"
 
 #: ../../../src/ui.cpp:1402
 msgid "<b>Transaction fee:</b> "
@@ -441,7 +443,7 @@ msgstr "Komentarz:"
 
 #: ../../../src/ui.cpp:1430
 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."
+msgstr "Wygenerowane monety muszą poczekać 120 bloków zanim będą mogły być wydane. Wygenerowany blok został został rozgłoszony w sieci z przeznaczeniem dodawania nowych bloków do łańcucha. Jeżeli nie uda się go dodać do łańcucha, zostanie oznaczony jako \"nie zaakceptowany\" i nie będzie mógł być wydany. Sporadycznie dzieje się tak jeżeli inny węzeł wygeneruje blok nie dalej niż kilka sekund od ciebie."
 
 #: ../../../src/ui.cpp:1610
 msgid "Cannot write autostart/bitcoin.desktop file"
@@ -520,7 +522,7 @@ msgstr "Anulowano"
 
 #: ../../../src/ui.cpp:2107
 msgid "Transfer cancelled  "
-msgstr "Transfer anulowano"
+msgstr "Transfer anulowany"
 
 #: ../../../src/ui.cpp:2160
 msgid "Error: "
@@ -567,7 +569,7 @@ msgstr "Tworzenie transakcji..."
 #: ../../../src/ui.cpp:2253
 #, 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"
+msgstr "Ta transakcja wymaga prowizji co najmniej %s z uwagi na jej kwotę, złożoność lub wykorzystanie niedawno otrzymanych funduszy"
 
 #: ../../../src/ui.cpp:2255
 msgid "Transaction creation failed"
@@ -575,7 +577,7 @@ msgstr "Błąd tworzenia transakcji "
 
 #: ../../../src/ui.cpp:2262
 msgid "Transaction aborted"
-msgstr "Transakcję przerwano"
+msgstr "Przerwano transakcję"
 
 #: ../../../src/ui.cpp:2270
 msgid "Lost connection, transaction cancelled"
@@ -635,21 +637,21 @@ msgstr "Adres Bitcoin"
 
 #: ../../../src/ui.cpp:2504
 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."
+msgstr "To jest jeden z twoich adresów na otrzymywane płatności i nie może zostać wpisany do książki adresowej."
 
 #: ../../../src/ui.cpp:2522
 #: ../../../src/ui.cpp:2528
 msgid "Edit Address"
-msgstr "Edytuj Adres"
+msgstr "Edytuj adres"
 
 #: ../../../src/ui.cpp:2534
 msgid "Edit Address Label"
-msgstr "Edytuj Etykietę Adresu"
+msgstr "Edytuj etykietę adresu"
 
 #: ../../../src/ui.cpp:2559
 #: ../../../src/ui.cpp:2565
 msgid "Add Address"
-msgstr "Dodaj Adres"
+msgstr "Dodaj adres"
 
 #: ../../../src/ui.cpp:2642
 msgid "Bitcoin"
@@ -682,7 +684,7 @@ msgstr "W&yjście"
 
 #: ../../../src/ui.cpp:2956
 msgid "Program has crashed and will terminate.  "
-msgstr "Program uległ awarii i zostanie przerwany."
+msgstr "Program uległ awarii i zostanie zamknięty."
 
 #: ../../../src/main.cpp:1430
 msgid "Warning: Disk space is low  "
@@ -694,7 +696,7 @@ msgstr "&Plik"
 
 #: ../../../src/uibase.cpp:32
 msgid "&Your Receiving Addresses..."
-msgstr "&Twój Adres Odbiorczy..."
+msgstr "&Twój adres odbiorczy..."
 
 #: ../../../src/uibase.cpp:36
 msgid "&Options..."
@@ -714,11 +716,11 @@ msgstr "&Pomoc"
 
 #: ../../../src/uibase.cpp:56
 msgid "Address Book"
-msgstr "Księga Adresowa"
+msgstr "Książka adresowa"
 
 #: ../../../src/uibase.cpp:69
 msgid "Your Bitcoin Address:"
-msgstr "Twój Adres Bitcoin:"
+msgstr "Twój adres Bitcoin:"
 
 #: ../../../src/uibase.cpp:76
 msgid " &New... "
@@ -740,31 +742,31 @@ msgstr " Wszystko"
 
 #: ../../../src/uibase.cpp:109
 msgid " Sent"
-msgstr "Wysłano"
+msgstr " Wysłano"
 
 #: ../../../src/uibase.cpp:109
 msgid " Received"
-msgstr "Otrzymano"
+msgstr " Otrzymano"
 
 #: ../../../src/uibase.cpp:109
 msgid " In Progress"
-msgstr "W Trakcie"
+msgstr "W realizacji"
 
 #: ../../../src/uibase.cpp:130
 msgid "All Transactions"
-msgstr "Wszystkie Transakcje"
+msgstr "Wszystkie transakcje"
 
 #: ../../../src/uibase.cpp:141
 msgid "Sent/Received"
-msgstr "Wysłano/Otrzymano"
+msgstr "Wysłane/Otrzymane"
 
 #: ../../../src/uibase.cpp:152
 msgid "Sent"
-msgstr "Wysłano"
+msgstr "Wysłane"
 
 #: ../../../src/uibase.cpp:163
 msgid "Received"
-msgstr "Otrzymano"
+msgstr "Otrzymane"
 
 #: ../../../src/uibase.cpp:302
 #: ../../../src/uibase.cpp:443
@@ -782,7 +784,7 @@ msgstr "&Uruchom Bitcoin wraz ze startem systemu"
 
 #: ../../../src/uibase.cpp:348
 msgid "&Minimize to the tray instead of the taskbar"
-msgstr "&Zminimalizuj do traya zamiast do paska zadań"
+msgstr "&Minimalizuj do obszaru powiadomień zamiast paska zadań"
 
 #: ../../../src/uibase.cpp:351
 msgid "Map port using &UPnP"
@@ -790,11 +792,11 @@ msgstr "Mapuj port używając &UPnP"
 
 #: ../../../src/uibase.cpp:354
 msgid "M&inimize to the tray on close"
-msgstr "Zm&inimalizuj do traya przy zamknięciu"
+msgstr "M&inimalizuj do obszaru powiadomień przy zamknięciu"
 
 #: ../../../src/uibase.cpp:360
 msgid "&Connect through socks4 proxy: "
-msgstr "&Połącz przez socks4 proxy:"
+msgstr "&Połącz przez proxy socks4:"
 
 #: ../../../src/uibase.cpp:371
 msgid "Proxy &IP:"
@@ -806,11 +808,11 @@ msgstr " &Port:"
 
 #: ../../../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 "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."
+msgstr "Opcjonalna prowizja określona na każdy KB transakcji, zapewniająca szybkie przetworzenie. Większość transakcji to 1KB. Rekomendowana prowizja to 0.01."
 
 #: ../../../src/uibase.cpp:399
 msgid "Pay transaction fee:"
-msgstr "Płać prowizję transakcji:"
+msgstr "Płać prowizję od transakcji:"
 
 #: ../../../src/uibase.cpp:420
 msgid "// [don't translate] Test panel 2 for future expansion"
@@ -835,7 +837,7 @@ msgstr "&Zastosuj"
 
 #: ../../../src/uibase.cpp:508
 msgid "Bitcoin "
-msgstr "Bitcoin"
+msgstr "Bitcoin "
 
 #: ../../../src/uibase.cpp:514
 msgid "version"
@@ -871,7 +873,7 @@ msgstr "Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 
 #: ../../../src/uibase.cpp:595
 msgid "Pay &To:"
-msgstr "Wpłać &Dla:"
+msgstr "Wpłać &dla:"
 
 #: ../../../src/uibase.cpp:610
 msgid "&Paste"
@@ -879,11 +881,11 @@ msgstr "&Wklej"
 
 #: ../../../src/uibase.cpp:613
 msgid " Address &Book..."
-msgstr " Księga &Adresowa..."
+msgstr " Książka &adresowa..."
 
 #: ../../../src/uibase.cpp:620
 msgid "&Amount:"
-msgstr "&Kwota:"
+msgstr "&Saldo:"
 
 #: ../../../src/uibase.cpp:630
 msgid "T&ransfer:"
@@ -909,7 +911,7 @@ msgstr ""
 
 #: ../../../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 "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."
+msgstr "To są twoje adresy Bitcoin dla otrzymywania płatności. Możesz chcieć podawać inny 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:774
 #: ../../../src/uibase.cpp:886
@@ -919,7 +921,7 @@ msgstr "&Edytuj..."
 #: ../../../src/uibase.cpp:777
 #: ../../../src/uibase.cpp:889
 msgid " &New Address... "
-msgstr " &Nowy Adres..."
+msgstr " &Nowy adres..."
 
 #: ../../../src/uibase.cpp:849
 msgid "Sending"
@@ -960,7 +962,7 @@ msgstr "Niewłaściwy adres bitcoin"
 
 #: ../../../src/uibase.h:147
 msgid "Transaction Details"
-msgstr "Szczegóły Transakcji"
+msgstr "Szczegóły transakcji"
 
 #: ../../../src/uibase.h:199
 msgid "Options"
@@ -972,5 +974,5 @@ msgstr "O Bitcoin"
 
 #: ../../../src/uibase.h:337
 msgid "Your Bitcoin Addresses"
-msgstr "Twoje Adresy Bitcoin"
+msgstr "Twoje adresy bitcoin"
 
index 20e100f..35a3fd7 100644 (file)
Binary files a/locale/pt/LC_MESSAGES/bitcoin.mo and b/locale/pt/LC_MESSAGES/bitcoin.mo differ
index 9fca3ce..4019bf4 100644 (file)
@@ -3,3 +3,5 @@ locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
 \r
 .po is the sourcefile\r
 .mo is the compiled translation\r
+\r
+Note: pull requests should only include the .po file. Do not include .mo file
\ No newline at end of file
diff --git a/locale/ro/LC_MESSAGES/bitcoin.mo b/locale/ro/LC_MESSAGES/bitcoin.mo
new file mode 100644 (file)
index 0000000..0eb994b
Binary files /dev/null and b/locale/ro/LC_MESSAGES/bitcoin.mo differ
diff --git a/locale/ro/LC_MESSAGES/bitcoin.po b/locale/ro/LC_MESSAGES/bitcoin.po
new file mode 100644 (file)
index 0000000..e906e97
--- /dev/null
@@ -0,0 +1,1078 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-09-06 03:47+0100\n"
+"PO-Revision-Date: 2011-09-06 06:36+0100\n"
+"Last-Translator: Alex B <paraipanakos@gmail.com>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: \n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Language: Romanian\n"
+"X-Poedit-SourceCharset: iso-8859-2\n"
+"X-Poedit-SearchPath-0: ../../..\n"
+
+#: ../../../src/init.cpp:163
+msgid "Bitcoin version"
+msgstr "versiune Bitcoin"
+
+#: ../../../src/init.cpp:164
+msgid "Usage:"
+msgstr "Uz:"
+
+#: ../../../src/init.cpp:166
+msgid "Send command to -server or bitcoind\n"
+msgstr "Trimite comanda la bitcoin lansat cu -server sau bitcoind\n"
+
+#: ../../../src/init.cpp:167
+msgid "List commands\n"
+msgstr "Listeaza comenzi\n"
+
+#: ../../../src/init.cpp:168
+msgid "Get help for a command\n"
+msgstr "Ajutor pentru o comanda\n"
+
+#: ../../../src/init.cpp:169
+msgid "Options:\n"
+msgstr "Optiuni:\n"
+
+#: ../../../src/init.cpp:170
+msgid "Specify configuration file (default: bitcoin.conf)\n"
+msgstr "Specifica fisier de configuratie (predeterminat: bitcoin.conf)\n"
+
+#: ../../../src/init.cpp:171
+msgid "Specify pid file (default: bitcoind.pid)\n"
+msgstr "Specifica fisier pid (predeterminat: bitcoin.pid)\n"
+
+#: ../../../src/init.cpp:172
+msgid "Generate coins\n"
+msgstr "Genereaza monede\n"
+
+#: ../../../src/init.cpp:173
+msgid "Don't generate coins\n"
+msgstr "Nu genera monede\n"
+
+#: ../../../src/init.cpp:174
+msgid "Start minimized\n"
+msgstr "Porneste minimizat\n"
+
+#: ../../../src/init.cpp:175
+msgid "Specify data directory\n"
+msgstr "Specifica directorul de date\n"
+
+#: ../../../src/init.cpp:176
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "Specifica timpul maxim de conexiune (in milisecunde)\n"
+
+#: ../../../src/init.cpp:177
+msgid "Connect through socks4 proxy\n"
+msgstr "Conecteaza prin proxy socks4\n"
+
+#: ../../../src/init.cpp:178
+msgid "Allow DNS lookups for addnode and connect\n"
+msgstr "Permite cautare DNS pentru addnode si connect\n"
+
+#: ../../../src/init.cpp:179
+msgid "Add a node to connect to\n"
+msgstr "Adauga un nod de conectare\n"
+
+#: ../../../src/init.cpp:180
+msgid "Connect only to the specified node\n"
+msgstr "Conecteaza numai la nodul specificat\n"
+
+#: ../../../src/init.cpp:181
+msgid "Don't accept connections from outside\n"
+msgstr "Nu accepta conexiuni din exterior\n"
+
+#: ../../../src/init.cpp:184
+msgid "Don't attempt to use UPnP to map the listening port\n"
+msgstr "Nu utiliza UPnP pentru deschiderea portul de ascultare\n"
+
+#: ../../../src/init.cpp:186
+msgid "Attempt to use UPnP to map the listening port\n"
+msgstr "Incearca sa utilizezi UPnP pentru deschiderea portului de ascultare.\n"
+
+#: ../../../src/init.cpp:189
+msgid "Fee per KB to add to transactions you send\n"
+msgstr "Comision per KB ce se adauga la tranzactiile transmise\n"
+
+#: ../../../src/init.cpp:191
+msgid "Accept command line and JSON-RPC commands\n"
+msgstr "Accepta comenzi de consola si JSON-RPC\n"
+
+#: ../../../src/init.cpp:194
+msgid "Run in the background as a daemon and accept commands\n"
+msgstr "Executa ca daemon si accepta comenzi\n"
+
+#: ../../../src/init.cpp:196
+msgid "Use the test network\n"
+msgstr "Utilizeaza reteaua de probe\n"
+
+#: ../../../src/init.cpp:197
+msgid "Username for JSON-RPC connections\n"
+msgstr "Utilizator pentru conexiuni JSON-RPC\n"
+
+#: ../../../src/init.cpp:198
+msgid "Password for JSON-RPC connections\n"
+msgstr "Parola pentru conexiuni JSON-RPC\n"
+
+#: ../../../src/init.cpp:199
+msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
+msgstr "Asculta conexiuni JSON-RPC pe portul <puerto> (predeterminat: 8332)\n"
+
+#: ../../../src/init.cpp:200
+msgid "Allow JSON-RPC connections from specified IP address\n"
+msgstr "Permite conexiuni JSON-RPC de la adresa IP specifica\n"
+
+#: ../../../src/init.cpp:201
+msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
+msgstr "Trimite comanda la nod existent la <ip> (predeterminat: 127.0.0.1)\n"
+
+#: ../../../src/init.cpp:202
+msgid "Set key pool size to <n> (default: 100)\n"
+msgstr "Ajusteaza numarul de chei in rezerva (predeterminat: 100)\n"
+
+#: ../../../src/init.cpp:203
+msgid "Rescan the block chain for missing wallet transactions\n"
+msgstr "Rescaneza lantul de blocuri in cautare de tranzacti lipsa din portofel\n"
+
+#: ../../../src/init.cpp:207
+msgid ""
+"\n"
+"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
+msgstr ""
+"\n"
+"Optiuni SSL: (vezi la Wiki Bitcoin pentru instructiuni detaliate)\n"
+
+#: ../../../src/init.cpp:208
+msgid "Use OpenSSL (https) for JSON-RPC connections\n"
+msgstr "Utilizeaza OpenSSL (https) pentru conexiunile JSON-RPC\n"
+
+#: ../../../src/init.cpp:209
+msgid "Server certificate file (default: server.cert)\n"
+msgstr "Arhiva certificat de server (predeterminat: server.cert)\n"
+
+#: ../../../src/init.cpp:210
+msgid "Server private key (default: server.pem)\n"
+msgstr "Cheie privata de server (predeterminat: server.pem)\n"
+
+#: ../../../src/init.cpp:211
+msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+msgstr "Tipuri de cifrare acceptate (predeterminat: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
+
+#: ../../../src/init.cpp:215
+msgid "This help message\n"
+msgstr "Acest mesaj de ajutor\n"
+
+#: ../../../src/init.cpp:353
+#, c-format
+msgid "Cannot obtain a lock on data directory %s.  Bitcoin is probably already running."
+msgstr "Nu se poate obtine permis de lucru in directorul de date %s. E posibil ca Bitcoin sa fie deja in executie."
+
+#: ../../../src/init.cpp:379
+msgid "Error loading addr.dat      \n"
+msgstr "Eroare la incarcare addr.dat      \n"
+
+#: ../../../src/init.cpp:385
+msgid "Error loading blkindex.dat      \n"
+msgstr "Eroare la incarcare blkindex.dat      \n"
+
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet corrupted      \n"
+msgstr "Eroare la incarcare wallet.dat      \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin      \n"
+msgstr "Eroare la incarcare wallet.dat: E necesare o versiune mai noua de Bitcoin      \n"
+
+#: ../../../src/init.cpp:400
+msgid "Error loading wallet.dat      \n"
+msgstr "Eroare la incarcare wallet.dat      \n"
+
+#: ../../../src/init.cpp:489
+msgid "Invalid -proxy address"
+msgstr "Adresa -proxy invalida"
+
+#: ../../../src/init.cpp:514
+msgid "Invalid amount for -paytxfee=<amount>"
+msgstr "Cantitate invalida pentru -paytxfee=<amount>"
+
+#: ../../../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 "Atentie: -paytxfee este prea mare. Acesta este comisionul platit la fiecare tranzactie."
+
+#: ../../../src/main.cpp:1398
+msgid "Warning: Disk space is low  "
+msgstr "Atentie: Spatiul pe hard disk este redus"
+
+#: ../../../src/net.cpp:1610
+#, c-format
+msgid "Unable to bind to port %d on this computer.  Bitcoin is probably already running."
+msgstr "Nu e posibila ascultarea pe portul %d in acest calculator. Probabil clientul Bitcoin este deja in executie."
+
+#: ../../../src/rpc.cpp:2005
+#: ../../../src/rpc.cpp:2007
+#, c-format
+msgid "To use the %s option"
+msgstr "Pentru a utiliza optiunea %s"
+
+#: ../../../src/rpc.cpp:2009
+#, 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 ""
+"Atentie: %s, trebuie sa specifici rpcpassword=<password>\n"
+"in fisierul de configuratie: %s\n"
+"Daca fisierul nu exista trebuie creat cu permisiuni de citire numai pentru autor.\n"
+
+#: ../../../src/rpc.cpp:2185
+#, 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 ""
+"Trebuie sa specifici rpcpassword=<password> in fisierul de configuratie:\n"
+"%s\n"
+"Daca fisierul nu exista trebuie creat cu permisiuni de citire numai pentru autor."
+
+#: ../../../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 "Aceasta tranzactie trece peste limita de dimensiune. O poti trimite in continuare pentru %s, care taxa se imparte intre nodurile ce receptioneaza tranzactia si ajuta la mentinerea retelei. Continui tranzactia?"
+
+#: ../../../src/ui.cpp:261
+#: ../../../src/ui.cpp:1247
+msgid "Enter the current passphrase to the wallet."
+msgstr "Introduce parola actuala de portofel"
+
+#: ../../../src/ui.cpp:262
+#: ../../../src/ui.cpp:1183
+#: ../../../src/ui.cpp:1200
+#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1272
+#: ../../../src/ui.cpp:1292
+msgid "Passphrase"
+msgstr "Parola"
+
+#: ../../../src/ui.cpp:268
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "Introduce parola actuala para decriptarea portofelului."
+
+#: ../../../src/ui.cpp:276
+#: ../../../src/ui.cpp:1257
+#: ../../../src/ui.cpp:1314
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "Parola introdusa pentru decriptarea portofelului nu este corecta."
+
+#: ../../../src/ui.cpp:353
+msgid "Status"
+msgstr "Stare"
+
+#: ../../../src/ui.cpp:354
+msgid "Date"
+msgstr "Data"
+
+#: ../../../src/ui.cpp:355
+msgid "Description"
+msgstr "Descriere"
+
+#: ../../../src/ui.cpp:356
+msgid "Debit"
+msgstr "Debit"
+
+#: ../../../src/ui.cpp:357
+msgid "Credit"
+msgstr "Credit"
+
+#: ../../../src/ui.cpp:568
+#, c-format
+msgid "Open for %d blocks"
+msgstr "Deschis pentru %d blocuri"
+
+#: ../../../src/ui.cpp:570
+#, c-format
+msgid "Open until %s"
+msgstr "Deschis pana la %s"
+
+#: ../../../src/ui.cpp:576
+#, c-format
+msgid "%d/offline?"
+msgstr "%d/desconectat?"
+
+#: ../../../src/ui.cpp:578
+#, c-format
+msgid "%d/unconfirmed"
+msgstr "%d/neconfirmat"
+
+#: ../../../src/ui.cpp:580
+#, c-format
+msgid "%d confirmations"
+msgstr "%d confirmari"
+
+#: ../../../src/ui.cpp:665
+msgid "Generated"
+msgstr "Generat"
+
+#: ../../../src/ui.cpp:673
+#, c-format
+msgid "Generated (%s matures in %d more blocks)"
+msgstr "Generat (%s matureaza in %d blocuri)"
+
+#: ../../../src/ui.cpp:677
+msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
+msgstr "Generat - Atentie: Acest block nu se a receptionat de la alte noduri si probabil nu va fi acceptat!"
+
+#: ../../../src/ui.cpp:681
+msgid "Generated (not accepted)"
+msgstr "Generat (neaceptat)"
+
+#: ../../../src/ui.cpp:691
+msgid "From: "
+msgstr "De: "
+
+#: ../../../src/ui.cpp:715
+msgid "Received with: "
+msgstr "Receptionat cu: "
+
+#: ../../../src/ui.cpp:760
+msgid "Payment to yourself"
+msgstr "Plata proprie"
+
+#: ../../../src/ui.cpp:794
+msgid "To: "
+msgstr "Pentru: "
+
+#: ../../../src/ui.cpp:1109
+msgid "    Generating"
+msgstr "    Genereaza"
+
+#: ../../../src/ui.cpp:1111
+msgid "(not connected)"
+msgstr "(neconectat)"
+
+#: ../../../src/ui.cpp:1114
+#, c-format
+msgid "     %d connections     %d blocks     %d transactions"
+msgstr "     %d conexiuni     %d blocuri     %d tranzactii"
+
+#: ../../../src/ui.cpp:1171
+msgid "Wallet already encrypted."
+msgstr "Portofel deja encriptat."
+
+#: ../../../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 ""
+"Introduce noua parola de portofel.\n"
+"Te rugam sa utilizezi o parola de 10 sau mai multe caracter aleatoare sau minimum opt cuvinte."
+
+#: ../../../src/ui.cpp:1189
+#: ../../../src/ui.cpp:1280
+msgid "Error: The supplied passphrase was too short."
+msgstr "Eroare: Parola introdusa este prea scurta."
+
+#: ../../../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 ""
+"ATENTIE: Daca encriptezi portofelul si uiti parola vei pierde TOATE MONEDELE!\n"
+"Esti sigur ca vrei sa encriptezi portofelul?"
+
+#: ../../../src/ui.cpp:1199
+msgid "Please re-enter your new wallet passphrase."
+msgstr "Reintroduce noua parola de portofel."
+
+#: ../../../src/ui.cpp:1208
+#: ../../../src/ui.cpp:1302
+msgid "Error: the supplied passphrases didn't match."
+msgstr "Eroare: parolele introduse nu sunt identice."
+
+#: ../../../src/ui.cpp:1218
+msgid "Wallet encryption failed."
+msgstr "Encriptare portofel esuata."
+
+#: ../../../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 ""
+"Portofel encriptat.\n"
+"Retine ca encriptarea portofelului nu iti poate proteja complet monedele daca pc-ul este infectat de malware."
+
+#: ../../../src/ui.cpp:1236
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "Portofelul nu este encriptat, incearca sa-l encriptezi inainte."
+
+#: ../../../src/ui.cpp:1271
+msgid "Enter the new passphrase for the wallet."
+msgstr "Introduce noua parola de portofel."
+
+#: ../../../src/ui.cpp:1291
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "Reintroduce noua parola de portofel."
+
+#: ../../../src/ui.cpp:1323
+msgid "Wallet Passphrase Changed."
+msgstr "Parola de portofel schimbata."
+
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:2821
+msgid "New Receiving Address"
+msgstr "Adresa Noua de Primire"
+
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:2822
+msgid ""
+"You should use a new address for each payment you receive.\n"
+"\n"
+"Label"
+msgstr ""
+"Cel mai indicat e sa utilizezi a adresa noua pentru fiecare plata primita.\n"
+"\n"
+"Eticheta"
+
+#: ../../../src/ui.cpp:1464
+msgid "<b>Status:</b> "
+msgstr "<b>Stare:</b> "
+
+#: ../../../src/ui.cpp:1469
+msgid ", has not been successfully broadcast yet"
+msgstr ", inca nu a fost trimisa cu succes"
+
+#: ../../../src/ui.cpp:1471
+#, c-format
+msgid ", broadcast through %d node"
+msgstr ", emis prin nod %d"
+
+#: ../../../src/ui.cpp:1473
+#, c-format
+msgid ", broadcast through %d nodes"
+msgstr ", emis prin noduri %d"
+
+#: ../../../src/ui.cpp:1477
+msgid "<b>Date:</b> "
+msgstr "<b>Data:</b> "
+
+#: ../../../src/ui.cpp:1485
+msgid "<b>Source:</b> Generated<br>"
+msgstr "<b>Sursa:</b> Generat<br>"
+
+#: ../../../src/ui.cpp:1491
+#: ../../../src/ui.cpp:1508
+msgid "<b>From:</b> "
+msgstr "<b>De:</b> "
+
+#: ../../../src/ui.cpp:1508
+msgid "unknown"
+msgstr "necunoscut"
+
+#: ../../../src/ui.cpp:1509
+#: ../../../src/ui.cpp:1533
+#: ../../../src/ui.cpp:1592
+msgid "<b>To:</b> "
+msgstr "<b>Pentru:</b> "
+
+#: ../../../src/ui.cpp:1512
+msgid " (yours, label: "
+msgstr "(tau, eticheta: "
+
+#: ../../../src/ui.cpp:1514
+msgid " (yours)"
+msgstr "(tau)"
+
+#: ../../../src/ui.cpp:1551
+#: ../../../src/ui.cpp:1563
+#: ../../../src/ui.cpp:1609
+#: ../../../src/ui.cpp:1626
+msgid "<b>Credit:</b> "
+msgstr "<b>Credit:</b> "
+
+#: ../../../src/ui.cpp:1553
+#, c-format
+msgid "(%s matures in %d more blocks)"
+msgstr "(%s matureaza in %d blocuri)"
+
+#: ../../../src/ui.cpp:1555
+msgid "(not accepted)"
+msgstr "(neaceptat)"
+
+#: ../../../src/ui.cpp:1600
+#: ../../../src/ui.cpp:1608
+#: ../../../src/ui.cpp:1623
+msgid "<b>Debit:</b> "
+msgstr "<b>Debit:</b> "
+
+#: ../../../src/ui.cpp:1614
+msgid "<b>Transaction fee:</b> "
+msgstr "<b>Comision tranzactie:</b> "
+
+#: ../../../src/ui.cpp:1630
+msgid "<b>Net amount:</b> "
+msgstr "<b>Cantitate neta:</b> "
+
+#: ../../../src/ui.cpp:1637
+msgid "Message:"
+msgstr "Mesaj:"
+
+#: ../../../src/ui.cpp:1639
+msgid "Comment:"
+msgstr "Comentariu:"
+
+#: ../../../src/ui.cpp:1642
+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 "Monedele generate trebuie sa astepte 120 de blocuri inainte sa poata fi cheltuite. Cand ai generat acest block, s-a transmis in retea pentru a fi incul in lantul de blocuri. Daca nu este acceptat in lant, se va schimba in \"neaceptat\" si nu se va putea cheltui. Acest lucru se poate intampla rareori cand alt nod genereaza un bloc in acelasi moment cu al tau ."
+
+#: ../../../src/ui.cpp:1822
+msgid "Cannot write autostart/bitcoin.desktop file"
+msgstr "Nu se poate scrie in fisierul autostart/bitcoin.desktop"
+
+#: ../../../src/ui.cpp:1858
+msgid "Main"
+msgstr "Principal"
+
+#: ../../../src/ui.cpp:1868
+msgid "&Start Bitcoin on window system startup"
+msgstr "&Porneste Bitcoin odata cu sistemul"
+
+#: ../../../src/ui.cpp:1875
+msgid "&Minimize on close"
+msgstr "&Minimizeaza la inchidere"
+
+#: ../../../src/ui.cpp:2017
+#, c-format
+msgid "version %s"
+msgstr "versiune %s"
+
+#: ../../../src/ui.cpp:2140
+msgid "Error in amount  "
+msgstr "Eroare in cantitate  "
+
+#: ../../../src/ui.cpp:2140
+#: ../../../src/ui.cpp:2145
+#: ../../../src/ui.cpp:2150
+#: ../../../src/ui.cpp:2203
+#: ../../../src/uibase.cpp:61
+msgid "Send Coins"
+msgstr "Trimite Monede"
+
+#: ../../../src/ui.cpp:2145
+msgid "Amount exceeds your balance  "
+msgstr "Cantitatea trece peste limita disponibila"
+
+#: ../../../src/ui.cpp:2150
+msgid "Total exceeds your balance when the "
+msgstr "Totalul trece peste limita cand"
+
+#: ../../../src/ui.cpp:2150
+msgid " transaction fee is included  "
+msgstr "comisionul de tranzactie este inclus"
+
+#: ../../../src/ui.cpp:2177
+msgid "Payment sent  "
+msgstr "Plata trimisa"
+
+#: ../../../src/ui.cpp:2177
+#: ../../../src/ui.cpp:2187
+#: ../../../src/ui.cpp:2337
+#: ../../../src/ui.cpp:2502
+#: ../../../src/wallet.cpp:1088
+msgid "Sending..."
+msgstr "Se trimite..."
+
+#: ../../../src/ui.cpp:2203
+msgid "Invalid address  "
+msgstr "Adresa incorecta"
+
+#: ../../../src/ui.cpp:2258
+#, c-format
+msgid "Sending %s to %s"
+msgstr "Se trimite %s la %s"
+
+#: ../../../src/ui.cpp:2331
+#: ../../../src/ui.cpp:2364
+msgid "CANCELLED"
+msgstr "ANULAT"
+
+#: ../../../src/ui.cpp:2335
+msgid "Cancelled"
+msgstr "Anulat"
+
+#: ../../../src/ui.cpp:2337
+msgid "Transfer cancelled  "
+msgstr "Transfer anulat"
+
+#: ../../../src/ui.cpp:2390
+msgid "Error: "
+msgstr "Eroare: "
+
+#: ../../../src/ui.cpp:2404
+#: ../../../src/ui.cpp:2473
+#: ../../../src/wallet.cpp:1106
+msgid "Insufficient funds"
+msgstr "Fonduri insuficiente"
+
+#: ../../../src/ui.cpp:2409
+msgid "Connecting..."
+msgstr "Se conecteaza..."
+
+#: ../../../src/ui.cpp:2414
+msgid "Unable to connect"
+msgstr "Conectare imposibila"
+
+#: ../../../src/ui.cpp:2419
+msgid "Requesting public key..."
+msgstr "Se cere cheia publica..."
+
+#: ../../../src/ui.cpp:2431
+msgid "Received public key..."
+msgstr "Cheia publica primita..."
+
+#: ../../../src/ui.cpp:2445
+msgid "Recipient is not accepting transactions sent by IP address"
+msgstr "Destinatarul nu accepta tranzacti trimise la adresa IP"
+
+#: ../../../src/ui.cpp:2447
+msgid "Transfer was not accepted"
+msgstr "Transferul nu a fost acceptat"
+
+#: ../../../src/ui.cpp:2456
+msgid "Invalid response received"
+msgstr "Raspuns invalid receptionat"
+
+#: ../../../src/ui.cpp:2469
+msgid "Creating transaction..."
+msgstr "Se creeaza tranzactia..."
+
+#: ../../../src/ui.cpp:2492
+#, 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 "Aceasta tranzactie necesita un comision de cel putin %s datorita cantitatii, complexitatii sau uzului de fonduri primite recent"
+
+#: ../../../src/ui.cpp:2494
+msgid "Transaction creation failed"
+msgstr "Crearea tranzactiei a esuat."
+
+#: ../../../src/ui.cpp:2504
+msgid "Transaction aborted"
+msgstr "Tranzactie anulata"
+
+#: ../../../src/ui.cpp:2512
+msgid "Lost connection, transaction cancelled"
+msgstr "Conexiune pierduta, tranzactie anulata"
+
+#: ../../../src/ui.cpp:2528
+msgid "Sending payment..."
+msgstr "Se trimite plata..."
+
+#: ../../../src/ui.cpp:2540
+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 "Tranzactia a fost respinsa. Acest lucru se poate intampla daca vreuna din monede a fost cheltuita sau s-a folosit o copie de portofel (wallet.dat) si monedele a fost cheltuite in copie dar nu s-au marcat cheltuite aici."
+
+#: ../../../src/ui.cpp:2549
+msgid "Waiting for confirmation..."
+msgstr "Se asteapta confirmare..."
+
+#: ../../../src/ui.cpp:2566
+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 ""
+"Plata a fost trimisa dar destinatarul nu a putut sa o verifice.\n"
+"Tranzactia a fost inregistrata si creditul trimis la desinatar,\n"
+"dar informatia de comentarii va ramane in alb."
+
+#: ../../../src/ui.cpp:2575
+msgid "Payment was sent, but an invalid response was received"
+msgstr "Plata a fost trimisa dar s-a receptionat un raspuns incorect"
+
+#: ../../../src/ui.cpp:2581
+msgid "Payment completed"
+msgstr "Plata completa"
+
+#: ../../../src/ui.cpp:2623
+#: ../../../src/ui.cpp:2769
+#: ../../../src/ui.cpp:2809
+msgid "Name"
+msgstr "Nume"
+
+#: ../../../src/ui.cpp:2624
+#: ../../../src/ui.cpp:2769
+#: ../../../src/ui.cpp:2809
+msgid "Address"
+msgstr "Adresa"
+
+#: ../../../src/ui.cpp:2626
+#: ../../../src/ui.cpp:2781
+msgid "Label"
+msgstr "Eticheta"
+
+#: ../../../src/ui.cpp:2627
+#: ../../../src/uibase.cpp:847
+msgid "Bitcoin Address"
+msgstr "Adresa Bitcoin"
+
+#: ../../../src/ui.cpp:2751
+msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book.  "
+msgstr "Aceasta este o adresa pentru primire de plati de aceea nu se poate introduce manual in agenda"
+
+#: ../../../src/ui.cpp:2769
+#: ../../../src/ui.cpp:2775
+msgid "Edit Address"
+msgstr "Editeaza adresa"
+
+#: ../../../src/ui.cpp:2781
+msgid "Edit Address Label"
+msgstr "Editeaza eticheta de adresa"
+
+#: ../../../src/ui.cpp:2809
+#: ../../../src/ui.cpp:2815
+msgid "Add Address"
+msgstr "Adauga adresa"
+
+#: ../../../src/ui.cpp:2902
+msgid "Bitcoin"
+msgstr "Bitcoin"
+
+#: ../../../src/ui.cpp:2904
+msgid "Bitcoin - Generating"
+msgstr "Bitcoin - Se genereaza"
+
+#: ../../../src/ui.cpp:2906
+msgid "Bitcoin - (not connected)"
+msgstr "Bitcoin - (neconectat)"
+
+#: ../../../src/ui.cpp:2985
+msgid "&Open Bitcoin"
+msgstr "&Deschide Bitcoin"
+
+#: ../../../src/ui.cpp:2986
+msgid "&Send Bitcoins"
+msgstr "&Trimite Bitcoin"
+
+#: ../../../src/ui.cpp:2987
+msgid "O&ptions..."
+msgstr "O&ptiuni"
+
+#: ../../../src/ui.cpp:2990
+#: ../../../src/uibase.cpp:25
+msgid "E&xit"
+msgstr "I&esire"
+
+#: ../../../src/ui.cpp:3216
+msgid "Program has crashed and will terminate.  "
+msgstr "Programul a detectat o eroare si se va inchide."
+
+#: ../../../src/uibase.cpp:28
+msgid "&File"
+msgstr "&Arhiva"
+
+#: ../../../src/uibase.cpp:32
+msgid "&Your Receiving Addresses..."
+msgstr "&Adresele de primire..."
+
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "&Encripteaza portofel..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "&Schimba parola de encriptare portofel..."
+
+#: ../../../src/uibase.cpp:42
+msgid "&Options..."
+msgstr "&Optiuni..."
+
+#: ../../../src/uibase.cpp:45
+msgid "&Settings"
+msgstr "&Cnfiguratie"
+
+#: ../../../src/uibase.cpp:49
+msgid "&About..."
+msgstr "&Despre..."
+
+#: ../../../src/uibase.cpp:52
+msgid "&Help"
+msgstr "&Ajutor"
+
+#: ../../../src/uibase.cpp:62
+msgid "Address Book"
+msgstr "Agenda cu adrese"
+
+#: ../../../src/uibase.cpp:75
+msgid "Your Bitcoin Address:"
+msgstr "Adresa Ta Bitcoin:"
+
+#: ../../../src/uibase.cpp:82
+msgid " &New... "
+msgstr " &Nou... "
+
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
+msgid " &Copy to Clipboard "
+msgstr " &Copiaza in Clipboard"
+
+#: ../../../src/uibase.cpp:99
+msgid "Balance:"
+msgstr "Balant:"
+
+#: ../../../src/uibase.cpp:115
+msgid " All"
+msgstr "Tot"
+
+#: ../../../src/uibase.cpp:115
+msgid " Sent"
+msgstr "Trimis"
+
+#: ../../../src/uibase.cpp:115
+msgid " Received"
+msgstr "Primit"
+
+#: ../../../src/uibase.cpp:115
+msgid " In Progress"
+msgstr "In Curs"
+
+#: ../../../src/uibase.cpp:136
+msgid "All Transactions"
+msgstr "Toate Tranzactiile"
+
+#: ../../../src/uibase.cpp:147
+msgid "Sent/Received"
+msgstr "Trimis/Primit"
+
+#: ../../../src/uibase.cpp:158
+msgid "Sent"
+msgstr "Trimis"
+
+#: ../../../src/uibase.cpp:169
+msgid "Received"
+msgstr "Primit"
+
+#: ../../../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 "&Porneste Bitcoin odata cu sistemul"
+
+#: ../../../src/uibase.cpp:358
+msgid "&Minimize to the tray instead of the taskbar"
+msgstr "&Minimizeaza in tray nu in bara de aplicatii"
+
+#: ../../../src/uibase.cpp:361
+msgid "Map port using &UPnP"
+msgstr "Reserva portul utilizand &UPnP"
+
+#: ../../../src/uibase.cpp:364
+msgid "M&inimize to the tray on close"
+msgstr "M&inimizeaza in tray la inchidere"
+
+#: ../../../src/uibase.cpp:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "&Conecteaza prin proxy socks4 (repornire apl. necesara): "
+
+#: ../../../src/uibase.cpp:381
+msgid "Proxy &IP:"
+msgstr "&IP de 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 "Comision optional per KB ce asigura ca tranzactiile tale sunt procesate rapid. Majoritatea tranzactiilor sunt de 1KB. Se recomanda un comision de 0.01."
+
+#: ../../../src/uibase.cpp:409
+msgid "Pay transaction fee:"
+msgstr "Comision de tranzactie:"
+
+#: ../../../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 "Anuleaza"
+
+#: ../../../src/uibase.cpp:459
+msgid "&Apply"
+msgstr "&Aplica"
+
+#: ../../../src/uibase.cpp:518
+msgid "Bitcoin "
+msgstr "Bitcoin "
+
+#: ../../../src/uibase.cpp:524
+msgid "version"
+msgstr "versiune"
+
+#: ../../../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"
+"Acesta este un program experimental.\n"
+"\n"
+"Distribuit sub licenta MIT/X11, cauta fisierul adaugat de licenta \n"
+"license.txt sau http://www.opensource.org/licenses/mit-license.php.\n"
+"\n"
+"Acest produs contine software creat deOpenSSL Project pentru uz in \n"
+"OpenSSL Toolkit (http://www.openssl.org/), software cryptografic scris de \n"
+"Eric Young (eay@cryptsoft.com) si software UPnP scris de Thomas Bernard."
+
+#: ../../../src/uibase.cpp:591
+msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+msgstr "Introduce o a adresa Bitcoin (exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
+
+#: ../../../src/uibase.cpp:605
+msgid "Pay &To:"
+msgstr "Plateste &la:"
+
+#: ../../../src/uibase.cpp:620
+msgid "&Paste"
+msgstr "&Lipeste (paste)"
+
+#: ../../../src/uibase.cpp:623
+msgid " Address &Book..."
+msgstr "Agenda de &adrese..."
+
+#: ../../../src/uibase.cpp:630
+msgid "&Amount:"
+msgstr "&Cantitate:"
+
+#: ../../../src/uibase.cpp:640
+msgid "T&ransfer:"
+msgstr "T&ransfera:"
+
+#: ../../../src/uibase.cpp:646
+msgid " Standard"
+msgstr "Standard"
+
+#: ../../../src/uibase.cpp:673
+msgid "&Send"
+msgstr "&Trimite"
+
+#: ../../../src/uibase.cpp:721
+msgid ""
+"\n"
+"\n"
+"Connecting..."
+msgstr ""
+"\n"
+"\n"
+"Se conecteaza..."
+
+#: ../../../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 "Acestea sunt adresele tale pentru primit plati. Poti sa folosesti o adresa diferita pentru fiecare persoana care iti trimite pentru a putea tine cont de unde vin platile. Adresa selectionata este afisata in fereastra principala."
+
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
+msgid "&Edit..."
+msgstr "&Editeaza..."
+
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
+msgid " &New Address... "
+msgstr " &Adresa noua... "
+
+#: ../../../src/uibase.cpp:859
+msgid "Sending"
+msgstr "Se trimite"
+
+#: ../../../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 "Acestea sunt adresele tale pentru primit plati. Poti sa folosesti o adresa diferita pentru fiecare persoana care iti trimite pentru a putea tine cont de unde vin platile. Adresa selectionata este afisata in fereastra principala."
+
+#: ../../../src/uibase.cpp:880
+msgid "Receiving"
+msgstr "Se receptioneaza"
+
+#: ../../../src/uibase.cpp:890
+msgid "&Delete"
+msgstr "&Sterge"
+
+#: ../../../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 "Atentie: Regleaza corect hora si data calculatorului pentru ca Bitcoin sa functioneze corect."
+
+#: ../../../src/util.cpp:904
+msgid "beta"
+msgstr "beta"
+
+#: ../../../src/wallet.cpp:1073
+msgid "Error: Wallet locked, unable to create transaction  "
+msgstr "Eroare: Portofel blocat, nu se poate crea tranzactia"
+
+#: ../../../src/wallet.cpp:1081
+#, 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 "Eroare: Aceasta tranzactie necesita un comision de cel putin %s datorita cantitatii, complexitatii sau uzului de fonduri primite recent"
+
+#: ../../../src/wallet.cpp:1083
+msgid "Error: Transaction creation failed  "
+msgstr "Eroare: Crearea tranzactiei a esuat"
+
+#: ../../../src/wallet.cpp:1092
+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: Tranzactia a fost respinsa. Acest lucru se poate intampla daca vreuna din monede a fost cheltuita sau s-a folosit o copie de portofel (wallet.dat) si monedele a fost cheltuite in copie dar nu s-au marcat cheltuite aici."
+
+#: ../../../src/wallet.cpp:1104
+msgid "Invalid amount"
+msgstr "Cantitate incorecta"
+
+#: ../../../src/uibase.h:151
+msgid "Transaction Details"
+msgstr "Detalii de Tranzactie"
+
+#: ../../../src/uibase.h:203
+msgid "Options"
+msgstr "Optiuni"
+
+#: ../../../src/uibase.h:232
+msgid "About Bitcoin"
+msgstr "Despre Bitcoin"
+
+#: ../../../src/uibase.h:341
+msgid "Your Bitcoin Addresses"
+msgstr "Adresele Tale Bitcoin"
+
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "Dirección Bitcoin inválida"
index 92bb888..4175fc4 100644 (file)
Binary files a/locale/ru/LC_MESSAGES/bitcoin.mo and b/locale/ru/LC_MESSAGES/bitcoin.mo differ
index d53b08d..266e768 100644 (file)
@@ -3,8 +3,8 @@ msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: m0Ray <m0ray@nm.ru>\n"
 "POT-Creation-Date: 2011-05-15 18:24+0100\n"
-"PO-Revision-Date: 2011-05-23 07:06+0500\n"
-"Last-Translator: m0Ray <m0ray@nm.ru>\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"
@@ -448,7 +448,7 @@ msgstr "&Открыть Bitcoin"
 
 #: ../../../src/ui.cpp:2682
 msgid "&Send Bitcoins"
-msgstr "&Открыть Bitcoin"
+msgstr "&Отправить Bitcoins"
 
 #: ../../../src/ui.cpp:2683
 msgid "O&ptions..."
index e870a16..f53367e 100644 (file)
@@ -2,8 +2,8 @@ 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"
+"POT-Creation-Date: 2011-09-06 21:58+0100\n"
+"PO-Revision-Date: 2011-09-17 19:08+0800\n"
 "Last-Translator: Dean Lee <xslidian@gmail.com>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -17,127 +17,131 @@ msgstr ""
 "X-Poedit-Bookmarks: 77,-1,-1,-1,-1,-1,-1,-1,-1,-1\n"
 "X-Poedit-SearchPath-0: ../../..\n"
 
-#: ../../../src/init.cpp:142
+#: ../../../src/init.cpp:163
 msgid "Bitcoin version"
 msgstr "Bitcoin 版本"
 
-#: ../../../src/init.cpp:143
+#: ../../../src/init.cpp:164
 msgid "Usage:"
 msgstr "用法:"
 
-#: ../../../src/init.cpp:145
+#: ../../../src/init.cpp:166
 msgid "Send command to -server or bitcoind\n"
 msgstr "发送命令给 -server 或 bitcoin\n"
 
-#: ../../../src/init.cpp:146
+#: ../../../src/init.cpp:167
 msgid "List commands\n"
 msgstr "列出命令\n"
 
-#: ../../../src/init.cpp:147
+#: ../../../src/init.cpp:168
 msgid "Get help for a command\n"
 msgstr "获取命令的帮助\n"
 
-#: ../../../src/init.cpp:148
+#: ../../../src/init.cpp:169
 msgid "Options:\n"
 msgstr "选项:\n"
 
-#: ../../../src/init.cpp:149
+#: ../../../src/init.cpp:170
 msgid "Specify configuration file (default: bitcoin.conf)\n"
 msgstr "指定配置文件 (默认: bitcoin.conf)\n"
 
-#: ../../../src/init.cpp:150
+#: ../../../src/init.cpp:171
 msgid "Specify pid file (default: bitcoind.pid)\n"
 msgstr "指定 pid 文件 (默认: bitcoin.pid)\n"
 
-#: ../../../src/init.cpp:151
+#: ../../../src/init.cpp:172
 msgid "Generate coins\n"
 msgstr "生成货币\n"
 
-#: ../../../src/init.cpp:152
+#: ../../../src/init.cpp:173
 msgid "Don't generate coins\n"
 msgstr "不要生成货币\n"
 
-#: ../../../src/init.cpp:153
+#: ../../../src/init.cpp:174
 msgid "Start minimized\n"
 msgstr "启动时最小化\n"
 
-#: ../../../src/init.cpp:154
+#: ../../../src/init.cpp:175
 msgid "Specify data directory\n"
 msgstr "指定数据目录\n"
 
-#: ../../../src/init.cpp:155
+#: ../../../src/init.cpp:176
+msgid "Specify connection timeout (in milliseconds)\n"
+msgstr "指定连接超时时间 (毫秒)\n"
+
+#: ../../../src/init.cpp:177
 msgid "Connect through socks4 proxy\n"
 msgstr "通过 socks4 代理连接\n"
 
-#: ../../../src/init.cpp:156
+#: ../../../src/init.cpp:178
 msgid "Allow DNS lookups for addnode and connect\n"
 msgstr "允许 DNS 查找新增结点和连接\n"
 
-#: ../../../src/init.cpp:157
+#: ../../../src/init.cpp:179
 msgid "Add a node to connect to\n"
 msgstr "添加一个连接结点\n"
 
-#: ../../../src/init.cpp:158
+#: ../../../src/init.cpp:180
 msgid "Connect only to the specified node\n"
 msgstr "只连接特定结点\n"
 
-#: ../../../src/init.cpp:159
+#: ../../../src/init.cpp:181
 msgid "Don't accept connections from outside\n"
 msgstr "不要接受外部传来的连接\n"
 
-#: ../../../src/init.cpp:162
+#: ../../../src/init.cpp:184
 msgid "Don't attempt to use UPnP to map the listening port\n"
 msgstr "不要尝试使用 UPnP 映射监听端口\n"
 
-#: ../../../src/init.cpp:164
+#: ../../../src/init.cpp:186
 msgid "Attempt to use UPnP to map the listening port\n"
 msgstr "尝试使用 UPnP 映射监听端口\n"
 
-#: ../../../src/init.cpp:167
+#: ../../../src/init.cpp:189
 msgid "Fee per KB to add to transactions you send\n"
 msgstr "您为每 KB 支付所增加的交易佣金\n"
 
-#: ../../../src/init.cpp:169
+#: ../../../src/init.cpp:191
 msgid "Accept command line and JSON-RPC commands\n"
 msgstr "允许命令行和 JSON-RPC 控制\n"
 
-#: ../../../src/init.cpp:172
+#: ../../../src/init.cpp:194
 msgid "Run in the background as a daemon and accept commands\n"
 msgstr "在后台运行并接收命令\n"
 
-#: ../../../src/init.cpp:174
+#: ../../../src/init.cpp:196
 msgid "Use the test network\n"
 msgstr "使用测试网络\n"
 
-#: ../../../src/init.cpp:175
+#: ../../../src/init.cpp:197
 msgid "Username for JSON-RPC connections\n"
 msgstr "JSON-RPC 连接的用户名\n"
 
-#: ../../../src/init.cpp:176
+#: ../../../src/init.cpp:198
 msgid "Password for JSON-RPC connections\n"
 msgstr "JSON-RPC 连接的密码\n"
 
-#: ../../../src/init.cpp:177
+#: ../../../src/init.cpp:199
 msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
 msgstr "在端口 <port> 监听 JSON-RPC 连接 (默认: 8332)\n"
 
-#: ../../../src/init.cpp:178
+#: ../../../src/init.cpp:200
 msgid "Allow JSON-RPC connections from specified IP address\n"
 msgstr "允许来自特定 IP 地址的 JSON-RPC 连接\n"
 
-#: ../../../src/init.cpp:179
+#: ../../../src/init.cpp:201
 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
+#: ../../../src/init.cpp:202
 msgid "Set key pool size to <n> (default: 100)\n"
 msgstr "设置密钥池大小为 <n> (默认: 100)\n"
 
-#: ../../../src/init.cpp:181
+#: ../../../src/init.cpp:203
 msgid "Rescan the block chain for missing wallet transactions\n"
-msgstr "重新扫描货币包链来检测丢失的货币交易\n"
+msgstr "重新扫描货币包链来检测丢失的钱包交易\n"
 
-#: ../../../src/init.cpp:185
+#: ../../../src/init.cpp:207
 msgid ""
 "\n"
 "SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
@@ -145,106 +149,79 @@ msgstr ""
 "\n"
 "SSL 选项: (SSL 设置步骤请参见 Bitcoin Wiki)\n"
 
-#: ../../../src/init.cpp:186
+#: ../../../src/init.cpp:208
 msgid "Use OpenSSL (https) for JSON-RPC connections\n"
 msgstr "使用 OpenSSL (https) 进行 JSON-RPC 连接\n"
 
-#: ../../../src/init.cpp:187
+#: ../../../src/init.cpp:209
 msgid "Server certificate file (default: server.cert)\n"
 msgstr "服务器证书 (默认: server.cert)\n"
 
-#: ../../../src/init.cpp:188
+#: ../../../src/init.cpp:210
 msgid "Server private key (default: server.pem)\n"
 msgstr "服务器私有密钥 (默认: server.pem)\n"
 
-#: ../../../src/init.cpp:189
+#: ../../../src/init.cpp:211
 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
+#: ../../../src/init.cpp:215
 msgid "This help message\n"
 msgstr "本帮助信息\n"
 
-#: ../../../src/init.cpp:330
+#: ../../../src/init.cpp:353
 #, c-format
 msgid "Cannot obtain a lock on data directory %s.  Bitcoin is probably already running."
 msgstr "无法获取数据目录 %s 的锁。 Bitcoin 可能已经启动。"
 
-#: ../../../src/init.cpp:356
+#: ../../../src/init.cpp:379
 msgid "Error loading addr.dat      \n"
 msgstr "加载 addr.dat 出错      \n"
 
-#: ../../../src/init.cpp:362
+#: ../../../src/init.cpp:385
 msgid "Error loading blkindex.dat      \n"
 msgstr "加载 blkindex.dat 出错      \n"
 
-#: ../../../src/init.cpp:369
+#: ../../../src/init.cpp:396
+msgid "Error loading wallet.dat: Wallet corrupted      \n"
+msgstr "加载 wallet.dat 出错: 钱包已损坏      \n"
+
+#: ../../../src/init.cpp:398
+msgid "Error loading wallet.dat: Wallet requires newer version of Bitcoin      \n"
+msgstr "加载 wallet.dat 出错: 钱包要求更高版本的 Bitcoin      \n"
+
+#: ../../../src/init.cpp:400
 msgid "Error loading wallet.dat      \n"
 msgstr "加载 wallet.dat 出错      \n"
 
-#: ../../../src/init.cpp:449
+#: ../../../src/init.cpp:489
 msgid "Invalid -proxy address"
 msgstr "无效 -proxy 地址"
 
-#: ../../../src/init.cpp:472
+#: ../../../src/init.cpp:514
 msgid "Invalid amount for -paytxfee=<amount>"
 msgstr "无效的金额 -paytxfee=<amount>"
 
-#: ../../../src/init.cpp:476
+#: ../../../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 "警告: -paytxfee 设置得过高。 这个参数是您发送一笔交易要支付的佣金。"
 
-#: ../../../src/main.cpp:1866
+#: ../../../src/main.cpp:1398
 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
+#: ../../../src/net.cpp:1610
 #, 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
+#: ../../../src/rpc.cpp:2005
+#: ../../../src/rpc.cpp:2007
 #, c-format
 msgid "To use the %s option"
 msgstr "使用 %s 选项"
 
-#: ../../../src/rpc.cpp:1806
+#: ../../../src/rpc.cpp:2009
 #, c-format
 msgid ""
 "Warning: %s, you must set rpcpassword=<password>\n"
@@ -255,7 +232,7 @@ msgstr ""
 "配置文件为: %s\n"
 "如果文件不存在,请创建文件并只给创建者提供只读访问权限。\n"
 
-#: ../../../src/rpc.cpp:1974
+#: ../../../src/rpc.cpp:2185
 #, c-format
 msgid ""
 "You must set rpcpassword=<password> in the configuration file:\n"
@@ -266,109 +243,195 @@ msgstr ""
 "%s\n"
 "如果文件不存在,请创建文件并只给创建者提供只读访问权限。"
 
-#: ../../../src/ui.cpp:204
+#: ../../../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 "这笔交易超过了大小限制。 您依然可以通过支付 %s 的佣金来进行,佣金用来支付为您的交易计算的结点来帮助支撑网络。 您是否要支付佣金?"
 
-#: ../../../src/ui.cpp:303
+#: ../../../src/ui.cpp:261
+#: ../../../src/ui.cpp:1247
+msgid "Enter the current passphrase to the wallet."
+msgstr "输入钱包当前的口令。"
+
+#: ../../../src/ui.cpp:262
+#: ../../../src/ui.cpp:1183
+#: ../../../src/ui.cpp:1200
+#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1272
+#: ../../../src/ui.cpp:1292
+msgid "Passphrase"
+msgstr "口令"
+
+#: ../../../src/ui.cpp:268
+msgid "Please supply the current wallet decryption passphrase."
+msgstr "请输入钱包当前的解密口令。"
+
+#: ../../../src/ui.cpp:276
+#: ../../../src/ui.cpp:1257
+#: ../../../src/ui.cpp:1314
+msgid "The passphrase entered for the wallet decryption was incorrect."
+msgstr "钱包解密口令不正确。"
+
+#: ../../../src/ui.cpp:353
 msgid "Status"
 msgstr "状态"
 
-#: ../../../src/ui.cpp:304
+#: ../../../src/ui.cpp:354
 msgid "Date"
 msgstr "日期"
 
-#: ../../../src/ui.cpp:305
+#: ../../../src/ui.cpp:355
 msgid "Description"
 msgstr "描述"
 
-#: ../../../src/ui.cpp:306
+#: ../../../src/ui.cpp:356
 msgid "Debit"
 msgstr "付款人"
 
-#: ../../../src/ui.cpp:307
+#: ../../../src/ui.cpp:357
 msgid "Credit"
 msgstr "信用"
 
-#: ../../../src/ui.cpp:513
+#: ../../../src/ui.cpp:568
 #, c-format
 msgid "Open for %d blocks"
 msgstr "%d 个货币包开放"
 
-#: ../../../src/ui.cpp:515
+#: ../../../src/ui.cpp:570
 #, c-format
 msgid "Open until %s"
 msgstr "开放直到 %s"
 
-#: ../../../src/ui.cpp:521
+#: ../../../src/ui.cpp:576
 #, c-format
 msgid "%d/offline?"
 msgstr "%d/离线?"
 
-#: ../../../src/ui.cpp:523
+#: ../../../src/ui.cpp:578
 #, c-format
 msgid "%d/unconfirmed"
 msgstr "%d/未确认"
 
-#: ../../../src/ui.cpp:525
+#: ../../../src/ui.cpp:580
 #, c-format
 msgid "%d confirmations"
 msgstr "%d 确认"
 
-#: ../../../src/ui.cpp:610
+#: ../../../src/ui.cpp:665
 msgid "Generated"
 msgstr "已生成"
 
-#: ../../../src/ui.cpp:618
+#: ../../../src/ui.cpp:673
 #, c-format
 msgid "Generated (%s matures in %d more blocks)"
 msgstr "已生成 (%s 成熟 %d 新增货币包)"
 
-#: ../../../src/ui.cpp:622
+#: ../../../src/ui.cpp:677
 msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
 msgstr "已生成 - 警告: 这个货币包没有被任何其他结点收到,因此很可能不会被接受!"
 
-#: ../../../src/ui.cpp:626
+#: ../../../src/ui.cpp:681
 msgid "Generated (not accepted)"
 msgstr "已生成 (未被接受)"
 
-#: ../../../src/ui.cpp:636
+#: ../../../src/ui.cpp:691
 msgid "From: "
 msgstr "来自: "
 
-#: ../../../src/ui.cpp:660
+#: ../../../src/ui.cpp:715
 msgid "Received with: "
 msgstr "伴随接收: "
 
-#: ../../../src/ui.cpp:706
+#: ../../../src/ui.cpp:760
 msgid "Payment to yourself"
 msgstr "支付给您自己"
 
-#: ../../../src/ui.cpp:740
+#: ../../../src/ui.cpp:794
 msgid "To: "
 msgstr "到: "
 
-#: ../../../src/ui.cpp:1055
+#: ../../../src/ui.cpp:1109
 msgid "    Generating"
 msgstr "    生成中"
 
-#: ../../../src/ui.cpp:1057
+#: ../../../src/ui.cpp:1111
 msgid "(not connected)"
 msgstr "(未连接)"
 
-#: ../../../src/ui.cpp:1060
+#: ../../../src/ui.cpp:1114
 #, c-format
 msgid "     %d connections     %d blocks     %d transactions"
 msgstr "     %d 个连接     %d 个货币包     %d 个交易 "
 
-#: ../../../src/ui.cpp:1165
-#: ../../../src/ui.cpp:2529
+#: ../../../src/ui.cpp:1171
+msgid "Wallet already encrypted."
+msgstr "钱包已加密。"
+
+#: ../../../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 ""
+"输入钱包的新口令。\n"
+"请使用 10 个或更多字符,或 8 个或更多单词的口令。"
+
+#: ../../../src/ui.cpp:1189
+#: ../../../src/ui.cpp:1280
+msgid "Error: The supplied passphrase was too short."
+msgstr "错误: 所输口令太短。"
+
+#: ../../../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 ""
+"警告: 如果您加密钱包又丢失口令,将失去全部 BITCOINS!\n"
+"是否确实想加密钱包?"
+
+#: ../../../src/ui.cpp:1199
+msgid "Please re-enter your new wallet passphrase."
+msgstr "请重新输入新的钱包口令。"
+
+#: ../../../src/ui.cpp:1208
+#: ../../../src/ui.cpp:1302
+msgid "Error: the supplied passphrases didn't match."
+msgstr "错误: 所输口令不匹配。"
+
+#: ../../../src/ui.cpp:1218
+msgid "Wallet encryption failed."
+msgstr "钱包加密失败。"
+
+#: ../../../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 ""
+"钱包已加密。\n"
+"请记住,加密钱包无法完全保护您的 bitcoins 不被计算机感染的恶意软件窃取。"
+
+#: ../../../src/ui.cpp:1236
+msgid "Wallet is unencrypted, please encrypt it first."
+msgstr "钱包未加密,请先加密。"
+
+#: ../../../src/ui.cpp:1271
+msgid "Enter the new passphrase for the wallet."
+msgstr "输入钱包的新口令。"
+
+#: ../../../src/ui.cpp:1291
+msgid "Re-enter the new passphrase for the wallet."
+msgstr "重新输入钱包的新口令。"
+
+#: ../../../src/ui.cpp:1323
+msgid "Wallet Passphrase Changed."
+msgstr "钱包口令已更改。"
+
+#: ../../../src/ui.cpp:1379
+#: ../../../src/ui.cpp:2825
 msgid "New Receiving Address"
 msgstr "新建接收地址"
 
-#: ../../../src/ui.cpp:1166
-#: ../../../src/ui.cpp:2530
+#: ../../../src/ui.cpp:1380
+#: ../../../src/ui.cpp:2826
 msgid ""
 "You should use a new address for each payment you receive.\n"
 "\n"
@@ -378,234 +441,248 @@ msgstr ""
 "\n"
 "标签"
 
-#: ../../../src/ui.cpp:1235
+#: ../../../src/ui.cpp:1464
 msgid "<b>Status:</b> "
 msgstr "<b>状态:</b> "
 
-#: ../../../src/ui.cpp:1240
+#: ../../../src/ui.cpp:1469
 msgid ", has not been successfully broadcast yet"
 msgstr ",尚未被成功广播"
 
-#: ../../../src/ui.cpp:1242
+#: ../../../src/ui.cpp:1471
 #, c-format
 msgid ", broadcast through %d node"
 msgstr ",通过 %d 个结点广播"
 
-#: ../../../src/ui.cpp:1244
+#: ../../../src/ui.cpp:1473
 #, c-format
 msgid ", broadcast through %d nodes"
 msgstr ",通过 %d 个结点广播"
 
-#: ../../../src/ui.cpp:1248
+#: ../../../src/ui.cpp:1477
 msgid "<b>Date:</b> "
 msgstr "<b>日期:</b>"
 
-#: ../../../src/ui.cpp:1256
+#: ../../../src/ui.cpp:1485
 msgid "<b>Source:</b> Generated<br>"
 msgstr "<b>来源:</b> 生成<br>"
 
-#: ../../../src/ui.cpp:1262
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1491
+#: ../../../src/ui.cpp:1508
 msgid "<b>From:</b> "
 msgstr "<b>从:</b> "
 
-#: ../../../src/ui.cpp:1280
+#: ../../../src/ui.cpp:1508
 msgid "unknown"
 msgstr "未知"
 
-#: ../../../src/ui.cpp:1281
-#: ../../../src/ui.cpp:1305
-#: ../../../src/ui.cpp:1364
+#: ../../../src/ui.cpp:1509
+#: ../../../src/ui.cpp:1533
+#: ../../../src/ui.cpp:1592
 msgid "<b>To:</b> "
 msgstr "<b>到:</b> "
 
-#: ../../../src/ui.cpp:1284
+#: ../../../src/ui.cpp:1512
 msgid " (yours, label: "
 msgstr " (您的标签: "
 
-#: ../../../src/ui.cpp:1286
+#: ../../../src/ui.cpp:1514
 msgid " (yours)"
 msgstr " (您的)"
 
-#: ../../../src/ui.cpp:1323
-#: ../../../src/ui.cpp:1335
-#: ../../../src/ui.cpp:1381
-#: ../../../src/ui.cpp:1398
+#: ../../../src/ui.cpp:1551
+#: ../../../src/ui.cpp:1563
+#: ../../../src/ui.cpp:1609
+#: ../../../src/ui.cpp:1626
 msgid "<b>Credit:</b> "
 msgstr "<b>信用:</b> "
 
-#: ../../../src/ui.cpp:1325
+#: ../../../src/ui.cpp:1553
 #, c-format
 msgid "(%s matures in %d more blocks)"
 msgstr "(%s 收获在 %d 更多的货币包)"
 
-#: ../../../src/ui.cpp:1327
+#: ../../../src/ui.cpp:1555
 msgid "(not accepted)"
 msgstr "(未被接受)"
 
-#: ../../../src/ui.cpp:1372
-#: ../../../src/ui.cpp:1380
-#: ../../../src/ui.cpp:1395
+#: ../../../src/ui.cpp:1600
+#: ../../../src/ui.cpp:1608
+#: ../../../src/ui.cpp:1623
 msgid "<b>Debit:</b> "
 msgstr "<b>付款人:</b> "
 
-#: ../../../src/ui.cpp:1386
+#: ../../../src/ui.cpp:1614
 msgid "<b>Transaction fee:</b> "
 msgstr "<b>交易佣金:</b> "
 
-#: ../../../src/ui.cpp:1402
+#: ../../../src/ui.cpp:1630
 msgid "<b>Net amount:</b> "
 msgstr "<b>网络金额:</b> "
 
-#: ../../../src/ui.cpp:1409
+#: ../../../src/ui.cpp:1637
 msgid "Message:"
 msgstr "消息:"
 
-#: ../../../src/ui.cpp:1411
+#: ../../../src/ui.cpp:1639
 msgid "Comment:"
 msgstr "评论"
 
-#: ../../../src/ui.cpp:1414
+#: ../../../src/ui.cpp:1642
 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
+#: ../../../src/ui.cpp:1826
 msgid "Cannot write autostart/bitcoin.desktop file"
 msgstr "无法写入 autostart/bitcoin.desktop 文件"
 
-#: ../../../src/ui.cpp:1630
+#: ../../../src/ui.cpp:1862
 msgid "Main"
 msgstr "主要"
 
-#: ../../../src/ui.cpp:1638
+#: ../../../src/ui.cpp:1872
 msgid "&Start Bitcoin on window system startup"
 msgstr "开机自动启动 Bitcoin(&S)"
 
-#: ../../../src/ui.cpp:1645
+#: ../../../src/ui.cpp:1879
 msgid "&Minimize on close"
 msgstr "关闭时最小化(&M)"
 
-#: ../../../src/ui.cpp:1787
+#: ../../../src/ui.cpp:2021
 #, c-format
 msgid "version %s"
 msgstr "版本 %s"
 
-#: ../../../src/ui.cpp:1899
+#: ../../../src/ui.cpp:2144
 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
+#: ../../../src/ui.cpp:2144
+#: ../../../src/ui.cpp:2149
+#: ../../../src/ui.cpp:2154
+#: ../../../src/ui.cpp:2207
+#: ../../../src/uibase.cpp:61
 msgid "Send Coins"
 msgstr "发送货币"
 
-#: ../../../src/ui.cpp:1904
+#: ../../../src/ui.cpp:2149
 msgid "Amount exceeds your balance  "
 msgstr "金额超出您的账户余额"
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2154
 msgid "Total exceeds your balance when the "
 msgstr "总费用超出您的账户余额当 "
 
-#: ../../../src/ui.cpp:1909
+#: ../../../src/ui.cpp:2154
 msgid " transaction fee is included  "
 msgstr " 交易佣金已包括"
 
-#: ../../../src/ui.cpp:1927
+#: ../../../src/ui.cpp:2181
 msgid "Payment sent  "
 msgstr "付款已发送"
 
-#: ../../../src/ui.cpp:1944
+#: ../../../src/ui.cpp:2181
+#: ../../../src/ui.cpp:2191
+#: ../../../src/ui.cpp:2341
+#: ../../../src/ui.cpp:2506
+#: ../../../src/wallet.cpp:1088
+msgid "Sending..."
+msgstr "正在发送..."
+
+#: ../../../src/ui.cpp:2207
 msgid "Invalid address  "
 msgstr "无效地址  "
 
-#: ../../../src/ui.cpp:1997
+#: ../../../src/ui.cpp:2262
 #, c-format
 msgid "Sending %s to %s"
 msgstr "发送 %s 给 %s"
 
-#: ../../../src/ui.cpp:2070
-#: ../../../src/ui.cpp:2103
+#: ../../../src/ui.cpp:2335
+#: ../../../src/ui.cpp:2368
 msgid "CANCELLED"
 msgstr "已取消"
 
-#: ../../../src/ui.cpp:2074
+#: ../../../src/ui.cpp:2339
 msgid "Cancelled"
 msgstr "已取消"
 
-#: ../../../src/ui.cpp:2076
+#: ../../../src/ui.cpp:2341
 msgid "Transfer cancelled  "
 msgstr "传输已取消  "
 
-#: ../../../src/ui.cpp:2129
+#: ../../../src/ui.cpp:2394
 msgid "Error: "
 msgstr "错误: "
 
-#: ../../../src/ui.cpp:2148
+#: ../../../src/ui.cpp:2408
+#: ../../../src/ui.cpp:2477
+#: ../../../src/wallet.cpp:1106
+msgid "Insufficient funds"
+msgstr "余额不足"
+
+#: ../../../src/ui.cpp:2413
 msgid "Connecting..."
 msgstr "正在连接..."
 
-#: ../../../src/ui.cpp:2153
+#: ../../../src/ui.cpp:2418
 msgid "Unable to connect"
 msgstr "无法连接"
 
-#: ../../../src/ui.cpp:2158
+#: ../../../src/ui.cpp:2423
 msgid "Requesting public key..."
 msgstr "正在请求公共密钥..."
 
-#: ../../../src/ui.cpp:2170
+#: ../../../src/ui.cpp:2435
 msgid "Received public key..."
 msgstr "收到公共密钥..."
 
-#: ../../../src/ui.cpp:2184
+#: ../../../src/ui.cpp:2449
 msgid "Recipient is not accepting transactions sent by IP address"
 msgstr "收款人不接受来自 IP 地址的交易"
 
-#: ../../../src/ui.cpp:2186
+#: ../../../src/ui.cpp:2451
 msgid "Transfer was not accepted"
 msgstr "传输没有被接受"
 
-#: ../../../src/ui.cpp:2195
+#: ../../../src/ui.cpp:2460
 msgid "Invalid response received"
 msgstr "接收到无效回复"
 
-#: ../../../src/ui.cpp:2210
+#: ../../../src/ui.cpp:2473
 msgid "Creating transaction..."
 msgstr "正在创建交易..."
 
-#: ../../../src/ui.cpp:2222
+#: ../../../src/ui.cpp:2496
 #, 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
+#: ../../../src/ui.cpp:2498
 msgid "Transaction creation failed"
 msgstr "交易创建失败"
 
-#: ../../../src/ui.cpp:2231
+#: ../../../src/ui.cpp:2508
 msgid "Transaction aborted"
 msgstr "交易中止"
 
-#: ../../../src/ui.cpp:2239
+#: ../../../src/ui.cpp:2516
 msgid "Lost connection, transaction cancelled"
 msgstr "失去连接,交易已取消"
 
-#: ../../../src/ui.cpp:2255
+#: ../../../src/ui.cpp:2532
 msgid "Sending payment..."
 msgstr "正在发送付款..."
 
-#: ../../../src/ui.cpp:2261
+#: ../../../src/ui.cpp:2544
 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 文件,而且货币在另一个副本里使用但没有在这里标记。"
+msgstr "交易被拒绝。 这可能是因为您账户中的一部分货币已经被使用,比如您使用了一个复制的 wallet.dat 文件,而且货币在另一个副本里支付但没有在这里标记。"
 
-#: ../../../src/ui.cpp:2270
+#: ../../../src/ui.cpp:2553
 msgid "Waiting for confirmation..."
 msgstr "正在等待确认..."
 
-#: ../../../src/ui.cpp:2288
+#: ../../../src/ui.cpp:2570
 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"
@@ -615,84 +692,84 @@ msgstr ""
 "交易已经被记录,并且支付给收款人,\n"
 "但是评论信息可能是空的。"
 
-#: ../../../src/ui.cpp:2297
+#: ../../../src/ui.cpp:2579
 msgid "Payment was sent, but an invalid response was received"
 msgstr "支付已发送,但是收到无效回复"
 
-#: ../../../src/ui.cpp:2303
+#: ../../../src/ui.cpp:2585
 msgid "Payment completed"
 msgstr "付款完成"
 
-#: ../../../src/ui.cpp:2334
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2627
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
 msgid "Name"
 msgstr "姓名"
 
-#: ../../../src/ui.cpp:2335
-#: ../../../src/ui.cpp:2480
-#: ../../../src/ui.cpp:2517
+#: ../../../src/ui.cpp:2628
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2813
 msgid "Address"
 msgstr "地址"
 
-#: ../../../src/ui.cpp:2337
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2630
+#: ../../../src/ui.cpp:2785
 msgid "Label"
 msgstr "标签"
 
-#: ../../../src/ui.cpp:2338
-#: ../../../src/uibase.cpp:837
+#: ../../../src/ui.cpp:2631
+#: ../../../src/uibase.cpp:847
 msgid "Bitcoin Address"
 msgstr "Bitcoin 地址"
 
-#: ../../../src/ui.cpp:2462
+#: ../../../src/ui.cpp:2755
 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
+#: ../../../src/ui.cpp:2773
+#: ../../../src/ui.cpp:2779
 msgid "Edit Address"
 msgstr "编辑地址"
 
-#: ../../../src/ui.cpp:2492
+#: ../../../src/ui.cpp:2785
 msgid "Edit Address Label"
 msgstr "编辑地址标签"
 
-#: ../../../src/ui.cpp:2517
-#: ../../../src/ui.cpp:2523
+#: ../../../src/ui.cpp:2813
+#: ../../../src/ui.cpp:2819
 msgid "Add Address"
 msgstr "添加地址"
 
-#: ../../../src/ui.cpp:2600
+#: ../../../src/ui.cpp:2906
 msgid "Bitcoin"
 msgstr "Bitcoin"
 
-#: ../../../src/ui.cpp:2602
+#: ../../../src/ui.cpp:2908
 msgid "Bitcoin - Generating"
 msgstr "Bitcoin - 生成中"
 
-#: ../../../src/ui.cpp:2604
+#: ../../../src/ui.cpp:2910
 msgid "Bitcoin - (not connected)"
 msgstr "Bitcoin - (未连接)"
 
-#: ../../../src/ui.cpp:2683
+#: ../../../src/ui.cpp:2989
 msgid "&Open Bitcoin"
 msgstr "打开 Bitcoin(&O)"
 
-#: ../../../src/ui.cpp:2684
+#: ../../../src/ui.cpp:2990
 msgid "&Send Bitcoins"
 msgstr "发送 Bitcoins(&S)"
 
-#: ../../../src/ui.cpp:2685
+#: ../../../src/ui.cpp:2991
 msgid "O&ptions..."
 msgstr "选项(&P)..."
 
-#: ../../../src/ui.cpp:2688
+#: ../../../src/ui.cpp:2994
 #: ../../../src/uibase.cpp:25
 msgid "E&xit"
 msgstr "退出(&X)"
 
-#: ../../../src/ui.cpp:2904
+#: ../../../src/ui.cpp:3220
 msgid "Program has crashed and will terminate.  "
 msgstr "程序崩溃,即将关闭。 "
 
@@ -704,152 +781,160 @@ msgstr "文件(&F)"
 msgid "&Your Receiving Addresses..."
 msgstr "您的接收地址(&Y)..."
 
-#: ../../../src/uibase.cpp:36
+#: ../../../src/uibase.cpp:35
+msgid "&Encrypt Wallet..."
+msgstr "加密钱包(&E)..."
+
+#: ../../../src/uibase.cpp:38
+msgid "&Change Wallet Encryption Passphrase..."
+msgstr "更改钱包加密口令(&C)..."
+
+#: ../../../src/uibase.cpp:42
 msgid "&Options..."
 msgstr "选项(&O)..."
 
-#: ../../../src/uibase.cpp:39
+#: ../../../src/uibase.cpp:45
 msgid "&Settings"
 msgstr "设置(&S)"
 
-#: ../../../src/uibase.cpp:43
+#: ../../../src/uibase.cpp:49
 msgid "&About..."
 msgstr "关于(&A)..."
 
-#: ../../../src/uibase.cpp:46
+#: ../../../src/uibase.cpp:52
 msgid "&Help"
 msgstr "帮助(&H)"
 
-#: ../../../src/uibase.cpp:56
+#: ../../../src/uibase.cpp:62
 msgid "Address Book"
 msgstr "地址簿"
 
-#: ../../../src/uibase.cpp:69
+#: ../../../src/uibase.cpp:75
 msgid "Your Bitcoin Address:"
 msgstr "您的 Bitcoin 地址:"
 
-#: ../../../src/uibase.cpp:76
+#: ../../../src/uibase.cpp:82
 msgid " &New... "
 msgstr " 新建(&N)... "
 
-#: ../../../src/uibase.cpp:79
-#: ../../../src/uibase.cpp:780
-#: ../../../src/uibase.cpp:883
+#: ../../../src/uibase.cpp:85
+#: ../../../src/uibase.cpp:790
+#: ../../../src/uibase.cpp:893
 msgid " &Copy to Clipboard "
 msgstr " 复制到剪贴板(&C)"
 
-#: ../../../src/uibase.cpp:93
+#: ../../../src/uibase.cpp:99
 msgid "Balance:"
 msgstr "账户余额:"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " All"
 msgstr "全部"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Sent"
 msgstr " 已发送"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " Received"
 msgstr " 已接收"
 
-#: ../../../src/uibase.cpp:109
+#: ../../../src/uibase.cpp:115
 msgid " In Progress"
 msgstr "处理中"
 
-#: ../../../src/uibase.cpp:130
+#: ../../../src/uibase.cpp:136
 msgid "All Transactions"
 msgstr "所有交易"
 
-#: ../../../src/uibase.cpp:141
+#: ../../../src/uibase.cpp:147
 msgid "Sent/Received"
 msgstr "已发送/已接收"
 
-#: ../../../src/uibase.cpp:152
+#: ../../../src/uibase.cpp:158
 msgid "Sent"
 msgstr "已发送"
 
-#: ../../../src/uibase.cpp:163
+#: ../../../src/uibase.cpp:169
 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
+#: ../../../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 "确定"
 
-#: ../../../src/uibase.cpp:345
+#: ../../../src/uibase.cpp:355
 msgid "&Start Bitcoin on system startup"
 msgstr "开机自动启动(&S)"
 
-#: ../../../src/uibase.cpp:348
+#: ../../../src/uibase.cpp:358
 msgid "&Minimize to the tray instead of the taskbar"
 msgstr "最小化到系统托盘(&M)"
 
-#: ../../../src/uibase.cpp:351
+#: ../../../src/uibase.cpp:361
 msgid "Map port using &UPnP"
 msgstr "使用 &UPnP 映射端口"
 
-#: ../../../src/uibase.cpp:354
+#: ../../../src/uibase.cpp:364
 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:370
+msgid "&Connect through socks4 proxy (requires restart to apply): "
+msgstr "通过 socks4 代理连接 (重启生效) (&C): "
 
-#: ../../../src/uibase.cpp:371
+#: ../../../src/uibase.cpp:381
 msgid "Proxy &IP:"
 msgstr "代理服务器(&I):"
 
-#: ../../../src/uibase.cpp:379
+#: ../../../src/uibase.cpp:389
 msgid " &Port:"
 msgstr " 端口(&P):"
 
-#: ../../../src/uibase.cpp:392
+#: ../../../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 "可以选择按照KB支付交易佣金来确保您的交易得到迅速处理。 大多数交易需要 1KB。 建议支付 0.01。"
 
-#: ../../../src/uibase.cpp:399
+#: ../../../src/uibase.cpp:409
 msgid "Pay transaction fee:"
 msgstr "支付交易佣金:"
 
-#: ../../../src/uibase.cpp:420
+#: ../../../src/uibase.cpp:430
 msgid "// [don't translate] Test panel 2 for future expansion"
 msgstr ""
 
-#: ../../../src/uibase.cpp:424
+#: ../../../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:446
-#: ../../../src/uibase.cpp:668
-#: ../../../src/uibase.cpp:727
-#: ../../../src/uibase.cpp:786
-#: ../../../src/uibase.cpp:895
-#: ../../../src/uibase.cpp:984
+#: ../../../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 "取消"
 
-#: ../../../src/uibase.cpp:449
+#: ../../../src/uibase.cpp:459
 msgid "&Apply"
 msgstr "应用(&A)"
 
-#: ../../../src/uibase.cpp:508
+#: ../../../src/uibase.cpp:518
 msgid "Bitcoin "
 msgstr "Bitcoin "
 
-#: ../../../src/uibase.cpp:514
+#: ../../../src/uibase.cpp:524
 msgid "version"
 msgstr "版本"
 
-#: ../../../src/uibase.cpp:525
+#: ../../../src/uibase.cpp:535
 msgid ""
 "Copyright (c) 2009-2011 Bitcoin Developers\n"
 "\n"
@@ -870,39 +955,39 @@ msgstr ""
 "(http://www.openssl.org/),以及 Eric Young(eay@cryptsoft.com)\n"
 "编写的加密软件和 Thomas Bernard 编写的 UPnP 软件。"
 
-#: ../../../src/uibase.cpp:581
+#: ../../../src/uibase.cpp:591
 msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 msgstr "输入 Bitcoin 地址 (比如 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
 
-#: ../../../src/uibase.cpp:595
+#: ../../../src/uibase.cpp:605
 msgid "Pay &To:"
 msgstr "付款给(&T):"
 
-#: ../../../src/uibase.cpp:610
+#: ../../../src/uibase.cpp:620
 msgid "&Paste"
 msgstr "粘贴(&P)"
 
-#: ../../../src/uibase.cpp:613
+#: ../../../src/uibase.cpp:623
 msgid " Address &Book..."
 msgstr " 地址簿(&B)..."
 
-#: ../../../src/uibase.cpp:620
+#: ../../../src/uibase.cpp:630
 msgid "&Amount:"
 msgstr "数量(&A):"
 
-#: ../../../src/uibase.cpp:630
+#: ../../../src/uibase.cpp:640
 msgid "T&ransfer:"
 msgstr "传输(&R):"
 
-#: ../../../src/uibase.cpp:636
+#: ../../../src/uibase.cpp:646
 msgid " Standard"
 msgstr "标准"
 
-#: ../../../src/uibase.cpp:663
+#: ../../../src/uibase.cpp:673
 msgid "&Send"
 msgstr "发送(&S)"
 
-#: ../../../src/uibase.cpp:711
+#: ../../../src/uibase.cpp:721
 msgid ""
 "\n"
 "\n"
@@ -912,56 +997,80 @@ msgstr ""
 "\n"
 "正在连接..."
 
-#: ../../../src/uibase.cpp:761
+#: ../../../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 "这些是您用来接收付款的 Bitcoin 地址。 您可能需要给每一个付款人一个不同的地址从而可以最终每一笔交易是谁支付的。 下面高亮的地址是您的主窗口正在使用的地址。"
 
-#: ../../../src/uibase.cpp:774
-#: ../../../src/uibase.cpp:886
+#: ../../../src/uibase.cpp:784
+#: ../../../src/uibase.cpp:896
 msgid "&Edit..."
 msgstr "编辑(&E)..."
 
-#: ../../../src/uibase.cpp:777
-#: ../../../src/uibase.cpp:889
+#: ../../../src/uibase.cpp:787
+#: ../../../src/uibase.cpp:899
 msgid " &New Address... "
 msgstr " 新建地址(&N)..."
 
-#: ../../../src/uibase.cpp:849
+#: ../../../src/uibase.cpp:859
 msgid "Sending"
 msgstr "发送人地址"
 
-#: ../../../src/uibase.cpp:857
+#: ../../../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 "这些是您用来接收付款的 Bitcoin 地址。 您可以给每一个付款人一个不同的地址从而可以最终每一笔交易是谁支付的。 下面高亮的地址是您的主窗口正在使用的地址。"
 
-#: ../../../src/uibase.cpp:870
+#: ../../../src/uibase.cpp:880
 msgid "Receiving"
 msgstr "我的接收地址"
 
-#: ../../../src/uibase.cpp:880
+#: ../../../src/uibase.cpp:890
 msgid "&Delete"
 msgstr "删除(&D)"
 
-#: ../../../src/util.cpp:866
+#: ../../../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 "警告: 请检查您的电脑日期和时间是否正确。 如果您的时钟不正确 Bitcoin 将无法正常工作。"
 
-#: ../../../src/util.cpp:899
+#: ../../../src/util.cpp:904
 msgid "beta"
 msgstr "测试版"
 
-#: ../../../src/uibase.h:147
+#: ../../../src/wallet.cpp:1073
+msgid "Error: Wallet locked, unable to create transaction  "
+msgstr "错误: 钱包已锁定,无法创建交易  "
+
+#: ../../../src/wallet.cpp:1081
+#, 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/wallet.cpp:1083
+msgid "Error: Transaction creation failed  "
+msgstr "错误: 交易创建失败"
+
+#: ../../../src/wallet.cpp:1092
+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/wallet.cpp:1104
+msgid "Invalid amount"
+msgstr "无效金额"
+
+#: ../../../src/uibase.h:151
 msgid "Transaction Details"
 msgstr "交易详情"
 
-#: ../../../src/uibase.h:199
+#: ../../../src/uibase.h:203
 msgid "Options"
 msgstr "选项"
 
-#: ../../../src/uibase.h:228
+#: ../../../src/uibase.h:232
 msgid "About Bitcoin"
 msgstr "关于 Bitcoin"
 
-#: ../../../src/uibase.h:337
+#: ../../../src/uibase.h:341
 msgid "Your Bitcoin Addresses"
 msgstr "您的 Bitcoin 地址"
+
+#~ msgid "Invalid bitcoin address"
+#~ msgstr "无效 bitcoin 地址"
index cdec9a0..6192680 100644 (file)
Binary files a/share/pixmaps/bitcoin.ico and b/share/pixmaps/bitcoin.ico differ
diff --git a/share/pixmaps/nsis-header.bmp b/share/pixmaps/nsis-header.bmp
new file mode 100644 (file)
index 0000000..9ab0ce2
Binary files /dev/null and b/share/pixmaps/nsis-header.bmp differ
diff --git a/share/pixmaps/nsis-wizard.bmp b/share/pixmaps/nsis-wizard.bmp
new file mode 100644 (file)
index 0000000..71255c6
Binary files /dev/null and b/share/pixmaps/nsis-wizard.bmp differ
index 8677d33..6cf4777 100644 (file)
@@ -1,15 +1,20 @@
 Name Bitcoin\r
 \r
 RequestExecutionLevel highest\r
+SetCompressor /SOLID lzma\r
 \r
 # General Symbol Definitions\r
 !define REGKEY "SOFTWARE\$(^Name)"\r
-!define VERSION 0.3.24\r
+!define VERSION 0.4.00\r
 !define COMPANY "Bitcoin project"\r
 !define URL http://www.bitcoin.org/\r
 \r
 # MUI Symbol Definitions\r
 !define MUI_ICON "../share/pixmaps/bitcoin.ico"\r
+!define MUI_WELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"\r
+!define MUI_HEADERIMAGE\r
+!define MUI_HEADERIMAGE_RIGHT\r
+!define MUI_HEADERIMAGE_BITMAP "../share/pixmaps/nsis-header.bmp"\r
 !define MUI_FINISHPAGE_NOAUTOCLOSE\r
 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM\r
 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}\r
@@ -17,6 +22,7 @@ RequestExecutionLevel highest
 !define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin\r
 !define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe\r
 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"\r
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"\r
 !define MUI_UNFINISHPAGE_NOAUTOCLOSE\r
 \r
 # Included files\r
@@ -39,12 +45,13 @@ Var StartMenuGroup
 !insertmacro MUI_LANGUAGE English\r
 \r
 # Installer attributes\r
-OutFile bitcoin-0.3.24-win32-setup.exe\r
+OutFile bitcoin-0.4.00-win32-setup.exe\r
 InstallDir $PROGRAMFILES\Bitcoin\r
 CRCCheck on\r
 XPStyle on\r
+BrandingText " "\r
 ShowInstDetails show\r
-VIProductVersion 0.3.24.0\r
+VIProductVersion 0.4.00.0\r
 VIAddVersionKey ProductName Bitcoin\r
 VIAddVersionKey ProductVersion "${VERSION}"\r
 VIAddVersionKey CompanyName "${COMPANY}"\r
index d9d4638..7d2c258 100644 (file)
                         <property name="checked">0</property>\r
                         <property name="enabled">1</property>\r
                         <property name="help"></property>\r
+                        <property name="id">wxID_ANY</property>\r
+                        <property name="kind">wxITEM_NORMAL</property>\r
+                        <property name="label">&amp;Encrypt Wallet...</property>\r
+                        <property name="name">m_menuOptionsEncryptWallet</property>\r
+                        <property name="permission">public</property>\r
+                        <property name="shortcut"></property>\r
+                        <property name="unchecked_bitmap"></property>\r
+                        <event name="OnMenuSelection">OnMenuOptionsEncryptWallet</event>\r
+                        <event name="OnUpdateUI"></event>\r
+                    </object>\r
+                    <object class="wxMenuItem" expanded="1">\r
+                        <property name="bitmap"></property>\r
+                        <property name="checked">0</property>\r
+                        <property name="enabled">1</property>\r
+                        <property name="help"></property>\r
+                        <property name="id">wxID_ANY</property>\r
+                        <property name="kind">wxITEM_NORMAL</property>\r
+                        <property name="label">&amp;Change Wallet Encryption Passphrase...</property>\r
+                        <property name="name">m_menuOptionsChangeWalletPassphrase</property>\r
+                        <property name="permission">public</property>\r
+                        <property name="shortcut"></property>\r
+                        <property name="unchecked_bitmap"></property>\r
+                        <event name="OnMenuSelection">OnMenuOptionsChangeWalletPassphrase</event>\r
+                        <event name="OnUpdateUI"></event>\r
+                    </object>\r
+                    <object class="wxMenuItem" expanded="1">\r
+                        <property name="bitmap"></property>\r
+                        <property name="checked">0</property>\r
+                        <property name="enabled">1</property>\r
+                        <property name="help"></property>\r
                         <property name="id">wxID_PREFERENCES</property>\r
                         <property name="kind">wxITEM_NORMAL</property>\r
                         <property name="label">&amp;Options...</property>\r
                                                                 <property name="font"></property>\r
                                                                 <property name="hidden">0</property>\r
                                                                 <property name="id">wxID_ANY</property>\r
-                                                                <property name="label">&amp;Connect through socks4 proxy: </property>\r
+                                                                <property name="label">&amp;Connect through socks4 proxy (requires restart to apply): </property>\r
                                                                 <property name="maximum_size"></property>\r
                                                                 <property name="minimum_size"></property>\r
                                                                 <property name="name">m_checkBoxUseProxy</property>\r
index c2729d4..592756f 100644 (file)
@@ -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.
 
@@ -159,52 +160,149 @@ inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>
 
 
 
-#define ADDRESSVERSION   ((unsigned char)(fTestNet ? 111 : 0))
-
-inline std::string Hash160ToAddress(uint160 hash160)
+class CBase58Data
 {
-    // add 1-byte version number to the front
-    std::vector<unsigned char> vch(1, ADDRESSVERSION);
-    vch.insert(vch.end(), UBEGIN(hash160), UEND(hash160));
-    return EncodeBase58Check(vch);
-}
+protected:
+    unsigned char nVersion;
+    std::vector<unsigned char> vchData;
 
-inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
-{
-    std::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);
-}
+    CBase58Data()
+    {
+        nVersion = 0;
+        vchData.clear();
+    }
 
-inline bool AddressToHash160(const std::string& str, uint160& hash160Ret)
-{
-    return AddressToHash160(str.c_str(), hash160Ret);
-}
+    ~CBase58Data()
+    {
+        if (!vchData.empty())
+            memset(&vchData[0], 0, vchData.size());
+    }
 
-inline bool IsValidBitcoinAddress(const char* psz)
-{
-    uint160 hash160;
-    return AddressToHash160(psz, hash160);
-}
+    void SetData(int nVersionIn, const void* pdata, size_t nSize)
+    {
+        nVersion = nVersionIn;
+        vchData.resize(nSize);
+        if (!vchData.empty())
+            memcpy(&vchData[0], pdata, nSize);
+    }
 
-inline bool IsValidBitcoinAddress(const std::string& str)
-{
-    return IsValidBitcoinAddress(str.c_str());
-}
+    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; }
+};
 
 
-inline std::string PubKeyToAddress(const std::vector<unsigned char>& vchPubKey)
+class CBitcoinAddress : public CBase58Data
 {
-    return Hash160ToAddress(Hash160(vchPubKey));
-}
+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
index 5eaa402..1a2406b 100644 (file)
@@ -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.
 #ifndef BITCOIN_BIGNUM_H
diff --git a/src/crypter.cpp b/src/crypter.cpp
new file mode 100644 (file)
index 0000000..9a8e6ca
--- /dev/null
@@ -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 (file)
index 0000000..5b95ea4
--- /dev/null
@@ -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
index 3e46804..8789dc3 100644 (file)
@@ -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)
 {
index f044355..a22b17e 100644 (file)
@@ -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.
 
@@ -528,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);
@@ -610,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)
@@ -627,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();
@@ -640,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;
@@ -670,7 +669,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
 }
 
 
-bool CWalletDB::LoadWallet(CWallet* pwallet)
+int CWalletDB::LoadWallet(CWallet* pwallet)
 {
     pwallet->vchDefaultKey.clear();
     int nFileVersion = 0;
@@ -684,13 +683,12 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
 #endif
 
     //// todo: shouldn't we catch exceptions and try to recover and continue?
-    CRITICAL_BLOCK(pwallet->cs_mapWallet)
-    CRITICAL_BLOCK(pwallet->cs_mapKeys)
+    CRITICAL_BLOCK(pwallet->cs_wallet)
     {
         // Get cursor
         Dbc* pcursor = GetCursor();
         if (!pcursor)
-            return false;
+            return DB_CORRUPT;
 
         loop
         {
@@ -701,7 +699,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
             if (ret == DB_NOTFOUND)
                 break;
             else if (ret != 0)
-                return false;
+                return DB_CORRUPT;
 
             // Unserialize
             // Taking advantage of the fact that pair serialization
@@ -765,14 +763,42 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
             {
                 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;
-
-                pwallet->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")
             {
@@ -800,7 +826,6 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
                 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;
@@ -809,6 +834,13 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
                 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();
     }
@@ -819,7 +851,6 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
     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);
@@ -839,7 +870,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
     }
 
 
-    return true;
+    return DB_LOAD_OK;
 }
 
 void ThreadFlushWalletDB(void* parg)
index b89b34e..73ea190 100644 (file)
--- a/src/db.h
+++ b/src/db.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.
 #ifndef BITCOIN_DB_H
@@ -88,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);
@@ -117,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);
@@ -342,6 +343,14 @@ public:
 
 
 
+enum DBErrors
+{
+    DB_LOAD_OK,
+    DB_CORRUPT,
+    DB_TOO_NEW,
+    DB_LOAD_FAIL,
+};
+
 class CWalletDB : public CDB
 {
 public:
@@ -391,6 +400,25 @@ public:
         return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false);
     }
 
+    bool WriteCryptedKey(const std::vector<unsigned char>& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, bool fEraseUnencryptedKey = true)
+    {
+        nWalletDBUpdated++;
+        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 WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
+    {
+        nWalletDBUpdated++;
+        return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
+    }
+
     bool WriteBestBlock(const CBlockLocator& locator)
     {
         nWalletDBUpdated++;
@@ -450,7 +478,7 @@ public:
     int64 GetAccountCreditDebit(const std::string& strAccount);
     void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
 
-    bool LoadWallet(CWallet* pwallet);
+    int LoadWallet(CWallet* pwallet);
 };
 
 #endif
index d1844eb..d0c7434 100644 (file)
@@ -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.
 
index 3062dc9..9d845a6 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -250,7 +251,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++)
@@ -390,8 +392,16 @@ bool AppInit2(int argc, char* argv[])
     nStart = GetTimeMillis();
     bool fFirstRun;
     pwalletMain = new CWallet("wallet.dat");
-    if (!pwalletMain->LoadWallet(fFirstRun))
-        strErrors += _("Error loading wallet.dat      \n");
+    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);
@@ -419,9 +429,7 @@ 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",         pwalletMain->mapKeys.size());
         printf("setKeyPool.size() = %d\n",      pwalletMain->setKeyPool.size());
-        printf("mapPubKeys.size() = %d\n",      mapPubKeys.size());
         printf("mapWallet.size() = %d\n",       pwalletMain->mapWallet.size());
         printf("mapAddressBook.size() = %d\n",  pwalletMain->mapAddressBook.size());
 
index a02260c..4017f25 100644 (file)
@@ -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.
 #ifndef BITCOIN_INIT_H
index cde934e..5278488 100644 (file)
@@ -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.
 
index 18e5359..6945b2c 100644 (file)
--- a/src/irc.h
+++ b/src/irc.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.
 #ifndef BITCOIN_IRC_H
index c973d6e..d2e6689 100644 (file)
--- a/src/key.h
+++ b/src/key.h
@@ -1,13 +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.
 #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;
 // const unsigned int PUBLIC_KEY_SIZE  = 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
@@ -42,8 +85,7 @@ public:
 
 // secure_allocator is defined in serialize.h
 typedef std::vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
-
-
+typedef std::vector<unsigned char, secure_allocator<unsigned char> > CSecret;
 
 class CKey
 {
@@ -102,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);
@@ -155,20 +229,9 @@ public:
         return true;
     }
 
-    static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, std::vector<unsigned char>& vchSig)
-    {
-        CKey key;
-        if (!key.SetPrivKey(vchPrivKey))
-            return false;
-        return key.Sign(hash, vchSig);
-    }
-
-    static bool Verify(const std::vector<unsigned char>& vchPubKey, uint256 hash, const std::vector<unsigned char>& vchSig)
+    CBitcoinAddress GetAddress() const
     {
-        CKey key;
-        if (!key.SetPubKey(vchPubKey))
-            return false;
-        return key.Verify(hash, vchSig);
+        return CBitcoinAddress(GetPubKey());
     }
 };
 
index 7dd045f..68f57e7 100644 (file)
-// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers
+// 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;
+}
 
-//////////////////////////////////////////////////////////////////////////////
-//
-// mapKeys
-//
+bool CCryptoKeyStore::SetCrypted()
+{
+    CRITICAL_BLOCK(cs_KeyStore)
+    {
+        if (fUseCrypto)
+            return true;
+        if (!mapKeys.empty())
+            return false;
+        fUseCrypto = true;
+    }
+    return true;
+}
 
-std::vector<unsigned char> CKeyStore::GenerateNewKey()
+std::vector<unsigned char> CCryptoKeyStore::GenerateNewKey()
 {
     RandAddSeedPerfmon();
     CKey key;
     key.MakeNewKey();
     if (!AddKey(key))
-        throw std::runtime_error("GenerateNewKey() : AddKey failed");
+        throw std::runtime_error("CCryptoKeyStore::GenerateNewKey() : AddKey failed");
     return key.GetPubKey();
 }
 
-bool CKeyStore::AddKey(const CKey& key)
+bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
+{
+    CRITICAL_BLOCK(cs_KeyStore)
+    {
+        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)
+    {
+        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_mapKeys)
+    CRITICAL_BLOCK(cs_KeyStore)
     {
-        mapKeys[key.GetPubKey()] = key.GetPrivKey();
-        mapPubKeys[Hash160(key.GetPubKey())] = key.GetPubKey();
+        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_KeyStore)
+    {
+        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)
+    {
+        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;
+}
index 6080d7d..bbfac83 100644 (file)
-// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers
+// 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
 {
+protected:
+    mutable CCriticalSection cs_KeyStore;
+
+public:
+    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:
-    std::map<std::vector<unsigned char>, CPrivKey> mapKeys;
-    mutable CCriticalSection cs_mapKeys;
-    virtual bool AddKey(const CKey& key);
-    bool HaveKey(const std::vector<unsigned char> &vchPubKey) const
+    bool AddKey(const CKey& key);
+    bool HaveKey(const CBitcoinAddress &address) const
     {
-        return (mapKeys.count(vchPubKey) > 0);
+        bool result;
+        CRITICAL_BLOCK(cs_KeyStore)
+            result = (mapKeys.count(address) > 0);
+        return result;
     }
-    bool GetPrivKey(const std::vector<unsigned char> &vchPubKey, CPrivKey& keyOut) const
+    bool GetKey(const CBitcoinAddress &address, CKey& keyOut) const
     {
-        std::map<std::vector<unsigned char>, CPrivKey>::const_iterator mi = mapKeys.find(vchPubKey);
-        if (mi != mapKeys.end())
+        CRITICAL_BLOCK(cs_KeyStore)
         {
-            keyOut = (*mi).second;
-            return true;
+            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();
+
+    // will encrypt previously unencrypted keys
+    bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
+
+    bool Unlock(const CKeyingMaterial& vMasterKeyIn);
+
+public:
+    CCryptoKeyStore() : fUseCrypto(false)
+    {
+    }
+
+    bool IsCrypted() const
+    {
+        return fUseCrypto;
+    }
+
+    bool IsLocked() const
+    {
+        if (!IsCrypted())
+            return false;
+        bool result;
+        CRITICAL_BLOCK(cs_KeyStore)
+            result = vMasterKey.empty();
+        return result;
+    }
+
+    bool Lock()
+    {
+        if (!SetCrypted())
+            return false;
+
+        CRITICAL_BLOCK(cs_KeyStore)
+            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
+    {
+        CRITICAL_BLOCK(cs_KeyStore)
+        {
+            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
index 10536a5..d528612 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -22,17 +23,14 @@ set<CWallet*> setpwalletRegistered;
 
 CCriticalSection cs_main;
 
-CCriticalSection cs_mapPubKeys;
-map<uint160, vector<unsigned char> > mapPubKeys;
-
-map<uint256, CTransaction> mapTransactions;
+static map<uint256, CTransaction> mapTransactions;
 CCriticalSection cs_mapTransactions;
 unsigned int nTransactionsUpdated = 0;
 map<COutPoint, CInPoint> mapNextTx;
 
 map<uint256, CBlockIndex*> mapBlockIndex;
 uint256 hashGenesisBlock("0x00000000e74ef41733382f8a94d41bf29f20c6c48a7ab489e1fab0ab719bf676");
-CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
+static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
 const int nTotalBlocksEstimate = 0; // 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;
@@ -56,7 +54,6 @@ int64 nHPSTimerStart;
 // Settings
 int fGenerateBitcoins = false;
 int64 nTransactionFee = MIN_TX_FEE;
-CAddress addrIncoming;
 int fLimitProcessors = false;
 int nLimitProcessors = 1;
 int fMinimizeToTray = true;
@@ -299,9 +296,10 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
 bool CTransaction::CheckTransaction() const
 {
     // Basic checks that don't depend on any context
-    if (vin.empty() || vout.empty())
-        return error("CTransaction::CheckTransaction() : vin or vout empty");
-
+    if (vin.empty())
+        return error("CTransaction::CheckTransaction() : vin empty");
+    if (vout.empty())
+        return error("CTransaction::CheckTransaction() : vout empty");
     // Size limits
     if (::GetSerializeSize(*this, SER_NETWORK) > MAX_BLOCK_SIZE)
         return error("CTransaction::CheckTransaction() : size limits failed");
@@ -319,6 +317,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)
@@ -786,7 +793,7 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
             // Read txindex
             CTxIndex txindex;
             bool fFound = true;
-            if (fMiner && mapTestPool.count(prevout.hash))
+            if ((fBlock || fMiner) && mapTestPool.count(prevout.hash))
             {
                 // Get txindex from current proposed changes
                 txindex = mapTestPool[prevout.hash];
@@ -846,12 +853,7 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
             txindex.vSpent[prevout.n] = posThisTx;
 
             // Write back
-            if (fBlock)
-            {
-                if (!txdb.UpdateTxIndex(prevout.hash, txindex))
-                    return error("ConnectInputs() : UpdateTxIndex failed");
-            }
-            else if (fMiner)
+            if (fBlock || fMiner)
             {
                 mapTestPool[prevout.hash] = txindex;
             }
@@ -873,9 +875,8 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
 
     if (fBlock)
     {
-        // Add transaction to disk index
-        if (!txdb.AddTxIndex(*this, posThisTx, pindexBlock->nHeight))
-            return error("ConnectInputs() : AddTxPos failed");
+        // Add transaction to changes
+        mapTestPool[GetHash()] = CTxIndex(posThisTx, vout.size());
     }
     else if (fMiner)
     {
@@ -964,16 +965,22 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
     //// issue here: it doesn't know the version
     unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size());
 
-    map<uint256, CTxIndex> mapUnused;
+    map<uint256, CTxIndex> mapQueuedChanges;
     int64 nFees = 0;
     BOOST_FOREACH(CTransaction& tx, vtx)
     {
         CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos);
         nTxPos += ::GetSerializeSize(tx, SER_DISK);
 
-        if (!tx.ConnectInputs(txdb, mapUnused, posThisTx, pindex, nFees, true, false))
+        if (!tx.ConnectInputs(txdb, mapQueuedChanges, posThisTx, pindex, nFees, true, false))
             return false;
     }
+    // Write queued txindex changes
+    for (map<uint256, CTxIndex>::iterator mi = mapQueuedChanges.begin(); mi != mapQueuedChanges.end(); ++mi)
+    {
+        if (!txdb.UpdateTxIndex((*mi).first, (*mi).second))
+            return error("ConnectBlock() : UpdateTxIndex failed");
+    }
 
     if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees))
         return false;
@@ -1286,7 +1293,7 @@ bool CBlock::AcceptBlock()
     if (hashBestChain == hash)
         CRITICAL_BLOCK(cs_vNodes)
             BOOST_FOREACH(CNode* pnode, vNodes)
-                if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 134444))
+                if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 140700))
                     pnode->PushInventory(CInv(MSG_BLOCK, hash));
 
     return true;
@@ -1353,47 +1360,6 @@ bool static ProcessBlock(CNode* pfrom, CBlock* pblock)
 
 
 
-template<typename Stream>
-bool static 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;
@@ -1663,7 +1629,7 @@ string GetWarnings(string strFor)
         return strStatusBar;
     else if (strFor == "rpc")
         return strRPC;
-    assert(("GetWarnings() : invalid parameter", false));
+    assert(!"GetWarnings() : invalid parameter");
     return "error";
 }
 
@@ -1744,16 +1710,17 @@ bool static 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 };
+unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
 
 
 bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
 {
     static map<unsigned int, vector<unsigned char> > mapReuseKey;
     RandAddSeedPerfmon();
-    if (fDebug)
+    if (fDebug) {
         printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
-    printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
+        printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
+    }
     if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
     {
         printf("dropmessagestest DROPPING RECV MESSAGE\n");
@@ -1830,7 +1797,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
 
         // Ask the first connected node for block updates
         static int nAskedForBlocks;
-        if (!pfrom->fClient && (nAskedForBlocks < 1 || vNodes.size() <= 1))
+        if (!pfrom->fClient &&
+            (pfrom->nVersion < 32000 || pfrom->nVersion >= 32400) &&
+             (nAskedForBlocks < 1 || vNodes.size() <= 1))
         {
             nAskedForBlocks++;
             pfrom->PushGetBlocks(pindexBest, uint256(0));
@@ -1874,6 +1843,8 @@ bool static 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;
         BOOST_FOREACH(CAddress& addr, vAddr)
@@ -1885,7 +1856,7 @@ bool static 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())
             {
@@ -1916,6 +1887,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
                 }
             }
         }
+        addrDB.TxnCommit();  // Save addresses (it's ok if this fails)
         if (vAddr.size() < 1000)
             pfrom->fGetAddr = false;
     }
@@ -1936,7 +1908,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
             pfrom->AddInventoryKnown(inv);
 
             bool fAlreadyHave = AlreadyHave(txdb, inv);
-            printf("  got inventory: %s  %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new");
+            if (fDebug)
+                printf("  got inventory: %s  %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new");
 
             if (!fAlreadyHave)
                 pfrom->AskFor(inv);
@@ -2187,7 +2160,7 @@ bool static 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] = pwalletMain->GetKeyFromKeyPool();
+            pwalletMain->GetKeyFromPool(mapReuseKey[pfrom->addr.ip], true);
 
         // Send back approval of order and pubkey to use
         CScript scriptPubKey;
@@ -2542,6 +2515,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
                     vGetData.clear();
                 }
             }
+            mapAlreadyAskedFor[inv] = nNow;
             pto->mapAskFor.erase(pto->mapAskFor.begin());
         }
         if (!vGetData.empty())
@@ -2628,7 +2602,7 @@ unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1
     }
 }
 
-
+// Some explaining would be appreciated
 class COrphan
 {
 public:
@@ -2798,16 +2772,17 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
 }
 
 
-void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce, int64& nPrevTime)
+void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
 {
     // Update nExtraNonce
-    int64 nNow = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
-    if (++nExtraNonce >= 0x7f && nNow > nPrevTime+1)
+    static uint256 hashPrevBlock;
+    if (hashPrevBlock != pblock->hashPrevBlock)
     {
-        nExtraNonce = 1;
-        nPrevTime = nNow;
+        nExtraNonce = 0;
+        hashPrevBlock = pblock->hashPrevBlock;
     }
-    pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nBits << CBigNum(nExtraNonce);
+    ++nExtraNonce;
+    pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nTime << CBigNum(nExtraNonce);
     pblock->hashMerkleRoot = pblock->BuildMerkleTree();
 }
 
@@ -2883,7 +2858,7 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
         reservekey.KeepKey();
 
         // Track how many getdata requests this block gets
-        CRITICAL_BLOCK(wallet.cs_mapRequestCount)
+        CRITICAL_BLOCK(wallet.cs_wallet)
             wallet.mapRequestCount[pblock->GetHash()] = 0;
 
         // Process this block the same as if we had received it from another node
@@ -2905,7 +2880,6 @@ void static BitcoinMiner(CWallet *pwallet)
     // Each thread has its own key and counter
     CReserveKey reservekey(pwallet);
     unsigned int nExtraNonce = 0;
-    int64 nPrevTime = 0;
 
     while (fGenerateBitcoins)
     {
@@ -2932,7 +2906,7 @@ void static BitcoinMiner(CWallet *pwallet)
         auto_ptr<CBlock> pblock(CreateNewBlock(reservekey));
         if (!pblock.get())
             return;
-        IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce, nPrevTime);
+        IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce);
 
         printf("Running BitcoinMiner with %d transactions in block\n", pblock->vtx.size());
 
index e9912ab..6c53c76 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -21,7 +22,6 @@ class CKeyItem;
 class CReserveKey;
 class CWalletDB;
 
-class CMessageHeader;
 class CAddress;
 class CInv;
 class CRequestTracker;
@@ -38,6 +38,8 @@ static const int64 MIN_RELAY_TX_FEE = 10000;
 static const int64 MAX_MONEY = 800000000000000 * 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
@@ -52,7 +54,6 @@ static const int fHaveUPnP = false;
 extern CCriticalSection cs_main;
 extern std::map<uint256, CBlockIndex*> mapBlockIndex;
 extern uint256 hashGenesisBlock;
-extern CBigNum bnProofOfWorkLimit;
 extern CBlockIndex* pindexGenesisBlock;
 extern int nBestHeight;
 extern CBigNum bnBestChainWork;
@@ -69,7 +70,6 @@ extern std::set<CWallet*> setpwalletRegistered;
 // Settings
 extern int fGenerateBitcoins;
 extern int64 nTransactionFee;
-extern CAddress addrIncoming;
 extern int fLimitProcessors;
 extern int nLimitProcessors;
 extern int fMinimizeToTray;
@@ -95,7 +95,7 @@ bool ProcessMessages(CNode* pfrom);
 bool SendMessages(CNode* pto, bool fSendTrickle);
 void GenerateBitcoins(bool fGenerate, CWallet* pwallet);
 CBlock* CreateNewBlock(CReserveKey& reservekey);
-void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce, int64& nPrevTime);
+void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
 void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
 bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
 bool CheckProofOfWork(uint256 hash, unsigned int nBits);
@@ -442,7 +442,7 @@ 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;
         BOOST_FOREACH(const CTxIn& txin, vin)
             if (!txin.IsFinal())
@@ -1557,18 +1557,4 @@ public:
     bool ProcessAlert();
 };
 
-
-
-
-
-
-
-
-
-
-
-extern std::map<uint256, CTransaction> mapTransactions;
-extern std::map<uint160, std::vector<unsigned char> > mapPubKeys;
-extern CCriticalSection cs_mapPubKeys;
-
 #endif
index 3fb18ff..24cc127 100644 (file)
@@ -4,20 +4,22 @@
 
 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)/boost_1_47_0" \
+ -I"$(DEPSDIR)/db-4.8.30.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)/wxWidgets-2.9.2/lib/gcc_lib/mswud" \
+ -I"$(DEPSDIR)/wxWidgets-2.9.2/include" \
+ -I"$(DEPSDIR)/wxWidgets-2.9.2/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)/boost_1_47_0/stage/lib" \
+ -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
  -L"$(DEPSDIR)/openssl-1.0.0d" \
- -L"$(DEPSDIR)/wxWidgets-2.9.1/lib"
+ -L"$(DEPSDIR)/wxWidgets-2.9.2/lib"
 
 WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc
 
@@ -30,41 +32,54 @@ LIBS= \
  -l ssl \
  -l crypto
 
-DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
+DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
 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 init.h
-
-bitcoin.exe: USE_UPNP:=1
-       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
-
-bitcoind.exe: USE_UPNP:=0
-       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
+HEADERS = \
+    base58.h \
+    bignum.h \
+    crypter.h \
+    db.h \
+    headers.h \
+    init.h \
+    irc.h \
+    key.h \
+    keystore.h \
+    main.h \
+    net.h \
+    noui.h \
+    protocol.h \
+    rpc.h \
+    script.h \
+    serialize.h \
+    strlcpy.h \
+    ui.h \
+    uibase.h \
+    uint256.h \
+    util.h \
+    wallet.h
+
+ifdef USE_UPNP
+       LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
+       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/crypter.o \
     obj/db.o \
-    obj/net.o \
+    obj/init.o \
     obj/irc.o \
     obj/keystore.o \
     obj/main.o \
-    obj/wallet.o \
+    obj/net.o \
+    obj/protocol.o \
     obj/rpc.o \
-    obj/init.o \
+    obj/script.o \
+    obj/util.o \
+    obj/wallet.o \
     cryptopp/obj/sha.o \
     cryptopp/obj/cpu.o
 
@@ -95,7 +110,7 @@ bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
 obj/test/%.o: obj/test/%.cpp $(HEADERS)
        i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
 
-test_bitcoin.exe: obj/test/test_bitcoin.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
 
 
index 507833b..1ca1a7b 100644 (file)
@@ -5,39 +5,60 @@
 USE_UPNP:=0
 
 INCLUDEPATHS= \
- -I"C:\boost-1.43.0-mgw" \
- -I"C:\db-4.7.25.NC-mgw\build_unix" \
+ -I"C:\boost-1.47.0-mgw" \
+ -I"C:\db-4.8.30.NC-mgw\build_unix" \
  -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"
+ -I"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib\mswud" \
+ -I"C:\wxWidgets-2.9.2-mgw\include"
 
 LIBPATHS= \
- -L"C:\boost-1.43.0-mgw\stage\lib" \
- -L"C:\db-4.7.25.NC-mgw\build_unix" \
+ -L"C:\boost-1.47.0-mgw\stage\lib" \
+ -L"C:\db-4.8.30.NC-mgw\build_unix" \
  -L"C:\openssl-1.0.0d-mgw" \
- -L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib"
+ -L"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib"
 
 WXLIBS= \
  -l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
 
 LIBS= \
- -l boost_system-mgw45-mt-s-1_43 \
- -l boost_filesystem-mgw45-mt-s-1_43 \
- -l boost_program_options-mgw45-mt-s-1_43 \
- -l boost_thread-mgw45-mt-s-1_43 \
+ -l boost_system-mgw45-mt-s-1_47 \
+ -l boost_filesystem-mgw45-mt-s-1_47 \
+ -l boost_program_options-mgw45-mt-s-1_47 \
+ -l boost_thread-mgw45-mt-s-1_47 \
  -l db_cxx \
  -l ssl \
  -l crypto
 
-DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
+DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
 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 keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h init.h
+HEADERS = \
+    base58.h \
+    bignum.h \
+    crypter.h \
+    db.h \
+    headers.h \
+    init.h \
+    irc.h \
+    key.h \
+    keystore.h \
+    main.h \
+    net.h \
+    noui.h \
+    protocol.h \
+    rpc.h \
+    script.h \
+    serialize.h \
+    strlcpy.h \
+    ui.h \
+    uibase.h \
+    uint256.h \
+    util.h \
+    wallet.h
 
 ifdef USE_UPNP
- INCLUDEPATHS += -I"C:\upnpc-exe-win32-20110215"
- LIBPATHS += -L"C:\upnpc-exe-win32-20110215"
+ INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
+ LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
  LIBS += -l miniupnpc -l iphlpapi
  DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
 endif
@@ -45,16 +66,18 @@ endif
 LIBS += -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/crypter.o \
     obj/db.o \
-    obj/net.o \
+    obj/init.o \
     obj/irc.o \
     obj/keystore.o \
     obj/main.o \
-    obj/wallet.o \
+    obj/net.o \
+    obj/protocol.o \
     obj/rpc.o \
-    obj/init.o \
+    obj/script.o \
+    obj/util.o \
+    obj/wallet.o \
     cryptopp/obj/sha.o \
     cryptopp/obj/cpu.o
 
@@ -81,10 +104,10 @@ obj/nogui/%.o: %.cpp $(HEADERS)
 bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
        g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
 
-obj/test/%.o: obj/test/%.cpp $(HEADERS)
-       g++ -c $(CFLAGS) -o $@ $<
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+       g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
 
-test_bitcoin: obj/test/test_bitcoin.o
+test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
        g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
 
 clean:
index 784596b..97264c7 100644 (file)
@@ -32,20 +32,43 @@ DEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -D__WXMAC_OSX__ -DNOPCH -DMSG_
 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 keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h init.h
+HEADERS = \
+    base58.h \
+    bignum.h \
+    crypter.h \
+    db.h \
+    headers.h \
+    init.h \
+    irc.h \
+    key.h \
+    keystore.h \
+    main.h \
+    net.h \
+    noui.h \
+    protocol.h \
+    rpc.h \
+    script.h \
+    serialize.h \
+    strlcpy.h \
+    ui.h \
+    uibase.h \
+    uint256.h \
+    util.h \
+    wallet.h
 
 OBJS= \
-    obj/util.o \
-    obj/script.o \
+    obj/crypter.o \
     obj/db.o \
-    obj/net.o \
+    obj/init.o \
     obj/irc.o \
     obj/keystore.o \
     obj/main.o \
-    obj/wallet.o \
+    obj/net.o \
+    obj/protocol.o \
     obj/rpc.o \
-    obj/init.o \
+    obj/script.o \
+    obj/util.o \
+    obj/wallet.o \
     cryptopp/obj/sha.o \
     cryptopp/obj/cpu.o
 
@@ -74,10 +97,10 @@ obj/nogui/%.o: %.cpp $(HEADERS)
 bitcoind: $(OBJS:obj/%=obj/nogui/%)
        $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
 
-obj/test/%.o: test/%.cpp $(HEADERS)
-       $(CXX) -c $(CFLAGS) -o $@ $<
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+       $(CXX) -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
 
-test_bitcoin: obj/test/test_bitcoin.o
+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:
index 76fead4..5dbde3a 100644 (file)
@@ -11,7 +11,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= \
@@ -39,20 +39,43 @@ LIBS+= \
 
 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 keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h init.h
+HEADERS = \
+    base58.h \
+    bignum.h \
+    crypter.h \
+    db.h \
+    headers.h \
+    init.h \
+    irc.h \
+    key.h \
+    keystore.h \
+    main.h \
+    net.h \
+    noui.h \
+    protocol.h \
+    rpc.h \
+    script.h \
+    serialize.h \
+    strlcpy.h \
+    ui.h \
+    uibase.h \
+    uint256.h \
+    util.h \
+    wallet.h
 
 OBJS= \
-    obj/util.o \
-    obj/script.o \
+    obj/crypter.o \
     obj/db.o \
-    obj/net.o \
+    obj/init.o \
     obj/irc.o \
     obj/keystore.o \
     obj/main.o \
-    obj/wallet.o \
+    obj/net.o \
+    obj/protocol.o \
     obj/rpc.o \
-    obj/init.o \
+    obj/script.o \
+    obj/util.o \
+    obj/wallet.o \
     cryptopp/obj/sha.o \
     cryptopp/obj/cpu.o
 
@@ -76,11 +99,11 @@ obj/nogui/%.o: %.cpp $(HEADERS)
 bitcoind: $(OBJS:obj/%=obj/nogui/%)
        $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
 
-obj/test/%.o: test/%.cpp $(HEADERS)
-       $(CXX) -c $(CFLAGS) -o $@ $<
+obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
+       $(CXX) -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
 
-test_bitcoin: obj/test/test_bitcoin.o
-       $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
+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 genesis
index b25ba60..a5437bc 100644 (file)
@@ -41,24 +41,49 @@ 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
+  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
 
 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 wallet.h keystore.h
+HEADERS = \
+    base58.h \
+    bignum.h \
+    crypter.h \
+    db.h \
+    headers.h \
+    init.h \
+    irc.h \
+    key.h \
+    keystore.h \
+    main.h \
+    net.h \
+    noui.h \
+    protocol.h \
+    rpc.h \
+    script.h \
+    serialize.h \
+    strlcpy.h \
+    ui.h \
+    uibase.h \
+    uint256.h \
+    util.h \
+    wallet.h
 
 OBJS= \
-    obj\util.obj \
-    obj\script.obj \
-    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.o \
+    obj\db.o \
+    obj\init.o \
+    obj\irc.o \
+    obj\keystore.o \
+    obj\main.o \
+    obj\net.o \
+    obj\rpc.o \
+    obj\protocol.o \
+    obj\script.o \
+    obj\util.o \
+    obj\wallet.o \
+    cryptopp\obj\sha.o \
+    cryptopp\obj\cpu.o
 
 CRYPTOPP_OBJS= \
     cryptopp\obj\sha.obj \
@@ -93,6 +118,8 @@ obj\rpc.obj: $(HEADERS)
 
 obj\init.obj: $(HEADERS)
 
+obj\crypter.obj: $(HEADERS)
+
 obj\ui.obj: $(HEADERS)
 
 obj\uibase.obj: $(HEADERS)
index d91a429..0656c65 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
 
 #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
@@ -50,10 +46,10 @@ bool fClient = false;
 bool fAllowDNS = false;
 uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
 CAddress addrLocalHost("0.0.0.0", 0, false, nLocalServices);
-CNode* pnodeLocalHost = NULL;
+static CNode* pnodeLocalHost = NULL;
 uint64 nLocalHostNonce = 0;
 array<int, 10> vnThreadsRunning;
-SOCKET hListenSocket = INVALID_SOCKET;
+static SOCKET hListenSocket = INVALID_SOCKET;
 
 vector<CNode*> vNodes;
 CCriticalSection cs_vNodes;
@@ -99,7 +95,7 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout
     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
@@ -441,13 +437,17 @@ void ThreadGetMyExternalIP(void* parg)
 
 
 
-bool AddAddress(CAddress addr, int64 nTimePenalty)
+bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
 {
     if (!addr.IsRoutable())
         return false;
     if (addr.ip == addrLocalHost.ip)
         return false;
     addr.nTime = max((int64)0, (int64)addr.nTime - nTimePenalty);
+    bool fUpdated = false;
+    bool fNew = false;
+    CAddress addrFound = addr;
+
     CRITICAL_BLOCK(cs_mapAddresses)
     {
         map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey());
@@ -456,13 +456,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
             // New address
             printf("AddAddress(%s)\n", addr.ToString().c_str());
             mapAddresses.insert(make_pair(addr.GetKey(), addr));
-            CAddrDB().WriteAddress(addr);
-            return true;
+            fUpdated = true;
+            fNew = true;
         }
         else
         {
-            bool fUpdated = false;
-            CAddress& addrFound = (*it).second;
+            addrFound = (*it).second;
             if ((addrFound.nServices | addr.nServices) != addrFound.nServices)
             {
                 // Services have been added
@@ -477,11 +476,22 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
                 addrFound.nTime = addr.nTime;
                 fUpdated = true;
             }
-            if (fUpdated)
-                CAddrDB().WriteAddress(addrFound);
         }
     }
-    return false;
+    // There is a nasty deadlock bug if this is done inside the cs_mapAddresses
+    // CRITICAL_BLOCK:
+    // Thread 1:  begin db transaction (locks inside-db-mutex)
+    //            then AddAddress (locks cs_mapAddresses)
+    // Thread 2:  AddAddress (locks cs_mapAddresses)
+    //             ... then db operation hangs waiting for inside-db-mutex
+    if (fUpdated)
+    {
+        if (pAddrDB)
+            pAddrDB->WriteAddress(addrFound);
+        else
+            CAddrDB().WriteAddress(addrFound);
+    }
+    return fNew;
 }
 
 void AddressCurrentlyConnected(const CAddress& addr)
@@ -832,7 +842,7 @@ void ThreadSocketHandler2(void* parg)
         {
             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);
@@ -1071,10 +1081,11 @@ void ThreadMapPort2(void* parg)
     const char * rootdescurl = 0;
     const char * multicastif = 0;
     const char * minissdpdpath = 0;
+    int error = 0;
     struct UPNPDev * devlist = 0;
     char lanaddr[64];
 
-    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);
+    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
 
     struct UPNPUrls urls;
     struct IGDdatas data;
@@ -1085,14 +1096,10 @@ void ThreadMapPort2(void* parg)
     {
         char intClient[16];
         char intPort[6];
-
-#ifndef __WXMSW__
-        r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
-                               port, port, lanaddr, 0, "TCP", 0);
-#else
+        string strDesc = "Bitcoin " + FormatFullVersion();
         r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
-                               port, port, lanaddr, 0, "TCP", 0, "0");
-#endif
+                               port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
+
         if(r!=UPNPCOMMAND_SUCCESS)
             printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
                 port, port, lanaddr, r, strupnperror(r));
@@ -1135,6 +1142,11 @@ void MapPort(bool fMapPort)
             printf("Error: ThreadMapPort(ThreadMapPort) failed\n");
     }
 }
+#else
+void MapPort(bool /* unused fMapPort */)
+{
+    // Intentionally left blank.
+}
 #endif
 
 
@@ -1157,6 +1169,8 @@ void DNSAddressSeed()
     if (!fTestNet)
     {
         printf("Loading addresses from DNS seeds (could take a while)\n");
+        CAddrDB addrDB;
+        addrDB.TxnBegin();
 
         for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
             vector<CAddress> vaddr;
@@ -1167,12 +1181,14 @@ void DNSAddressSeed()
                     if (addr.GetByte(3) != 127)
                     {
                         addr.nTime = 0;
-                        AddAddress(addr);
+                        AddAddress(addr, 0, &addrDB);
                         found++;
                     }
                 }
             }
         }
+
+        addrDB.TxnCommit();  // Save addresses (it's ok if this fails)
     }
 
     printf("%d addresses found from DNS seeds\n", found);
@@ -1275,7 +1291,6 @@ void ThreadOpenConnections2(void* parg)
         CRITICAL_BLOCK(cs_mapAddresses)
         {
             // Add seed nodes if IRC isn't working
-            static bool fSeedUsed;
             bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
             if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR) && !fTestNet)
             {
@@ -1283,40 +1298,14 @@ void ThreadOpenConnections2(void* parg)
                 {
                     // It'll only connect to one or two seed nodes because once it connects,
                     // it'll get a pile of addresses with newer timestamps.
+                    // Seed nodes are given a random 'last seen time' of between one and two
+                    // weeks ago.
+                    const int64 nOneWeek = 7*24*60*60;
                     CAddress addr;
                     addr.ip = pnSeed[i];
-                    addr.nTime = 0;
+                    addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
                     AddAddress(addr);
                 }
-                fSeedUsed = true;
-            }
-
-            if (fSeedUsed && mapAddresses.size() > ARRAYLEN(pnSeed) + 100)
-            {
-                // Disconnect seed nodes
-                set<unsigned int> setSeed(pnSeed, pnSeed + ARRAYLEN(pnSeed));
-                static int64 nSeedDisconnected;
-                if (nSeedDisconnected == 0)
-                {
-                    nSeedDisconnected = GetTime();
-                    CRITICAL_BLOCK(cs_vNodes)
-                        BOOST_FOREACH(CNode* pnode, vNodes)
-                            if (setSeed.count(pnode->addr.ip))
-                                pnode->fDisconnect = true;
-                }
-
-                // Keep setting timestamps to 0 so they won't reconnect
-                if (GetTime() - nSeedDisconnected < 60 * 60)
-                {
-                    BOOST_FOREACH(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
-                    {
-                        if (setSeed.count(item.second.ip) && item.second.nTime != 0)
-                        {
-                            item.second.nTime = 0;
-                            CAddrDB().WriteAddress(item.second);
-                        }
-                    }
-                }
             }
         }
 
@@ -1526,7 +1515,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
@@ -1660,7 +1649,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);
 
     // Initiate outbound connections
     if (!CreateThread(ThreadOpenConnections, NULL))
index afa264b..0026e40 100644 (file)
--- a/src/net.h
+++ b/src/net.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.
 #ifndef BITCOIN_NET_H
@@ -6,15 +7,16 @@
 
 #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 CInv;
+#include "protocol.h"
+
+class CAddrDB;
 class CRequestTracker;
 class CNode;
 class CBlockIndex;
@@ -25,21 +27,13 @@ extern int nConnectTimeout;
 
 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
-{
-    NODE_NETWORK = (1 << 0),
-};
-
-
-
 
 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);
@@ -51,402 +45,12 @@ bool BindListenPort(std::string& strError=REF(std::string()));
 void StartNode(void* parg);
 bool StopNode();
 
-
-
-
-
-
-
-
-//
-// Message header
-//  (4) message start
-//  (12) command
-//  (4) size
-//  (4) checksum
-
-extern char pchMessageStart[4];
-
-class CMessageHeader
-{
-public:
-    enum { COMMAND_SIZE=12 };
-    char pchMessageStart[sizeof(::pchMessageStart)];
-    char pchCommand[COMMAND_SIZE];
-    unsigned int nMessageSize;
-    unsigned int nChecksum;
-
-    CMessageHeader()
-    {
-        memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
-        memset(pchCommand, 0, sizeof(pchCommand));
-        pchCommand[1] = 1;
-        nMessageSize = -1;
-        nChecksum = 0;
-    }
-
-    CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn)
-    {
-        memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
-        strncpy(pchCommand, pszCommand, COMMAND_SIZE);
-        nMessageSize = nMessageSizeIn;
-        nChecksum = 0;
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        READWRITE(FLATDATA(pchMessageStart));
-        READWRITE(FLATDATA(pchCommand));
-        READWRITE(nMessageSize);
-        if (nVersion >= 209)
-            READWRITE(nChecksum);
-    )
-
-    std::string GetCommand()
-    {
-        if (pchCommand[COMMAND_SIZE-1] == 0)
-            return std::string(pchCommand, pchCommand + strlen(pchCommand));
-        else
-            return std::string(pchCommand, pchCommand + COMMAND_SIZE);
-    }
-
-    bool IsValid()
-    {
-        // Check start string
-        if (memcmp(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart)) != 0)
-            return false;
-
-        // Check the command string for errors
-        for (char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; p1++)
-        {
-            if (*p1 == 0)
-            {
-                // Must be all zeros after the first zero
-                for (; p1 < pchCommand + COMMAND_SIZE; p1++)
-                    if (*p1 != 0)
-                        return false;
-            }
-            else if (*p1 < ' ' || *p1 > 0x7E)
-                return false;
-        }
-
-        // Message size
-        if (nMessageSize > MAX_SIZE)
-        {
-            printf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand().c_str(), nMessageSize);
-            return false;
-        }
-
-        return true;
-    }
-};
-
-
-
-
-
-
-static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
-
-class CAddress
-{
-public:
-    uint64 nServices;
-    unsigned char pchReserved[12];
-    unsigned int ip;
-    unsigned short port;
-
-    // disk and network only
-    unsigned int nTime;
-
-    // memory only
-    unsigned int nLastTry;
-
-    CAddress()
-    {
-        Init();
-    }
-
-    CAddress(unsigned int ipIn, unsigned short portIn=0, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        ip = ipIn;
-        port = htons(portIn == 0 ? GetDefaultPort() : portIn);
-        nServices = nServicesIn;
-    }
-
-    explicit CAddress(const struct sockaddr_in& sockaddr, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        ip = sockaddr.sin_addr.s_addr;
-        port = sockaddr.sin_port;
-        nServices = nServicesIn;
-    }
-
-    explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        Lookup(pszIn, *this, nServicesIn, fNameLookup, portIn);
-    }
-
-    explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        Lookup(pszIn, *this, nServicesIn, fNameLookup, 0, true);
-    }
-
-    explicit CAddress(std::string strIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, portIn);
-    }
-
-    explicit CAddress(std::string strIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
-    {
-        Init();
-        Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, 0, true);
-    }
-
-    void Init()
-    {
-        nServices = NODE_NETWORK;
-        memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
-        ip = INADDR_NONE;
-        port = htons(GetDefaultPort());
-        nTime = 100000000;
-        nLastTry = 0;
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        if (fRead)
-            const_cast<CAddress*>(this)->Init();
-        if (nType & SER_DISK)
-            READWRITE(nVersion);
-        if ((nType & SER_DISK) || (nVersion >= 31402 && !(nType & SER_GETHASH)))
-            READWRITE(nTime);
-        READWRITE(nServices);
-        READWRITE(FLATDATA(pchReserved)); // for IPv6
-        READWRITE(ip);
-        READWRITE(port);
-    )
-
-    friend inline bool operator==(const CAddress& a, const CAddress& b)
-    {
-        return (memcmp(a.pchReserved, b.pchReserved, sizeof(a.pchReserved)) == 0 &&
-                a.ip   == b.ip &&
-                a.port == b.port);
-    }
-
-    friend inline bool operator!=(const CAddress& a, const CAddress& b)
-    {
-        return (!(a == b));
-    }
-
-    friend inline bool operator<(const CAddress& a, const CAddress& b)
-    {
-        int ret = memcmp(a.pchReserved, b.pchReserved, sizeof(a.pchReserved));
-        if (ret < 0)
-            return true;
-        else if (ret == 0)
-        {
-            if (ntohl(a.ip) < ntohl(b.ip))
-                return true;
-            else if (a.ip == b.ip)
-                return ntohs(a.port) < ntohs(b.port);
-        }
-        return false;
-    }
-
-    std::vector<unsigned char> GetKey() const
-    {
-        CDataStream ss;
-        ss.reserve(18);
-        ss << FLATDATA(pchReserved) << ip << port;
-
-        #if defined(_MSC_VER) && _MSC_VER < 1300
-        return std::vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
-        #else
-        return std::vector<unsigned char>(ss.begin(), ss.end());
-        #endif
-    }
-
-    struct sockaddr_in GetSockAddr() const
-    {
-        struct sockaddr_in sockaddr;
-        memset(&sockaddr, 0, sizeof(sockaddr));
-        sockaddr.sin_family = AF_INET;
-        sockaddr.sin_addr.s_addr = ip;
-        sockaddr.sin_port = port;
-        return sockaddr;
-    }
-
-    bool IsIPv4() const
-    {
-        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() &&
-            !(IsRFC1918() || IsRFC3927() || IsLocal());
-    }
-
-    bool IsValid() const
-    {
-        // Clean up 3-byte shifted addresses caused by garbage in size field
-        // of addr messages from versions before 0.2.9 checksum.
-        // Two consecutive addr messages look like this:
-        // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
-        // so if the first length field is garbled, it reads the second batch
-        // of addr misaligned by 3 bytes.
-        if (memcmp(pchReserved, pchIPv4+3, sizeof(pchIPv4)-3) == 0)
-            return false;
-
-        return (ip != 0 && ip != INADDR_NONE && port != htons(USHRT_MAX));
-    }
-
-    unsigned char GetByte(int n) const
-    {
-        return ((unsigned char*)&ip)[3-n];
-    }
-
-    std::string ToStringIPPort() const
-    {
-        return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
-    }
-
-    std::string ToStringIP() const
-    {
-        return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0));
-    }
-
-    std::string ToStringPort() const
-    {
-        return strprintf("%u", ntohs(port));
-    }
-
-    std::string ToString() const
-    {
-        return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
-    }
-
-    void print() const
-    {
-        printf("CAddress(%s)\n", ToString().c_str());
-    }
-};
-
-
-
-
-
-
-
 enum
 {
     MSG_TX = 1,
     MSG_BLOCK,
 };
 
-static const char* ppszTypeName[] =
-{
-    "ERROR",
-    "tx",
-    "block",
-};
-
-class CInv
-{
-public:
-    int type;
-    uint256 hash;
-
-    CInv()
-    {
-        type = 0;
-        hash = 0;
-    }
-
-    CInv(int typeIn, const uint256& hashIn)
-    {
-        type = typeIn;
-        hash = hashIn;
-    }
-
-    CInv(const std::string& strType, const uint256& hashIn)
-    {
-        int i;
-        for (i = 1; i < ARRAYLEN(ppszTypeName); i++)
-        {
-            if (strType == ppszTypeName[i])
-            {
-                type = i;
-                break;
-            }
-        }
-        if (i == ARRAYLEN(ppszTypeName))
-            throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType.c_str()));
-        hash = hashIn;
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        READWRITE(type);
-        READWRITE(hash);
-    )
-
-    friend inline bool operator<(const CInv& a, const CInv& b)
-    {
-        return (a.type < b.type || (a.type == b.type && a.hash < b.hash));
-    }
-
-    bool IsKnownType() const
-    {
-        return (type >= 1 && type < ARRAYLEN(ppszTypeName));
-    }
-
-    const char* GetCommand() const
-    {
-        if (!IsKnownType())
-            throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type));
-        return ppszTypeName[type];
-    }
-
-    std::string ToString() const
-    {
-        return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
-    }
-
-    void print() const
-    {
-        printf("CInv(%s)\n", ToString().c_str());
-    }
-};
-
-
-
-
-
 class CRequestTracker
 {
 public:
@@ -473,10 +77,8 @@ extern bool fClient;
 extern bool fAllowDNS;
 extern uint64 nLocalServices;
 extern CAddress addrLocalHost;
-extern CNode* pnodeLocalHost;
 extern uint64 nLocalHostNonce;
 extern boost::array<int, 10> vnThreadsRunning;
-extern SOCKET hListenSocket;
 
 extern std::vector<CNode*> vNodes;
 extern CCriticalSection cs_vNodes;
@@ -674,15 +276,16 @@ public:
 
     void BeginMessage(const char* pszCommand)
     {
-        cs_vSend.Enter();
+        cs_vSend.Enter("cs_vSend", __FILE__, __LINE__);
         if (nHeaderStart != -1)
             AbortMessage();
         nHeaderStart = vSend.size();
         vSend << CMessageHeader(pszCommand, 0);
         nMessageStart = vSend.size();
-        if (fDebug)
+        if (fDebug) {
             printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
-        printf("sending: %s ", pszCommand);
+            printf("sending: %s ", pszCommand);
+        }
     }
 
     void AbortMessage()
@@ -693,7 +296,9 @@ public:
         nHeaderStart = -1;
         nMessageStart = -1;
         cs_vSend.Leave();
-        printf("(aborted)\n");
+
+        if (fDebug)
+            printf("(aborted)\n");
     }
 
     void EndMessage()
@@ -722,8 +327,9 @@ public:
             memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum));
         }
 
-        printf("(%d bytes) ", nSize);
-        printf("\n");
+        if (fDebug) {
+            printf("(%d bytes)\n", nSize);
+        }
 
         nHeaderStart = -1;
         nMessageStart = -1;
index d0072df..cbe6fa4 100644 (file)
@@ -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.
 #ifndef BITCOIN_NOUI_H
diff --git a/src/protocol.cpp b/src/protocol.cpp
new file mode 100644 (file)
index 0000000..48784b9
--- /dev/null
@@ -0,0 +1,312 @@
+// 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 "protocol.h"
+#include "util.h"
+
+#ifndef __WXMSW__
+# include <arpa/inet.h>
+#endif
+
+// Prototypes from net.h, but that header (currently) stinks, can't #include it without breaking things
+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);
+
+static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
+static const char* ppszTypeName[] =
+{
+    "ERROR",
+    "tx",
+    "block",
+};
+
+CMessageHeader::CMessageHeader()
+{
+    memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
+    memset(pchCommand, 0, sizeof(pchCommand));
+    pchCommand[1] = 1;
+    nMessageSize = -1;
+    nChecksum = 0;
+}
+
+CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn)
+{
+    memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
+    strncpy(pchCommand, pszCommand, COMMAND_SIZE);
+    nMessageSize = nMessageSizeIn;
+    nChecksum = 0;
+}
+
+std::string CMessageHeader::GetCommand() const
+{
+    if (pchCommand[COMMAND_SIZE-1] == 0)
+        return std::string(pchCommand, pchCommand + strlen(pchCommand));
+    else
+        return std::string(pchCommand, pchCommand + COMMAND_SIZE);
+}
+
+bool CMessageHeader::IsValid() const
+{
+    // Check start string
+    if (memcmp(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart)) != 0)
+        return false;
+
+    // Check the command string for errors
+    for (const char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; p1++)
+    {
+        if (*p1 == 0)
+        {
+            // Must be all zeros after the first zero
+            for (; p1 < pchCommand + COMMAND_SIZE; p1++)
+                if (*p1 != 0)
+                    return false;
+        }
+        else if (*p1 < ' ' || *p1 > 0x7E)
+            return false;
+    }
+
+    // Message size
+    if (nMessageSize > MAX_SIZE)
+    {
+        printf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand().c_str(), nMessageSize);
+        return false;
+    }
+
+    return true;
+}
+
+CAddress::CAddress()
+{
+    Init();
+}
+
+CAddress::CAddress(unsigned int ipIn, unsigned short portIn, uint64 nServicesIn)
+{
+    Init();
+    ip = ipIn;
+    port = htons(portIn == 0 ? GetDefaultPort() : portIn);
+    nServices = nServicesIn;
+}
+
+CAddress::CAddress(const struct sockaddr_in& sockaddr, uint64 nServicesIn)
+{
+    Init();
+    ip = sockaddr.sin_addr.s_addr;
+    port = sockaddr.sin_port;
+    nServices = nServicesIn;
+}
+
+CAddress::CAddress(const char* pszIn, int portIn, bool fNameLookup, uint64 nServicesIn)
+{
+    Init();
+    Lookup(pszIn, *this, nServicesIn, fNameLookup, portIn);
+}
+
+CAddress::CAddress(const char* pszIn, bool fNameLookup, uint64 nServicesIn)
+{
+    Init();
+    Lookup(pszIn, *this, nServicesIn, fNameLookup, 0, true);
+}
+
+CAddress::CAddress(std::string strIn, int portIn, bool fNameLookup, uint64 nServicesIn)
+{
+    Init();
+    Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, portIn);
+}
+
+CAddress::CAddress(std::string strIn, bool fNameLookup, uint64 nServicesIn)
+{
+    Init();
+    Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, 0, true);
+}
+
+void CAddress::Init()
+{
+    nServices = NODE_NETWORK;
+    memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
+    ip = INADDR_NONE;
+    port = htons(GetDefaultPort());
+    nTime = 100000000;
+    nLastTry = 0;
+}
+
+bool operator==(const CAddress& a, const CAddress& b)
+{
+    return (memcmp(a.pchReserved, b.pchReserved, sizeof(a.pchReserved)) == 0 &&
+            a.ip   == b.ip &&
+            a.port == b.port);
+}
+
+bool operator!=(const CAddress& a, const CAddress& b)
+{
+    return (!(a == b));
+}
+
+bool operator<(const CAddress& a, const CAddress& b)
+{
+    int ret = memcmp(a.pchReserved, b.pchReserved, sizeof(a.pchReserved));
+    if (ret < 0)
+        return true;
+    else if (ret == 0)
+    {
+        if (ntohl(a.ip) < ntohl(b.ip))
+            return true;
+        else if (a.ip == b.ip)
+            return ntohs(a.port) < ntohs(b.port);
+    }
+    return false;
+}
+
+std::vector<unsigned char> CAddress::GetKey() const
+{
+    CDataStream ss;
+    ss.reserve(18);
+    ss << FLATDATA(pchReserved) << ip << port;
+
+    #if defined(_MSC_VER) && _MSC_VER < 1300
+    return std::vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
+    #else
+    return std::vector<unsigned char>(ss.begin(), ss.end());
+    #endif
+}
+
+struct sockaddr_in CAddress::GetSockAddr() const
+{
+    struct sockaddr_in sockaddr;
+    memset(&sockaddr, 0, sizeof(sockaddr));
+    sockaddr.sin_family = AF_INET;
+    sockaddr.sin_addr.s_addr = ip;
+    sockaddr.sin_port = port;
+    return sockaddr;
+}
+
+bool CAddress::IsIPv4() const
+{
+    return (memcmp(pchReserved, pchIPv4, sizeof(pchIPv4)) == 0);
+}
+
+bool CAddress::IsRFC1918() const
+{
+  return IsIPv4() && (GetByte(3) == 10 ||
+    (GetByte(3) == 192 && GetByte(2) == 168) ||
+    (GetByte(3) == 172 &&
+      (GetByte(2) >= 16 && GetByte(2) <= 31)));
+}
+
+bool CAddress::IsRFC3927() const
+{
+  return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254);
+}
+
+bool CAddress::IsLocal() const
+{
+  return IsIPv4() && (GetByte(3) == 127 ||
+      GetByte(3) == 0);
+}
+
+bool CAddress::IsRoutable() const
+{
+    return IsValid() &&
+        !(IsRFC1918() || IsRFC3927() || IsLocal());
+}
+
+bool CAddress::IsValid() const
+{
+    // Clean up 3-byte shifted addresses caused by garbage in size field
+    // of addr messages from versions before 0.2.9 checksum.
+    // Two consecutive addr messages look like this:
+    // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
+    // so if the first length field is garbled, it reads the second batch
+    // of addr misaligned by 3 bytes.
+    if (memcmp(pchReserved, pchIPv4+3, sizeof(pchIPv4)-3) == 0)
+        return false;
+
+    return (ip != 0 && ip != INADDR_NONE && port != htons(USHRT_MAX));
+}
+
+unsigned char CAddress::GetByte(int n) const
+{
+    return ((unsigned char*)&ip)[3-n];
+}
+
+std::string CAddress::ToStringIPPort() const
+{
+    return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
+}
+
+std::string CAddress::ToStringIP() const
+{
+    return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0));
+}
+
+std::string CAddress::ToStringPort() const
+{
+    return strprintf("%u", ntohs(port));
+}
+
+std::string CAddress::ToString() const
+{
+    return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
+}
+
+void CAddress::print() const
+{
+    printf("CAddress(%s)\n", ToString().c_str());
+}
+
+CInv::CInv()
+{
+    type = 0;
+    hash = 0;
+}
+
+CInv::CInv(int typeIn, const uint256& hashIn)
+{
+    type = typeIn;
+    hash = hashIn;
+}
+
+CInv::CInv(const std::string& strType, const uint256& hashIn)
+{
+    int i;
+    for (i = 1; i < ARRAYLEN(ppszTypeName); i++)
+    {
+        if (strType == ppszTypeName[i])
+        {
+            type = i;
+            break;
+        }
+    }
+    if (i == ARRAYLEN(ppszTypeName))
+        throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType.c_str()));
+    hash = hashIn;
+}
+
+bool operator<(const CInv& a, const CInv& b)
+{
+    return (a.type < b.type || (a.type == b.type && a.hash < b.hash));
+}
+
+bool CInv::IsKnownType() const
+{
+    return (type >= 1 && type < ARRAYLEN(ppszTypeName));
+}
+
+const char* CInv::GetCommand() const
+{
+    if (!IsKnownType())
+        throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type));
+    return ppszTypeName[type];
+}
+
+std::string CInv::ToString() const
+{
+    return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
+}
+
+void CInv::print() const
+{
+    printf("CInv(%s)\n", ToString().c_str());
+}
diff --git a/src/protocol.h b/src/protocol.h
new file mode 100644 (file)
index 0000000..53d3eef
--- /dev/null
@@ -0,0 +1,150 @@
+// 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 __cplusplus
+# error This header can only be compiled as C++.
+#endif
+
+#ifndef __INCLUDED_PROTOCOL_H__
+#define __INCLUDED_PROTOCOL_H__
+
+#include "serialize.h"
+#include <string>
+#include "uint256.h"
+
+extern bool fTestNet;
+static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
+{
+    return testnet ? 18333 : 8333;
+}
+
+//
+// Message header
+//  (4) message start
+//  (12) command
+//  (4) size
+//  (4) checksum
+
+extern unsigned char pchMessageStart[4];
+
+class CMessageHeader
+{
+    public:
+        CMessageHeader();
+        CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
+
+        std::string GetCommand() const;
+        bool IsValid() const;
+
+        IMPLEMENT_SERIALIZE
+            (
+             READWRITE(FLATDATA(pchMessageStart));
+             READWRITE(FLATDATA(pchCommand));
+             READWRITE(nMessageSize);
+             if (nVersion >= 209)
+             READWRITE(nChecksum);
+            )
+
+    // TODO: make private (improves encapsulation)
+    public:
+        enum { COMMAND_SIZE=12 };
+        char pchMessageStart[sizeof(::pchMessageStart)];
+        char pchCommand[COMMAND_SIZE];
+        unsigned int nMessageSize;
+        unsigned int nChecksum;
+};
+
+enum
+{
+    NODE_NETWORK = (1 << 0),
+};
+
+class CAddress
+{
+    public:
+        CAddress();
+        CAddress(unsigned int ipIn, unsigned short portIn=0, uint64 nServicesIn=NODE_NETWORK);
+        explicit CAddress(const struct sockaddr_in& sockaddr, uint64 nServicesIn=NODE_NETWORK);
+        explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
+        explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
+        explicit CAddress(std::string strIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
+        explicit CAddress(std::string strIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
+
+        void Init();
+
+        IMPLEMENT_SERIALIZE
+            (
+             if (fRead)
+             const_cast<CAddress*>(this)->Init();
+             if (nType & SER_DISK)
+             READWRITE(nVersion);
+             if ((nType & SER_DISK) || (nVersion >= 31402 && !(nType & SER_GETHASH)))
+             READWRITE(nTime);
+             READWRITE(nServices);
+             READWRITE(FLATDATA(pchReserved)); // for IPv6
+             READWRITE(ip);
+             READWRITE(port);
+            )
+
+        friend bool operator==(const CAddress& a, const CAddress& b);
+        friend bool operator!=(const CAddress& a, const CAddress& b);
+        friend bool operator<(const CAddress& a, const CAddress& b);
+
+        std::vector<unsigned char> GetKey() const;
+        struct sockaddr_in GetSockAddr() const;
+        bool IsIPv4() const;
+        bool IsRFC1918() const;
+        bool IsRFC3927() const;
+        bool IsLocal() const;
+        bool IsRoutable() const;
+        bool IsValid() const;
+        unsigned char GetByte(int n) const;
+        std::string ToStringIPPort() const;
+        std::string ToStringIP() const;
+        std::string ToStringPort() const;
+        std::string ToString() const;
+        void print() const;
+
+    // TODO: make private (improves encapsulation)
+    public:
+        uint64 nServices;
+        unsigned char pchReserved[12];
+        unsigned int ip;
+        unsigned short port;
+
+        // disk and network only
+        unsigned int nTime;
+
+        // memory only
+        unsigned int nLastTry;
+};
+
+class CInv
+{
+    public:
+        CInv();
+        CInv(int typeIn, const uint256& hashIn);
+        CInv(const std::string& strType, const uint256& hashIn);
+
+        IMPLEMENT_SERIALIZE
+        (
+            READWRITE(type);
+            READWRITE(hash);
+        )
+
+        friend bool operator<(const CInv& a, const CInv& b);
+
+        bool IsKnownType() const;
+        const char* GetCommand() const;
+        std::string ToString() const;
+        void print() const;
+
+    // TODO: make private (improves encapsulation)
+    public:
+        int type;
+        uint256 hash;
+};
+
+#endif // __INCLUDED_PROTOCOL_H__
index 81c66ec..829cd17 100644 (file)
@@ -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.
 
@@ -36,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)
 {
@@ -309,7 +313,10 @@ Value getinfo(const Array& params, bool fHelp)
     obj.push_back(Pair("hashespersec",  gethashespersec(params, false)));
     obj.push_back(Pair("testnet",       fTestNet));
     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;
 }
@@ -329,28 +336,30 @@ Value getnewaddress(const Array& params, bool fHelp)
     if (params.size() > 0)
         strAccount = AccountFromValue(params[0]);
 
+    if (!pwalletMain->IsLocked())
+        pwalletMain->TopUpKeyPool();
+
     // Generate a new key that is added to wallet
-    string strAddress = PubKeyToAddress(pwalletMain->GetKeyFromKeyPool());
+    std::vector<unsigned char> newKey;
+    if (!pwalletMain->GetKeyFromPool(newKey, false))
+        throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first");
+    CBitcoinAddress address(newKey);
 
-    // This could be done in the same main CS as GetKeyFromKeyPool.
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
-       pwalletMain->SetAddressBookName(strAddress, strAccount);
+    pwalletMain->SetAddressBookName(address, strAccount);
 
-    return strAddress;
+    return address.ToString();
 }
 
 
-// requires cs_main, cs_mapWallet, cs_mapAddressBook locks
-string GetAccountAddress(string strAccount, bool bForceNew=false)
+CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
 {
-    string strAddress;
-
     CWalletDB walletdb(pwalletMain->strWalletFile);
-    walletdb.TxnBegin();
 
     CAccount account;
     walletdb.ReadAccount(strAccount, account);
 
+    bool bKeyUsed = false;
+
     // Check if the current key has been used
     if (!account.vchPubKey.empty())
     {
@@ -363,23 +372,21 @@ string GetAccountAddress(string strAccount, bool bForceNew=false)
             const CWalletTx& wtx = (*it).second;
             BOOST_FOREACH(const CTxOut& txout, wtx.vout)
                 if (txout.scriptPubKey == scriptPubKey)
-                    account.vchPubKey.clear();
+                    bKeyUsed = true;
         }
     }
 
     // Generate a new key
-    if (account.vchPubKey.empty() || bForceNew)
+    if (account.vchPubKey.empty() || bForceNew || bKeyUsed)
     {
-        account.vchPubKey = pwalletMain->GetKeyFromKeyPool();
-        string strAddress = PubKeyToAddress(account.vchPubKey);
-        pwalletMain->SetAddressBookName(strAddress, strAccount);
+        if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false))
+            throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first");
+
+        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)
@@ -394,12 +401,7 @@ Value getaccountaddress(const Array& params, bool fHelp)
 
     Value ret;
 
-    CRITICAL_BLOCK(cs_main)
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
-    {
-        ret = GetAccountAddress(strAccount);
-    }
+    ret = GetAccountAddress(strAccount).ToString();
 
     return ret;
 }
@@ -413,10 +415,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");
 
 
@@ -425,20 +425,15 @@ Value setaccount(const Array& params, bool fHelp)
         strAccount = AccountFromValue(params[1]);
 
     // Detect when changing the account of an address that is the 'unused current key' of another account:
-    CRITICAL_BLOCK(cs_main)
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    if (pwalletMain->mapAddressBook.count(address))
     {
-        if (pwalletMain->mapAddressBook.count(strAddress))
-        {
-            string strOldAccount = pwalletMain->mapAddressBook[strAddress];
-            if (strAddress == GetAccountAddress(strOldAccount))
-                GetAccountAddress(strOldAccount, true);
-        }
-
-        pwalletMain->SetAddressBookName(strAddress, strAccount);
+        string strOldAccount = pwalletMain->mapAddressBook[address];
+        if (address == GetAccountAddress(strOldAccount))
+            GetAccountAddress(strOldAccount, true);
     }
 
+    pwalletMain->SetAddressBookName(address, strAccount);
+
     return Value::null;
 }
 
@@ -450,15 +445,14 @@ 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(pwalletMain->cs_mapAddressBook)
-    {
-        map<string, string>::iterator mi = pwalletMain->mapAddressBook.find(strAddress);
-        if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
-            strAccount = (*mi).second;
-    }
+    map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address);
+    if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
+        strAccount = (*mi).second;
     return strAccount;
 }
 
@@ -474,20 +468,12 @@ Value getaddressesbyaccount(const Array& params, bool fHelp)
 
     // Find all addresses that have the given account
     Array ret;
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
     {
-        BOOST_FOREACH(const PAIRTYPE(string, string)& item, pwalletMain->mapAddressBook)
-        {
-            const string& strAddress = 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);
-            }
-        }
+        const CBitcoinAddress& address = item.first;
+        const string& strName = item.second;
+        if (strName == strAccount)
+            ret.push_back(address.ToString());
     }
     return ret;
 }
@@ -511,12 +497,19 @@ Value settxfee(const Array& params, bool fHelp)
 
 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.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]);
@@ -528,12 +521,12 @@ Value sendtoaddress(const Array& params, bool fHelp)
     if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
         wtx.mapValue["to"]      = params[3].get_str();
 
-    CRITICAL_BLOCK(cs_main)
-    {
-        string strError = pwalletMain->SendMoneyToBitcoinAddress(strAddress, nAmount, wtx);
-        if (strError != "")
-            throw JSONRPCError(-4, strError);
-    }
+    if (pwalletMain->IsLocked())
+        throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
+
+    string strError = pwalletMain->SendMoneyToBitcoinAddress(address, nAmount, wtx);
+    if (strError != "")
+        throw JSONRPCError(-4, strError);
 
     return wtx.GetHash().GetHex();
 }
@@ -547,10 +540,11 @@ 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");
+    scriptPubKey.SetBitcoinAddress(address);
     if (!IsMine(*pwalletMain,scriptPubKey))
         return (double)0.0;
 
@@ -561,42 +555,30 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
 
     // Tally
     int64 nAmount = 0;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+    for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->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;
+        const CWalletTx& wtx = (*it).second;
+        if (wtx.IsCoinBase() || !wtx.IsFinal())
+            continue;
 
-            BOOST_FOREACH(const CTxOut& txout, wtx.vout)
-                if (txout.scriptPubKey == scriptPubKey)
-                    if (wtx.GetDepthInMainChain() >= nMinDepth)
-                        nAmount += txout.nValue;
-        }
+        BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+            if (txout.scriptPubKey == scriptPubKey)
+                if (wtx.GetDepthInMainChain() >= nMinDepth)
+                    nAmount += txout.nValue;
     }
 
     return  ValueFromAmount(nAmount);
 }
 
 
-void GetAccountPubKeys(string strAccount, set<CScript>& setPubKey)
+void GetAccountAddresses(string strAccount, set<CBitcoinAddress>& setAddress)
 {
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
     {
-        BOOST_FOREACH(const PAIRTYPE(string, string)& item, pwalletMain->mapAddressBook)
-        {
-            const string& strAddress = 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(*pwalletMain,scriptPubKey))
-                        setPubKey.insert(scriptPubKey);
-            }
-        }
+        const CBitcoinAddress& address = item.first;
+        const string& strName = item.second;
+        if (strName == strAccount)
+            setAddress.insert(address);
     }
 }
 
@@ -615,23 +597,23 @@ 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(pwalletMain->cs_mapWallet)
+    for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->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;
+        const CWalletTx& wtx = (*it).second;
+        if (wtx.IsCoinBase() || !wtx.IsFinal())
+            continue;
 
-            BOOST_FOREACH(const CTxOut& txout, wtx.vout)
-                if (setPubKey.count(txout.scriptPubKey))
-                    if (wtx.GetDepthInMainChain() >= nMinDepth)
-                        nAmount += txout.nValue;
+        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;
         }
     }
 
@@ -642,27 +624,25 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
 int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
 {
     int64 nBalance = 0;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    {
-        // Tally wallet transactions
-        for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
-        {
-            const CWalletTx& wtx = (*it).second;
-            if (!wtx.IsFinal())
-                continue;
 
-            int64 nGenerated, nReceived, nSent, nFee;
-            wtx.GetAccountAmounts(strAccount, nGenerated, nReceived, nSent, nFee);
+    // Tally wallet transactions
+    for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
+    {
+        const CWalletTx& wtx = (*it).second;
+        if (!wtx.IsFinal())
+            continue;
 
-            if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth)
-                nBalance += nReceived;
-            nBalance += nGenerated - nSent - nFee;
-        }
+        int64 nGenerated, nReceived, nSent, nFee;
+        wtx.GetAccountAmounts(strAccount, nGenerated, nReceived, nSent, nFee);
 
-        // Tally internal accounting entries
-        nBalance += walletdb.GetAccountCreditDebit(strAccount);
+        if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth)
+            nBalance += nReceived;
+        nBalance += nGenerated - nSent - nFee;
     }
 
+    // Tally internal accounting entries
+    nBalance += walletdb.GetAccountCreditDebit(strAccount);
+
     return nBalance;
 }
 
@@ -675,7 +655,7 @@ int64 GetAccountBalance(const string& strAccount, int 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"
@@ -702,13 +682,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)
-                BOOST_FOREACH(const PAIRTYPE(string,int64)& r, listReceived)
+                BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived)
                     nBalance += r.second;
-            BOOST_FOREACH(const PAIRTYPE(string,int64)& r, listSent)
+            BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listSent)
                 nBalance -= r.second;
             nBalance -= allFee;
             nBalance += allGeneratedMature;
@@ -734,53 +714,58 @@ 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(pwalletMain->cs_mapWallet)
-    {
-        CWalletDB walletdb(pwalletMain->strWalletFile);
-        walletdb.TxnBegin();
-
-        int64 nNow = GetAdjustedTime();
-
-        // Debit
-        CAccountingEntry debit;
-        debit.strAccount = strFrom;
-        debit.nCreditDebit = -nAmount;
-        debit.nTime = nNow;
-        debit.strOtherAccount = strTo;
-        debit.strComment = strComment;
-        walletdb.WriteAccountingEntry(debit);
-
-        // Credit
-        CAccountingEntry credit;
-        credit.strAccount = strTo;
-        credit.nCreditDebit = nAmount;
-        credit.nTime = nNow;
-        credit.strOtherAccount = strFrom;
-        credit.strComment = strComment;
-        walletdb.WriteAccountingEntry(credit);
-
-        walletdb.TxnCommit();
-    }
+    CWalletDB walletdb(pwalletMain->strWalletFile);
+    walletdb.TxnBegin();
+
+    int64 nNow = GetAdjustedTime();
+
+    // Debit
+    CAccountingEntry debit;
+    debit.strAccount = strFrom;
+    debit.nCreditDebit = -nAmount;
+    debit.nTime = nNow;
+    debit.strOtherAccount = strTo;
+    debit.strComment = strComment;
+    walletdb.WriteAccountingEntry(debit);
+
+    // Credit
+    CAccountingEntry credit;
+    credit.strAccount = strTo;
+    credit.nCreditDebit = nAmount;
+    credit.nTime = nNow;
+    credit.strOtherAccount = strFrom;
+    credit.strComment = strComment;
+    walletdb.WriteAccountingEntry(credit);
+
+    walletdb.TxnCommit();
+
     return true;
 }
 
 
 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.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)
@@ -793,26 +778,31 @@ Value sendfrom(const Array& params, bool fHelp)
     if (params.size() > 5 && params[5].type() != null_type && !params[5].get_str().empty())
         wtx.mapValue["to"]      = params[5].get_str();
 
-    CRITICAL_BLOCK(cs_main)
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    {
-        // Check funds
-        int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
-        if (nAmount > nBalance)
-            throw JSONRPCError(-6, "Account has insufficient funds");
-
-        // Send
-        string strError = pwalletMain->SendMoneyToBitcoinAddress(strAddress, nAmount, wtx);
-        if (strError != "")
-            throw JSONRPCError(-4, strError);
-    }
+    if (pwalletMain->IsLocked())
+        throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
+
+    // Check funds
+    int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
+    if (nAmount > nBalance)
+        throw JSONRPCError(-6, "Account has insufficient funds");
+
+    // Send
+    string strError = pwalletMain->SendMoneyToBitcoinAddress(address, nAmount, wtx);
+    if (strError != "")
+        throw JSONRPCError(-4, strError);
 
     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");
@@ -828,49 +818,48 @@ 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;
     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;
 
         vecSend.push_back(make_pair(scriptPubKey, nAmount));
     }
 
-    CRITICAL_BLOCK(cs_main)
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+    if (pwalletMain->IsLocked())
+        throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
+
+    // Check funds
+    int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
+    if (totalAmount > nBalance)
+        throw JSONRPCError(-6, "Account has insufficient funds");
+
+    // Send
+    CReserveKey keyChange(pwalletMain);
+    int64 nFeeRequired = 0;
+    bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
+    if (!fCreated)
     {
-        // Check funds
-        int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
-        if (totalAmount > nBalance)
-            throw JSONRPCError(-6, "Account has insufficient funds");
-
-        // Send
-        CReserveKey keyChange(pwalletMain);
-        int64 nFeeRequired = 0;
-        bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
-        if (!fCreated)
-        {
-            if (totalAmount + nFeeRequired > pwalletMain->GetBalance())
-                throw JSONRPCError(-6, "Insufficient funds");
-            throw JSONRPCError(-4, "Transaction creation failed");
-        }
-        if (!pwalletMain->CommitTransaction(wtx, keyChange))
-            throw JSONRPCError(-4, "Transaction commit failed");
+        if (totalAmount + nFeeRequired > pwalletMain->GetBalance())
+            throw JSONRPCError(-6, "Insufficient funds");
+        throw JSONRPCError(-4, "Transaction creation failed");
     }
+    if (!pwalletMain->CommitTransaction(wtx, keyChange))
+        throw JSONRPCError(-4, "Transaction commit failed");
 
     return wtx.GetHash().GetHex();
 }
@@ -900,73 +889,63 @@ Value ListReceived(const Array& params, bool fByAccounts)
         fIncludeEmpty = params[1].get_bool();
 
     // Tally
-    map<uint160, tallyitem> mapTally;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+    map<CBitcoinAddress, tallyitem> mapTally;
+    for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->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;
+        const CWalletTx& wtx = (*it).second;
+        if (wtx.IsCoinBase() || !wtx.IsFinal())
+            continue;
 
-            int nDepth = wtx.GetDepthInMainChain();
-            if (nDepth < nMinDepth)
+        int nDepth = wtx.GetDepthInMainChain();
+        if (nDepth < nMinDepth)
+            continue;
+
+        BOOST_FOREACH(const CTxOut& txout, wtx.vout)
+        {
+            CBitcoinAddress address;
+            if (!ExtractAddress(txout.scriptPubKey, pwalletMain, address) || !address.IsValid())
                 continue;
 
-            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
-                    continue;
-
-                tallyitem& item = mapTally[hash160];
-                item.nAmount += txout.nValue;
-                item.nConf = min(item.nConf, nDepth);
-            }
+            tallyitem& item = mapTally[address];
+            item.nAmount += txout.nValue;
+            item.nConf = min(item.nConf, nDepth);
         }
     }
 
     // Reply
     Array ret;
     map<string, tallyitem> mapAccountTally;
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
     {
-        BOOST_FOREACH(const PAIRTYPE(string, string)& item, pwalletMain->mapAddressBook)
-        {
-            const string& strAddress = item.first;
-            const string& strAccount = item.second;
-            uint160 hash160;
-            if (!AddressToHash160(strAddress, hash160))
-                continue;
-            map<uint160, tallyitem>::iterator it = mapTally.find(hash160);
-            if (it == mapTally.end() && !fIncludeEmpty)
-                continue;
+        const CBitcoinAddress& address = item.first;
+        const string& strAccount = item.second;
+        map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
+        if (it == mapTally.end() && !fIncludeEmpty)
+            continue;
 
-            int64 nAmount = 0;
-            int nConf = INT_MAX;
-            if (it != mapTally.end())
-            {
-                nAmount = (*it).second.nAmount;
-                nConf = (*it).second.nConf;
-            }
+        int64 nAmount = 0;
+        int nConf = INT_MAX;
+        if (it != mapTally.end())
+        {
+            nAmount = (*it).second.nAmount;
+            nConf = (*it).second.nConf;
+        }
 
-            if (fByAccounts)
-            {
-                tallyitem& item = mapAccountTally[strAccount];
-                item.nAmount += nAmount;
-                item.nConf = min(item.nConf, nConf);
-            }
-            else
-            {
-                Object obj;
-                obj.push_back(Pair("address",       strAddress));
-                obj.push_back(Pair("account",       strAccount));
-                obj.push_back(Pair("label",         strAccount)); // deprecated
-                obj.push_back(Pair("amount",        ValueFromAmount(nAmount)));
-                obj.push_back(Pair("confirmations", (nConf == INT_MAX ? 0 : nConf)));
-                ret.push_back(obj);
-            }
+        if (fByAccounts)
+        {
+            tallyitem& item = mapAccountTally[strAccount];
+            item.nAmount += nAmount;
+            item.nConf = min(item.nConf, nConf);
+        }
+        else
+        {
+            Object obj;
+            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)));
+            obj.push_back(Pair("confirmations", (nConf == INT_MAX ? 0 : nConf)));
+            ret.push_back(obj);
         }
     }
 
@@ -1023,8 +1002,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("*"));
@@ -1052,11 +1031,11 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
     // Sent
     if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
     {
-        BOOST_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)));
@@ -1068,27 +1047,23 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
 
     // Received
     if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
-        CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+        BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& r, listReceived)
         {
-            BOOST_FOREACH(const PAIRTYPE(string, int64)& r, listReceived)
+            string account;
+            if (pwalletMain->mapAddressBook.count(r.first))
+                account = pwalletMain->mapAddressBook[r.first];
+            if (fAllAccounts || (account == strAccount))
             {
-                string account;
-                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("category", "receive"));
-                    entry.push_back(Pair("amount", ValueFromAmount(r.second)));
-                    if (fLong)
-                        WalletTxToJSON(wtx, entry);
-                    ret.push_back(entry);
-                }
+                Object entry;
+                entry.push_back(Pair("account", account));
+                entry.push_back(Pair("address", r.first.ToString()));
+                entry.push_back(Pair("category", "receive"));
+                entry.push_back(Pair("amount", ValueFromAmount(r.second)));
+                if (fLong)
+                    WalletTxToJSON(wtx, entry);
+                ret.push_back(entry);
             }
         }
-
 }
 
 void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)
@@ -1128,40 +1103,38 @@ Value listtransactions(const Array& params, bool fHelp)
     Array ret;
     CWalletDB walletdb(pwalletMain->strWalletFile);
 
-    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;
+    // 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 = 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);
-        BOOST_FOREACH(CAccountingEntry& entry, acentries)
-        {
-            txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry)));
-        }
+    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);
+    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:
-        TxItems::reverse_iterator it = txByTime.rbegin();
-        for (std::advance(it, nFrom); it != txByTime.rend(); ++it)
-        {
-            CWalletTx *const pwtx = (*it).second.first;
-            if (pwtx != 0)
-                ListTransactions(*pwtx, strAccount, 0, true, ret);
-            CAccountingEntry *const pacentry = (*it).second.second;
-            if (pacentry != 0)
-                AcentryToJSON(*pacentry, strAccount, ret);
-
-            if (ret.size() >= nCount) break;
-        }
-        // ret is now newest to oldest
+    // Now: iterate backwards until we have nCount items to return:
+    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)
+            ListTransactions(*pwtx, strAccount, 0, true, ret);
+        CAccountingEntry *const pacentry = (*it).second.second;
+        if (pacentry != 0)
+            AcentryToJSON(*pacentry, strAccount, ret);
+
+        if (ret.size() >= nCount) break;
     }
+    // ret is now newest to oldest
     
     // Make sure we return only last nCount items (sends-to-self might give us an extra):
     if (ret.size() > nCount)
@@ -1187,35 +1160,30 @@ Value listaccounts(const Array& params, bool fHelp)
         nMinDepth = params[0].get_int();
 
     map<string, int64> mapAccountBalances;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
-    {
-        BOOST_FOREACH(const PAIRTYPE(string, string)& entry, pwalletMain->mapAddressBook) {
-            uint160 hash160;
-            if(AddressToHash160(entry.first, hash160) && mapPubKeys.count(hash160)) // This address belongs to me
-                mapAccountBalances[entry.second] = 0;
-        }
+    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 = pwalletMain->mapWallet.begin(); it != pwalletMain->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<CBitcoinAddress, int64> > listReceived;
+        list<pair<CBitcoinAddress, int64> > listSent;
+        wtx.GetAmounts(nGeneratedImmature, nGeneratedMature, listReceived, listSent, nFee, strSentAccount);
+        mapAccountBalances[strSentAccount] -= nFee;
+        BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& s, listSent)
+            mapAccountBalances[strSentAccount] -= s.second;
+        if (wtx.GetDepthInMainChain() >= nMinDepth)
         {
-            const CWalletTx& wtx = (*it).second;
-            int64 nGeneratedImmature, nGeneratedMature, nFee;
-            string strSentAccount;
-            list<pair<string, int64> > listReceived;
-            list<pair<string, int64> > listSent;
-            wtx.GetAmounts(nGeneratedImmature, nGeneratedMature, listReceived, listSent, nFee, strSentAccount);
-            mapAccountBalances[strSentAccount] -= nFee;
-            BOOST_FOREACH(const PAIRTYPE(string, int64)& s, listSent)
-                mapAccountBalances[strSentAccount] -= s.second;
-            if (wtx.GetDepthInMainChain() >= nMinDepth)
-            {
-                mapAccountBalances[""] += nGeneratedMature;
-                BOOST_FOREACH(const PAIRTYPE(string, int64)& r, listReceived)
-                    if (pwalletMain->mapAddressBook.count(r.first))
-                        mapAccountBalances[pwalletMain->mapAddressBook[r.first]] += r.second;
-                    else
-                        mapAccountBalances[""] += r.second;
-            }
+            mapAccountBalances[""] += nGeneratedMature;
+            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;
         }
     }
 
@@ -1242,27 +1210,25 @@ Value gettransaction(const Array& params, bool fHelp)
     hash.SetHex(params[0].get_str());
 
     Object entry;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
-    {
-        if (!pwalletMain->mapWallet.count(hash))
-            throw JSONRPCError(-5, "Invalid or non-wallet transaction id");
-        const CWalletTx& wtx = pwalletMain->mapWallet[hash];
 
-        int64 nCredit = wtx.GetCredit();
-        int64 nDebit = wtx.GetDebit();
-        int64 nNet = nCredit - nDebit;
-        int64 nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
+    if (!pwalletMain->mapWallet.count(hash))
+        throw JSONRPCError(-5, "Invalid or non-wallet transaction id");
+    const CWalletTx& wtx = pwalletMain->mapWallet[hash];
 
-        entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
-        if (wtx.IsFromMe())
-            entry.push_back(Pair("fee", ValueFromAmount(nFee)));
+    int64 nCredit = wtx.GetCredit();
+    int64 nDebit = wtx.GetDebit();
+    int64 nNet = nCredit - nDebit;
+    int64 nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
 
-        WalletTxToJSON(pwalletMain->mapWallet[hash], entry);
+    entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
+    if (wtx.IsFromMe())
+        entry.push_back(Pair("fee", ValueFromAmount(nFee)));
 
-        Array details;
-        ListTransactions(pwalletMain->mapWallet[hash], "*", 0, false, details);
-        entry.push_back(Pair("details", details));
-    }
+    WalletTxToJSON(pwalletMain->mapWallet[hash], entry);
+
+    Array details;
+    ListTransactions(pwalletMain->mapWallet[hash], "*", 0, false, details);
+    entry.push_back(Pair("details", details));
 
     return entry;
 }
@@ -1282,6 +1248,213 @@ Value backupwallet(const Array& params, bool fHelp)
 }
 
 
+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.");
+
+    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();
+
+    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;
+}
+
+
 Value validateaddress(const Array& params, bool fHelp)
 {
     if (fHelp || params.size() != 1)
@@ -1289,9 +1462,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));
@@ -1299,14 +1471,11 @@ 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(pwalletMain->cs_mapAddressBook)
-        {
-            if (pwalletMain->mapAddressBook.count(currentAddress))
-                ret.push_back(Pair("account", pwalletMain->mapAddressBook[currentAddress]));
-        }
+        ret.push_back(Pair("ismine", (pwalletMain->HaveKey(address) > 0)));
+        if (pwalletMain->mapAddressBook.count(address))
+            ret.push_back(Pair("account", pwalletMain->mapAddressBook[address]));
     }
     return ret;
 }
@@ -1330,7 +1499,8 @@ Value getwork(const Array& params, bool fHelp)
     if (IsInitialBlockDownload())
         throw JSONRPCError(-10, "Bitcoin is downloading blocks...");
 
-    static map<uint256, pair<CBlock*, unsigned int> > mapNewBlock;
+    typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
+    static mapNewBlock_t mapNewBlock;
     static vector<CBlock*> vNewBlock;
     static CReserveKey reservekey(pwalletMain);
 
@@ -1369,11 +1539,10 @@ Value getwork(const Array& params, bool fHelp)
 
         // Update nExtraNonce
         static unsigned int nExtraNonce = 0;
-        static int64 nPrevTime = 0;
-        IncrementExtraNonce(pblock, pindexPrev, nExtraNonce, nPrevTime);
+        IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
 
         // Save
-        mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, nExtraNonce);
+        mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
 
         // Prebuild hash buffers
         char pmidstate[32];
@@ -1406,11 +1575,10 @@ Value getwork(const Array& params, bool fHelp)
         if (!mapNewBlock.count(pdata->hashMerkleRoot))
             return false;
         CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first;
-        unsigned int nExtraNonce = mapNewBlock[pdata->hashMerkleRoot].second;
 
         pblock->nTime = pdata->nTime;
         pblock->nNonce = pdata->nNonce;
-        pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nBits << CBigNum(nExtraNonce);
+        pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
         pblock->hashMerkleRoot = pblock->BuildMerkleTree();
 
         return CheckWork(pblock, *pwalletMain, reservekey);
@@ -1433,44 +1601,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("settxfee",              &settxfee),
+    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]));
 
@@ -1488,12 +1661,15 @@ string pAllowInSafeMode[] =
     "getinfo",
     "getnewaddress",
     "getaccountaddress",
-    "setlabel",
+    "setlabel", // deprecated
     "getaccount",
     "getlabel", // deprecated
     "getaddressesbyaccount",
     "getaddressesbylabel", // deprecated
     "backupwallet",
+    "keypoolrefill",
+    "walletpassphrase",
+    "walletlock",
     "validateaddress",
     "getwork",
 };
@@ -1974,7 +2150,10 @@ void ThreadRPCServer2(void* parg)
             try
             {
                 // Execute
-                Value result = (*(*mi).second)(params, false);
+                Value result;
+                CRITICAL_BLOCK(cs_main)
+                CRITICAL_BLOCK(pwalletMain->cs_wallet)
+                    result = (*(*mi).second)(params, false);
 
                 // Send reply
                 string strReply = JSONRPCReply(result, Value::null, id);
@@ -2116,7 +2295,7 @@ int CommandLineRPC(int argc, char *argv[])
         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]);
@@ -2131,6 +2310,7 @@ int CommandLineRPC(int argc, char *argv[])
         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();
@@ -2147,7 +2327,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)
         {
index 48a7b8a..f267400 100644 (file)
--- a/src/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.
 
index bd1b5b3..6e7bcb5 100644 (file)
@@ -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.
 #include "headers.h"
@@ -580,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());
@@ -659,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);
@@ -1030,50 +1033,45 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
         return false;
 
     // Compile solution
-    CRITICAL_BLOCK(keystore.cs_mapKeys)
+    BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
     {
-        BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
+        if (item.first == OP_PUBKEY)
         {
-            if (item.first == OP_PUBKEY)
+            // Sign
+            const valtype& vchPubKey = item.second;
+            CKey key;
+            if (!keystore.GetKey(Hash160(vchPubKey), key))
+                return false;
+            if (key.GetPubKey() != vchPubKey)
+                return false;
+            if (hash != 0)
             {
-                // Sign
-                const valtype& vchPubKey = item.second;
-                CPrivKey privkey;
-                if (!keystore.GetPrivKey(vchPubKey, privkey))
+                vector<unsigned char> vchSig;
+                if (!key.Sign(hash, vchSig))
                     return false;
-                if (hash != 0)
-                {
-                    vector<unsigned char> vchSig;
-                    if (!CKey::Sign(privkey, hash, vchSig))
-                        return false;
-                    vchSig.push_back((unsigned char)nHashType);
-                    scriptSigRet << vchSig;
-                }
+                vchSig.push_back((unsigned char)nHashType);
+                scriptSigRet << vchSig;
             }
-            else if (item.first == OP_PUBKEYHASH)
+        }
+        else if (item.first == OP_PUBKEYHASH)
+        {
+            // Sign and give pubkey
+            CKey key;
+            if (!keystore.GetKey(uint160(item.second), key))
+                return false;
+            if (hash != 0)
             {
-                // Sign and give pubkey
-                map<uint160, valtype>::iterator mi = mapPubKeys.find(uint160(item.second));
-                if (mi == mapPubKeys.end())
+                vector<unsigned char> vchSig;
+                if (!key.Sign(hash, vchSig))
                     return false;
-                const vector<unsigned char>& vchPubKey = (*mi).second;
-                CPrivKey privkey;
-                if (!keystore.GetPrivKey(vchPubKey, privkey))
-                    return false;
-                if (hash != 0)
-                {
-                    vector<unsigned char> vchSig;
-                    if (!CKey::Sign(privkey, hash, vchSig))
-                        return false;
-                    vchSig.push_back((unsigned char)nHashType);
-                    scriptSigRet << vchSig << vchPubKey;
-                }
-            }
-            else
-            {
-                return false;
+                vchSig.push_back((unsigned char)nHashType);
+                scriptSigRet << vchSig << key.GetPubKey();
             }
         }
+        else
+        {
+            return false;
+        }
     }
 
     return true;
@@ -1089,66 +1087,65 @@ bool IsStandard(const CScript& scriptPubKey)
 
 bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
 {
-    CScript scriptSig;
-    return Solver(keystore, scriptPubKey, 0, 0, scriptSig);
-}
-
-
-bool ExtractPubKey(const CScript& scriptPubKey, const CKeyStore* keystore, vector<unsigned char>& vchPubKeyRet)
-{
-    vchPubKeyRet.clear();
-
     vector<pair<opcodetype, valtype> > vSolution;
     if (!Solver(scriptPubKey, vSolution))
         return false;
 
-    CRITICAL_BLOCK(cs_mapPubKeys)
+    // Compile solution
+    BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
     {
-        BOOST_FOREACH(PAIRTYPE(opcodetype, valtype)& item, vSolution)
+        if (item.first == OP_PUBKEY)
         {
-            valtype vchPubKey;
-            if (item.first == OP_PUBKEY)
-            {
-                vchPubKey = item.second;
-            }
-            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 == NULL || keystore->HaveKey(vchPubKey))
-            {
-                vchPubKeyRet = vchPubKey;
-                return true;
-            }
+            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)
+        {
+            if (!keystore.HaveKey(uint160(item.second)))
+                return false;
+        }
+        else
+        {
+            return false;
         }
     }
-    return false;
-}
 
+    return true;
+}
 
-bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret)
+bool static ExtractAddressInner(const CScript& scriptPubKey, const CKeyStore* keystore, CBitcoinAddress& addressRet)
 {
-    hash160Ret = 0;
-
     vector<pair<opcodetype, valtype> > vSolution;
     if (!Solver(scriptPubKey, vSolution))
         return false;
 
     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)
+        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;
index ae9fdff..e61ea2f 100644 (file)
@@ -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.
 #ifndef H_BITCOIN_SCRIPT
@@ -10,6 +11,8 @@
 #include <string>
 #include <vector>
 
+#include <boost/foreach.hpp>
+
 class CTransaction;
 
 enum
@@ -486,7 +489,7 @@ 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;
     }
 
@@ -622,7 +625,7 @@ public:
     }
 
 
-    uint160 GetBitcoinAddressHash160() const
+    CBitcoinAddress GetBitcoinAddress() const
     {
         opcodetype opcode;
         std::vector<unsigned char> vch;
@@ -634,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);
     }
 
-    std::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;
+        *this << OP_DUP << OP_HASH160 << address.GetHash160() << OP_EQUALVERIFY << OP_CHECKSIG;
     }
 
     void SetBitcoinAddress(const std::vector<unsigned char>& vchPubKey)
     {
-        SetBitcoinAddress(Hash160(vchPubKey));
-    }
-
-    bool SetBitcoinAddress(const std::string& strAddress)
-    {
-        this->clear();
-        uint160 hash160;
-        if (!AddressToHash160(strAddress, hash160))
-            return false;
-        SetBitcoinAddress(hash160);
-        return true;
+        SetBitcoinAddress(CBitcoinAddress(vchPubKey));
     }
 
 
@@ -707,11 +692,11 @@ public:
 
 
 
+bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, int nHashType);
 
 bool IsStandard(const CScript& scriptPubKey);
 bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
-bool ExtractPubKey(const CScript& scriptPubKey, const CKeyStore* pkeystore, std::vector<unsigned char>& vchPubKeyRet);
-bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret);
+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);
 
index 31862a7..698bdfe 100644 (file)
@@ -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.
 #ifndef BITCOIN_SERIALIZE_H
@@ -28,19 +29,47 @@ 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 = 32400;
+static const int VERSION = 40000;
 static const char* pszSubVer = "";
 static const bool VERSION_IS_BETA = true;
 
-
-
-
-
+// Used to bypass the rule against non-const reference to temporary
+// where it makes sense with wrappers such as CFlatData or CTxDB
+template<typename T>
+inline T& REF(const T& val)
+{
+    return const_cast<T&>(val);
+}
 
 /////////////////////////////////////////////////////////////////
 //
@@ -755,7 +784,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>
@@ -777,10 +807,22 @@ 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);
+            munlock(p, sizeof(T) * n);
+        }
         std::allocator<T>::deallocate(p, n);
     }
 };
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
new file mode 100644 (file)
index 0000000..13feb86
--- /dev/null
@@ -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()
index 3b7d2d2..0230bb6 100644 (file)
@@ -1,6 +1,18 @@
-#define BOOST_TEST_MODULE uint160
+#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 (file)
index 0000000..e6eb0f0
--- /dev/null
@@ -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()
index 66ffd28..42c8275 100644 (file)
@@ -1,8 +1,10 @@
+#include <boost/test/unit_test.hpp>
+
 #include "../uint256.h"
 
 BOOST_AUTO_TEST_SUITE(uint160_tests)
 
-BOOST_AUTO_TEST_CASE(equality)
+BOOST_AUTO_TEST_CASE(uint160_equality)
 {
     uint160 num1 = 10;
     uint160 num2 = 11;
index cbae9bf..c5d45e2 100644 (file)
@@ -1,8 +1,10 @@
+#include <boost/test/unit_test.hpp>
+
 #include "../uint256.h"
 
 BOOST_AUTO_TEST_SUITE(uint256_tests)
 
-BOOST_AUTO_TEST_CASE(equality)
+BOOST_AUTO_TEST_CASE(uint256_equality)
 {
     uint256 num1 = 10;
     uint256 num2 = 11;
index 877b2a7..24e78f7 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -236,16 +237,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;
-        pwalletMain->SetDefaultKey(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;
+}
+
 
 
 
@@ -332,7 +369,12 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
     // Fill your address text box
     vector<unsigned char> vchPubKey;
     if (CWalletDB(pwalletMain->strWalletFile,"r").ReadDefaultKey(vchPubKey))
-        m_textCtrlAddress->SetValue(PubKeyToAddress(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();
@@ -523,7 +565,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());
@@ -664,24 +706,23 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
             {
                 if (pwalletMain->IsMine(txout))
                 {
-                    vector<unsigned char> vchPubKey;
-                    if (ExtractPubKey(txout.scriptPubKey, pwalletMain, vchPubKey))
+                    CBitcoinAddress address;
+                    if (ExtractAddress(txout.scriptPubKey, pwalletMain, address))
                     {
-                        CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+                        CRITICAL_BLOCK(pwalletMain->cs_wallet)
                         {
                             //strDescription += _("Received payment to ");
                             //strDescription += _("Received with address ");
                             strDescription += _("Received with: ");
-                            string strAddress = PubKeyToAddress(vchPubKey);
-                            map<string, string>::iterator mi = pwalletMain->mapAddressBook.find(strAddress);
+                            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;
@@ -737,6 +778,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
                 if (pwalletMain->IsMine(txout))
                     continue;
 
+                CBitcoinAddress address;
                 string strAddress;
                 if (!mapValue["to"].empty())
                 {
@@ -746,15 +788,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(pwalletMain->cs_mapAddressBook)
-                    if (pwalletMain->mapAddressBook.count(strAddress) && !pwalletMain->mapAddressBook[strAddress].empty())
-                        strDescription += pwalletMain->mapAddressBook[strAddress] + " ";
+                CRITICAL_BLOCK(pwalletMain->cs_wallet)
+                    if (pwalletMain->mapAddressBook.count(address) && !pwalletMain->mapAddressBook[address].empty())
+                        strDescription += pwalletMain->mapAddressBook[address] + " ";
                 strDescription += strAddress;
                 if (!mapValue["message"].empty())
                 {
@@ -822,7 +863,7 @@ 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(pwalletMain->cs_mapWallet)
+        TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
         {
             printf("RefreshListCtrl starting\n");
             fEntered = true;
@@ -850,7 +891,7 @@ void CMainFrame::OnIdle(wxIdleEvent& event)
             if (fShutdown)
                 return;
             bool fEntered = false;
-            TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+            TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
             {
                 fEntered = true;
                 uint256& hash = vSorted[i++].second;
@@ -873,7 +914,7 @@ void CMainFrame::OnIdle(wxIdleEvent& event)
         static int64 nLastTime;
         if (GetTime() > nLastTime + 30)
         {
-            TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+            TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
             {
                 nLastTime = GetTime();
                 for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
@@ -897,7 +938,7 @@ void CMainFrame::RefreshStatusColumn()
     if (nTop == nLastTop && pindexLastBest == pindexBest)
         return;
 
-    TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+    TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
         int nStart = nTop;
         int nEnd = min(nStart + 100, m_listCtrl->GetItemCount());
@@ -1017,7 +1058,7 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
         // Update listctrl contents
         if (!pwalletMain->vWalletUpdated.empty())
         {
-            TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+            TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
             {
                 string strTop;
                 if (m_listCtrl->GetItemCount())
@@ -1035,7 +1076,7 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
         }
 
         // Balance total
-        TRY_CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+        TRY_CRITICAL_BLOCK(pwalletMain->cs_wallet)
         {
             fPaintedBalance = true;
             m_staticTextBalance->SetLabel(FormatMoney(pwalletMain->GetBalance()) + "  ");
@@ -1075,7 +1116,7 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
     m_statusBar->SetStatusText(strStatus, 2);
 
     // Update receiving address
-    string strDefaultAddress = PubKeyToAddress(pwalletMain->vchDefaultKey);
+    string strDefaultAddress = CBitcoinAddress(pwalletMain->vchDefaultKey).ToString();
     if (m_textCtrlAddress->GetValue() != strDefaultAddress)
         m_textCtrlAddress->SetValue(strDefaultAddress);
 }
@@ -1123,6 +1164,166 @@ 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();
+
+    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
@@ -1183,11 +1384,22 @@ void CMainFrame::OnButtonNew(wxCommandEvent& event)
         return;
     string strName = dialog.GetValue();
 
+    string strAddress;
+
+    bool fWasLocked = pwalletMain->IsLocked();
+    if (!GetWalletPassphrase())
+        return;
+
     // Generate new key
-    string strAddress = PubKeyToAddress(pwalletMain->GetKeyFromKeyPool());
+    std::vector<unsigned char> newKey;
+    pwalletMain->GetKeyFromPool(newKey, true);
+    strAddress = CBitcoinAddress(newKey).ToString();
+
+    if (fWasLocked)
+        pwalletMain->Lock();
 
     // Save
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
         pwalletMain->SetAddressBookName(strAddress, strName);
     SetDefaultReceivingAddress(strAddress);
 }
@@ -1206,7 +1418,7 @@ void CMainFrame::OnListItemActivated(wxListEvent& event)
 {
     uint256 hash((string)GetItemText(m_listCtrl, event.GetIndex(), 1));
     CWalletTx wtx;
-    CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
         map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
         if (mi == pwalletMain->mapWallet.end())
@@ -1237,7 +1449,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
 #ifdef __WXMSW__
     SetSize(nScaleX * GetSize().GetWidth(), nScaleY * GetSize().GetHeight());
 #endif
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
         string strHTML;
         strHTML.reserve(4000);
@@ -1289,17 +1501,16 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
                 {
                     if (pwalletMain->IsMine(txout))
                     {
-                        vector<unsigned char> vchPubKey;
-                        if (ExtractPubKey(txout.scriptPubKey, pwalletMain, vchPubKey))
+                        CBitcoinAddress address;
+                        if (ExtractAddress(txout.scriptPubKey, pwalletMain, address))
                         {
-                            string strAddress = PubKeyToAddress(vchPubKey);
-                            if (pwalletMain->mapAddressBook.count(strAddress))
+                            if (pwalletMain->mapAddressBook.count(address))
                             {
                                 strHTML += string() + _("<b>From:</b> ") + _("unknown") + "<br>";
                                 strHTML += _("<b>To:</b> ");
-                                strHTML += HtmlEscape(strAddress);
-                                if (!pwalletMain->mapAddressBook[strAddress].empty())
-                                    strHTML += _(" (yours, label: ") + pwalletMain->mapAddressBook[strAddress] + ")";
+                                strHTML += HtmlEscape(address.ToString());
+                                if (!pwalletMain->mapAddressBook[address].empty())
+                                    strHTML += _(" (yours, label: ") + pwalletMain->mapAddressBook[address] + ")";
                                 else
                                     strHTML += _(" (yours)");
                                 strHTML += "<br>";
@@ -1375,13 +1586,13 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
                     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 (pwalletMain->mapAddressBook.count(strAddress) && !pwalletMain->mapAddressBook[strAddress].empty())
-                                strHTML += pwalletMain->mapAddressBook[strAddress] + " ";
+                            if (pwalletMain->mapAddressBook.count(address) && !pwalletMain->mapAddressBook[address].empty())
+                                strHTML += pwalletMain->mapAddressBook[address] + " ";
                             strHTML += strAddress;
                             strHTML += "<br>";
                         }
@@ -1449,7 +1660,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
             strHTML += HtmlEscape(wtx.ToString(), true);
 
             strHTML += "<br><b>Inputs:</b><br>";
-            CRITICAL_BLOCK(pwalletMain->cs_mapWallet)
+            CRITICAL_BLOCK(pwalletMain->cs_wallet)
             {
                 BOOST_FOREACH(const CTxIn& txin, wtx.vin)
                 {
@@ -1595,7 +1806,11 @@ void SetStartOnSystemStartup(bool fAutoStart)
 {
     if (!fAutoStart)
     {
+#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
+        unlink(GetAutostartFilePath().string().c_str());
+#else
         unlink(GetAutostartFilePath().native_file_string().c_str());
+#endif
     }
     else
     {
@@ -1942,29 +2157,47 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event)
         }
 
         // Parse bitcoin address
-        uint160 hash160;
-        bool fBitcoinAddress = AddressToHash160(strAddress, hash160);
+        CBitcoinAddress address(strAddress);
+        bool fBitcoinAddress = address.IsValid();
 
         if (fBitcoinAddress)
         {
+            bool fWasLocked = pwalletMain->IsLocked();
+            if (!GetWalletPassphrase())
+                return;
+
+            string strError;
            CRITICAL_BLOCK(cs_main)
+            CRITICAL_BLOCK(pwalletMain->cs_wallet)
            {
                 // Send to bitcoin address
                 CScript scriptPubKey;
-                scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
+                scriptPubKey.SetBitcoinAddress(address);
 
-                string strError = pwalletMain->SendMoney(scriptPubKey, nValue, wtx, true);
-                if (strError == "")
-                    wxMessageBox(_("Payment sent  "), _("Sending..."));
-                else if (strError == "ABORTED")
-                    return; // leave send dialog open
-                else
-                {
-                    wxMessageBox(strError + "  ", _("Sending..."));
-                    EndModal(false);
-                    return;
-                }
-           }
+                strError = pwalletMain->SendMoney(scriptPubKey, nValue, wtx, true);
+            }
+            if (strError == "")
+            {
+                pframeMain->RefreshListCtrl();
+                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
         {
@@ -1985,8 +2218,8 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event)
                 return;
         }
 
-        CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
-            if (!pwalletMain->mapAddressBook.count(strAddress))
+        CRITICAL_BLOCK(pwalletMain->cs_wallet)
+            if (!pwalletMain->mapAddressBook.count(address))
                 pwalletMain->SetAddressBookName(strAddress, "");
 
         EndModal(true);
@@ -2237,72 +2470,89 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
             return;
     }
 
+    // Pay
+    if (!Status(_("Creating transaction...")))
+        return;
+    if (nPrice + nTransactionFee > pwalletMain->GetBalance())
+    {
+        Error(_("Insufficient funds"));
+        return;
+    }
+
+    CReserveKey reservekey(pwalletMain);
+    int64 nFeeRequired;
+    bool fWasLocked = pwalletMain->IsLocked();
+    if (!GetWalletPassphrase())
+        return;
+
+    bool fTxCreated = false;
     CRITICAL_BLOCK(cs_main)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
-        // Pay
-        if (!Status(_("Creating transaction...")))
-            return;
-        if (nPrice + nTransactionFee > pwalletMain->GetBalance())
-        {
-            Error(_("Insufficient funds"));
-            return;
-        }
-        CReserveKey reservekey(pwalletMain);
-        int64 nFeeRequired;
-        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;
-        }
+        fTxCreated = pwalletMain->CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired);
+    }
+    if (!fTxCreated)
+    {
+        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;
+    }
 
-        // Transaction fee
-        if (!ThreadSafeAskFee(nFeeRequired, _("Sending..."), this))
-        {
-            Error(_("Transaction aborted"));
-            return;
-        }
+    if (fWasLocked)
+        pwalletMain->Lock();
 
-        // Make sure we're still connected
-        CNode* pnode = ConnectNode(addr, 2 * 60 * 60);
-        if (!pnode)
-        {
-            Error(_("Lost connection, transaction cancelled"));
-            return;
-        }
+    // Transaction fee
+    if (!ThreadSafeAskFee(nFeeRequired, _("Sending..."), this))
+    {
+        Error(_("Transaction aborted"));
+        return;
+    }
 
-        // Last chance to cancel
-        Sleep(50);
+    // Make sure we're still connected
+    CNode* pnode = ConnectNode(addr, 2 * 60 * 60);
+    if (!pnode)
+    {
+        Error(_("Lost connection, transaction cancelled"));
+        return;
+    }
+
+    // Last chance to cancel
+    Sleep(50);
+    if (!Status())
+        return;
+    fCanCancel = false;
+    if (fAbort)
+    {
+        fCanCancel = true;
         if (!Status())
             return;
         fCanCancel = false;
-        if (fAbort)
-        {
-            fCanCancel = true;
-            if (!Status())
-                return;
-            fCanCancel = false;
-        }
-        if (!Status(_("Sending payment...")))
-            return;
+    }
+    if (!Status(_("Sending payment...")))
+        return;
 
-        // Commit
-        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;
-        }
+    // Commit
+    bool fTxCommitted = false;
+    CRITICAL_BLOCK(cs_main)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
+    {
+        fTxCommitted = pwalletMain->CommitTransaction(wtx, reservekey);
+    }
+    if (!fTxCommitted)
+    {
+        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;
+    }
 
-        // Send payment tx to seller, with response going to OnReply3 via event handler
-        CWalletTx wtxSend = wtx;
-        wtxSend.fFromMe = false;
-        pnode->PushRequest("submitorder", wtxSend, SendingDialogOnReply3, this);
+    // Send payment tx to seller, with response going to OnReply3 via event handler
+    CWalletTx wtxSend = wtx;
+    wtxSend.fFromMe = false;
+    pnode->PushRequest("submitorder", wtxSend, SendingDialogOnReply3, this);
 
-        Status(_("Waiting for confirmation..."));
-        MainFrameRepaint();
-    }
+    Status(_("Waiting for confirmation..."));
+    MainFrameRepaint();
 }
 
 void SendingDialogOnReply3(void* parg, CDataStream& vRecv)
@@ -2383,19 +2633,17 @@ CAddressBookDialog::CAddressBookDialog(wxWindow* parent, const wxString& strInit
     m_listCtrlReceiving->SetFocus();
 
     // Fill listctrl with address book data
-    CRITICAL_BLOCK(pwalletMain->cs_mapKeys)
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
         string strDefaultReceiving = (string)pframeMain->m_textCtrlAddress->GetValue();
-        BOOST_FOREACH(const PAIRTYPE(string, string)& item, pwalletMain->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);
         }
     }
@@ -2446,7 +2694,7 @@ void CAddressBookDialog::OnListEndLabelEdit(wxListEvent& event)
     if (event.IsEditCancelled())
         return;
     string strAddress = (string)GetItemText(m_listCtrl, event.GetIndex(), 1);
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
         pwalletMain->SetAddressBookName(strAddress, string(event.GetText()));
     pframeMain->RefreshListCtrl();
 }
@@ -2482,7 +2730,7 @@ void CAddressBookDialog::OnButtonDelete(wxCommandEvent& event)
         if (m_listCtrl->GetItemState(nIndex, wxLIST_STATE_SELECTED))
         {
             string strAddress = (string)GetItemText(m_listCtrl, nIndex, 1);
-            CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+            CRITICAL_BLOCK(pwalletMain->cs_wallet)
                 pwalletMain->DelAddressBookName(strAddress);
             m_listCtrl->DeleteItem(nIndex);
         }
@@ -2502,8 +2750,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;
@@ -2542,7 +2790,7 @@ void CAddressBookDialog::OnButtonEdit(wxCommandEvent& event)
     }
 
     // Write back
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
     {
         if (strAddress != strAddressOrg)
             pwalletMain->DelAddressBookName(strAddressOrg);
@@ -2582,12 +2830,21 @@ void CAddressBookDialog::OnButtonNew(wxCommandEvent& event)
             return;
         strName = dialog.GetValue();
 
+        bool fWasLocked = pwalletMain->IsLocked();
+        if (!GetWalletPassphrase())
+            return;
+
         // Generate new key
-        strAddress = PubKeyToAddress(pwalletMain->GetKeyFromKeyPool());
+        std::vector<unsigned char> newKey;
+        pwalletMain->GetKeyFromPool(newKey, true);
+        strAddress = CBitcoinAddress(newKey).ToString();
+
+        if (fWasLocked)
+            pwalletMain->Lock();
     }
 
     // Add to list and select it
-    CRITICAL_BLOCK(pwalletMain->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwalletMain->cs_wallet)
         pwalletMain->SetAddressBookName(strAddress, strName);
     int nIndex = InsertLine(m_listCtrl, strName, strAddress);
     SetSelection(m_listCtrl, nIndex);
index 3f06ad9..2a128a7 100644 (file)
--- a/src/ui.h
+++ b/src/ui.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.
 #ifndef BITCOIN_UI_H
@@ -59,6 +60,8 @@ protected:
     void OnMenuFileExit(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);
index 1b901a1..6d219ad 100644 (file)
@@ -32,6 +32,12 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        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 );
@@ -187,6 +193,8 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        this->Connect( wxEVT_PAINT, wxPaintEventHandler( CMainFrameBase::OnPaint ) );
        this->Connect( m_menuFileExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( CMainFrameBase::OnMenuFileExit ) );
        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 ) );
@@ -245,6 +253,8 @@ CMainFrameBase::~CMainFrameBase()
        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::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 ) );
@@ -357,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 );
index 78f3d1b..ca0730b 100644 (file)
@@ -98,6 +98,8 @@ class CMainFrameBase : public wxFrame
                virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
                virtual void OnMenuFileExit( wxCommandEvent& 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(); }
@@ -115,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;
index 14feb16..3e20201 100644 (file)
@@ -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.
 #ifndef BITCOIN_UINT256_H
index a499c50..6bd52ed 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -761,8 +762,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);
@@ -791,7 +792,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);
@@ -907,4 +910,140 @@ string FormatFullVersion()
 
 
 
+#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
+{
+    CLockLocation(const char* pszName, const char* pszFile, int nLine)
+    {
+        mutexName = pszName;
+        sourceFile = pszFile;
+        sourceLine = nLine;
+    }
+
+    std::string ToString() const
+    {
+        return mutexName+"  "+sourceFile+":"+itostr(sourceLine);
+    }
+
+private:
+    std::string mutexName;
+    std::string sourceFile;
+    int sourceLine;
+};
+
+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 std::pair<CCriticalSection*, CCriticalSection*>& mismatch, 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)
+    {
+        if (i.first == mismatch.first) printf(" (1)");
+        if (i.first == mismatch.second) printf(" (2)");
+        printf(" %s\n", i.second.ToString().c_str());
+    }
+    printf("Current lock order is:\n");
+    BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, s1)
+    {
+        if (i.first == mismatch.first) printf(" (1)");
+        if (i.first == mismatch.second) printf(" (2)");
+        printf(" %s\n", i.second.ToString().c_str());
+    }
+}
+
+static void push_lock(CCriticalSection* c, const CLockLocation& locklocation)
+{
+    bool fOrderOK = true;
+    if (lockstack.get() == NULL)
+        lockstack.reset(new LockStack);
+
+    if (fDebug) printf("Locking: %s\n", locklocation.ToString().c_str());
+    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(p1, lockorders[p2], lockorders[p1]);
+            break;
+        }
+    }
+    dd_mutex.unlock();
+}
+
+static void pop_lock()
+{
+    if (fDebug) 
+    {
+        const CLockLocation& locklocation = (*lockstack).rbegin()->second;
+        printf("Unlocked: %s\n", locklocation.ToString().c_str());
+    }
+    dd_mutex.lock();
+    (*lockstack).pop_back();
+    dd_mutex.unlock();
+}
+
+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 */
index e711057..3d7ef10 100644 (file)
@@ -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.
 #ifndef BITCOIN_UTIL_H
@@ -66,14 +67,6 @@ typedef unsigned long long  uint64;
 // This is needed because the foreach macro can't get over the comma in pair<t1, t2>
 #define PAIRTYPE(t1, t2)    pair<t1, t2>
 
-// Used to bypass the rule against non-const reference to temporary
-// where it makes sense with wrappers such as CFlatData or CTxDB
-template<typename T>
-inline T& REF(const T& val)
-{
-    return (T&)val;
-}
-
 // Align by increasing pointer, must have extra space at end of buffer
 template <size_t nBytes, typename T>
 T* alignup(T* p)
@@ -222,31 +215,17 @@ std::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
@@ -254,9 +233,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!
@@ -264,22 +251,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)
 
 
 
@@ -623,7 +620,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;
 }
 
@@ -648,7 +648,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);
 }
index 561a7b7..652d9fa 100644 (file)
@@ -1,4 +1,5 @@
-// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers
+// Copyright (c) 2009-2011 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
 // Copyright (c) 2011 The PPCoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -6,11 +7,11 @@
 #include "headers.h"
 #include "db.h"
 #include "cryptopp/sha.h"
+#include "crypter.h"
 
 using namespace std;
 
 
-
 //////////////////////////////////////////////////////////////////////////////
 //
 // mapWallet
@@ -18,10 +19,178 @@ using namespace std;
 
 bool CWallet::AddKey(const CKey& key)
 {
-    this->CKeyStore::AddKey(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;
-    return CWalletDB(strWalletFile).WriteKey(key.GetPubKey(), key.GetPrivKey());
+    CRITICAL_BLOCK(cs_wallet)
+    {
+        if (pwalletdbEncryption)
+            return pwalletdbEncryption->WriteCryptedKey(vchPubKey, vchCryptedSecret);
+        else
+            return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret);
+    }
+}
+
+bool CWallet::Unlock(const string& strWalletPassphrase)
+{
+    if (!IsLocked())
+        return false;
+
+    CCrypter crypter;
+    CKeyingMaterial vMasterKey;
+
+    CRITICAL_BLOCK(cs_wallet)
+        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)
+{
+    bool fWasLocked = IsLocked();
+
+    CRITICAL_BLOCK(cs_wallet)
+    {
+        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)
+{
+    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;
+
+    CRITICAL_BLOCK(cs_wallet)
+    {
+        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)
@@ -29,7 +198,7 @@ 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)
+    CRITICAL_BLOCK(cs_wallet)
     {
         BOOST_FOREACH(const CTxIn& txin, tx.vin)
         {
@@ -52,7 +221,7 @@ void CWallet::WalletUpdateSpent(const CTransaction &tx)
 bool CWallet::AddToWallet(const CWalletTx& wtxIn)
 {
     uint256 hash = wtxIn.GetHash();
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         // 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));
@@ -99,7 +268,14 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
         BOOST_FOREACH(const CTxOut& txout, wtx.vout)
         {
             if (txout.scriptPubKey == scriptDefaultKey)
-                SetDefaultKey(GetKeyFromKeyPool());
+            {
+                std::vector<unsigned char> newDefaultKey;
+                if (GetKeyFromPool(newDefaultKey, false))
+                {
+                    SetDefaultKey(newDefaultKey);
+                    SetAddressBookName(CBitcoinAddress(vchDefaultKey), "");
+                }
+            }
         }
 
         // Notify UI
@@ -117,18 +293,21 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
 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))
+    CRITICAL_BLOCK(cs_wallet)
     {
-        CWalletTx wtx(this,tx);
-        // Get merkle branch if transaction was found in a block
-        if (pblock)
-            wtx.SetMerkleBranch(pblock);
-        return AddToWallet(wtx);
+        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);
     }
-    else
-        WalletUpdateSpent(tx);
     return false;
 }
 
@@ -136,7 +315,7 @@ bool CWallet::EraseFromWallet(uint256 hash)
 {
     if (!fFileBacked)
         return false;
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         if (mapWallet.erase(hash))
             CWalletDB(strWalletFile).EraseTx(hash);
@@ -147,7 +326,7 @@ bool CWallet::EraseFromWallet(uint256 hash)
 
 bool CWallet::IsMine(const CTxIn &txin) const
 {
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
         if (mi != mapWallet.end())
@@ -163,7 +342,7 @@ bool CWallet::IsMine(const CTxIn &txin) const
 
 int64 CWallet::GetDebit(const CTxIn &txin) const
 {
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
         if (mi != mapWallet.end())
@@ -179,19 +358,6 @@ int64 CWallet::GetDebit(const CTxIn &txin) const
 
 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;
 }
 
@@ -199,7 +365,7 @@ int CWalletTx::GetRequestCount() const
 {
     // Returns -1 if it wasn't being tracked
     int nRequests = -1;
-    CRITICAL_BLOCK(pwallet->cs_mapRequestCount)
+    CRITICAL_BLOCK(pwallet->cs_wallet)
     {
         if (IsCoinBase())
         {
@@ -234,8 +400,8 @@ int CWalletTx::GetRequestCount() const
     return nRequests;
 }
 
-void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<string, int64> >& listReceived,
-                           list<pair<string, int64> >& listSent, int64& nFee, string& strSentAccount) const
+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();
@@ -263,14 +429,9 @@ void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, l
     // but non-standard clients might (so return a list of address/amount pairs)
     BOOST_FOREACH(const CTxOut& txout, vout)
     {
-        string address;
-        uint160 hash160;
+        CBitcoinAddress address;
         vector<unsigned char> vchPubKey;
-        if (ExtractHash160(txout.scriptPubKey, hash160))
-            address = Hash160ToAddress(hash160);
-        else if (ExtractPubKey(txout.scriptPubKey, NULL, vchPubKey))
-            address = PubKeyToAddress(vchPubKey);
-        else
+        if (!ExtractAddress(txout.scriptPubKey, NULL, address))
         {
             printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
                    this->GetHash().ToString().c_str());
@@ -298,25 +459,25 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, i
     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;
     GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
 
     if (strAccount == "")
         nGenerated = allGeneratedMature;
     if (strAccount == strSentAccount)
     {
-        BOOST_FOREACH(const PAIRTYPE(string,int64)& s, listSent)
+        BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& s, listSent)
             nSent += s.second;
         nFee = allFee;
     }
-    CRITICAL_BLOCK(pwallet->cs_mapAddressBook)
+    CRITICAL_BLOCK(pwallet->cs_wallet)
     {
-        BOOST_FOREACH(const PAIRTYPE(string,int64)& r, listReceived)
+        BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived)
         {
             if (pwallet->mapAddressBook.count(r.first))
             {
-                map<string, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first);
+                map<CBitcoinAddress, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first);
                 if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount)
                     nReceived += r.second;
             }
@@ -340,7 +501,7 @@ void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
             vWorkQueue.push_back(txin.prevout.hash);
 
         // This critsect is OK because txdb is already open
-        CRITICAL_BLOCK(pwallet->cs_mapWallet)
+        CRITICAL_BLOCK(pwallet->cs_wallet)
         {
             map<uint256, const CMerkleTx*> mapWalletPrev;
             set<uint256> setAlreadyDone;
@@ -396,7 +557,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
     int ret = 0;
 
     CBlockIndex* pindex = pindexStart;
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         while (pindex)
         {
@@ -417,7 +578,7 @@ void CWallet::ReacceptWalletTransactions()
 {
     CTxDB txdb("r");
     bool fRepeat = true;
-    while (fRepeat) CRITICAL_BLOCK(cs_mapWallet)
+    while (fRepeat) CRITICAL_BLOCK(cs_wallet)
     {
         fRepeat = false;
         vector<CDiskTxPos> vMissingTx;
@@ -520,7 +681,7 @@ void CWallet::ResendWalletTransactions()
     // Rebroadcast any of our txes that aren't in a block yet
     printf("ResendWalletTransactions()\n");
     CTxDB txdb("r");
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         // Sort them in chronological order
         multimap<unsigned int, CWalletTx*> mapSorted;
@@ -553,10 +714,8 @@ void CWallet::ResendWalletTransactions()
 
 int64 CWallet::GetBalance() const
 {
-    int64 nStart = GetTimeMillis();
-
     int64 nTotal = 0;
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
         {
@@ -567,7 +726,6 @@ int64 CWallet::GetBalance() const
         }
     }
 
-    //printf("GetBalance() %"PRI64d"ms\n", GetTimeMillis() - nStart);
     return nTotal;
 }
 
@@ -584,7 +742,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe
     vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue;
     int64 nTotalLower = 0;
 
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
        vector<const CWalletTx*> vCoins;
        vCoins.reserve(mapWallet.size());
@@ -742,10 +900,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
     wtxNew.pwallet = this;
 
     CRITICAL_BLOCK(cs_main)
+    CRITICAL_BLOCK(cs_wallet)
     {
         // txdb must be opened before the mapWallet lock
         CTxDB txdb("r");
-        CRITICAL_BLOCK(cs_mapWallet)
         {
             nFeeRet = nTransactionFee;
             loop
@@ -771,9 +929,17 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
                     dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain();
                 }
 
-                // Fill a vout back to self with any change
-                int64 nChange = nValueIn - nTotalValue;
-                if (nChange >= CENT)
+                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
@@ -784,11 +950,11 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
 
                     // Reserve a new key pair from key pool
                     vector<unsigned char> vchPubKey = reservekey.GetReservedKey();
-                    assert(mapKeys.count(vchPubKey));
+                    // assert(mapKeys.count(vchPubKey));
 
                     // Fill a vout to ourself, using same address type as the payment
                     CScript scriptChange;
-                    if (vecSend[0].first.GetBitcoinAddressHash160() != 0)
+                    if (vecSend[0].first.GetBitcoinAddress().IsValid())
                         scriptChange.SetBitcoinAddress(vchPubKey);
                     else
                         scriptChange << vchPubKey << OP_CHECKSIG;
@@ -847,9 +1013,9 @@ bool CWallet::CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& w
 bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
 {
     CRITICAL_BLOCK(cs_main)
+    CRITICAL_BLOCK(cs_wallet)
     {
         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
@@ -879,8 +1045,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
         }
 
         // Track how many getdata requests our transaction gets
-        CRITICAL_BLOCK(cs_mapRequestCount)
-            mapRequestCount[wtxNew.GetHash()] = 0;
+        mapRequestCount[wtxNew.GetHash()] = 0;
 
         // Broadcast
         if (!wtxNew.AcceptToMemoryPool())
@@ -898,11 +1063,17 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
 
 
 
-// requires cs_main lock
 string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
 {
     CReserveKey reservekey(this);
     int64 nFeeRequired;
+
+    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;
@@ -926,8 +1097,7 @@ string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew,
 
 
 
-// requires cs_main lock
-string CWallet::SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
+string CWallet::SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
 {
     // Check amount
     if (nValue <= 0)
@@ -937,8 +1107,7 @@ string CWallet::SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWall
 
     // Parse bitcoin address
     CScript scriptPubKey;
-    if (!scriptPubKey.SetBitcoinAddress(strAddress))
-        return _("Invalid bitcoin address");
+    scriptPubKey.SetBitcoinAddress(address);
 
     return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee);
 }
@@ -946,50 +1115,54 @@ string CWallet::SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWall
 
 
 
-bool CWallet::LoadWallet(bool& fFirstRunRet)
+int CWallet::LoadWallet(bool& fFirstRunRet)
 {
     if (!fFileBacked)
         return false;
     fFirstRunRet = false;
-    if (!CWalletDB(strWalletFile,"cr+").LoadWallet(this))
-        return false;
+    int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
+    if (nLoadWalletRet != DB_LOAD_OK)
+        return nLoadWalletRet;
     fFirstRunRet = vchDefaultKey.empty();
 
-    if (!mapKeys.count(vchDefaultKey))
+    if (!HaveKey(Hash160(vchDefaultKey)))
     {
-        // Create new default key
+        // Create new keyUser and set as default key
         RandAddSeedPerfmon();
 
-        SetDefaultKey(GetKeyFromKeyPool());
-        if (!SetAddressBookName(PubKeyToAddress(vchDefaultKey), ""))
-            return false;
+        std::vector<unsigned char> newDefaultKey;
+        if (!GetKeyFromPool(newDefaultKey, false))
+            return DB_LOAD_FAIL;
+        SetDefaultKey(newDefaultKey);
+        if (!SetAddressBookName(CBitcoinAddress(vchDefaultKey), ""))
+            return DB_LOAD_FAIL;
     }
 
     CreateThread(ThreadFlushWalletDB, &strWalletFile);
-    return true;
+    return DB_LOAD_OK;
 }
 
 
-bool CWallet::SetAddressBookName(const string& strAddress, const string& strName)
+bool CWallet::SetAddressBookName(const CBitcoinAddress& address, const string& strName)
 {
-    mapAddressBook[strAddress] = strName;
+    mapAddressBook[address] = strName;
     if (!fFileBacked)
         return false;
-    return CWalletDB(strWalletFile).WriteName(strAddress, strName);
+    return CWalletDB(strWalletFile).WriteName(address.ToString(), strName);
 }
 
-bool CWallet::DelAddressBookName(const string& strAddress)
+bool CWallet::DelAddressBookName(const CBitcoinAddress& address)
 {
-    mapAddressBook.erase(strAddress);
+    mapAddressBook.erase(address);
     if (!fFileBacked)
         return false;
-    return CWalletDB(strWalletFile).EraseName(strAddress);
+    return CWalletDB(strWalletFile).EraseName(address.ToString());
 }
 
 
 void CWallet::PrintWallet(const CBlock& block)
 {
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         if (mapWallet.count(block.vtx[0].GetHash()))
         {
@@ -1002,7 +1175,7 @@ void CWallet::PrintWallet(const CBlock& block)
 
 bool CWallet::GetTransaction(const uint256 &hashTx, CWalletTx& wtx)
 {
-    CRITICAL_BLOCK(cs_mapWallet)
+    CRITICAL_BLOCK(cs_wallet)
     {
         map<uint256, CWalletTx>::iterator mi = mapWallet.find(hashTx);
         if (mi != mapWallet.end())
@@ -1033,14 +1206,13 @@ bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut)
     return true;
 }
 
-void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
+bool CWallet::TopUpKeyPool()
 {
-    nIndex = -1;
-    keypool.vchPubKey.clear();
-    CRITICAL_BLOCK(cs_main)
-    CRITICAL_BLOCK(cs_mapWallet)
-    CRITICAL_BLOCK(cs_setKeyPool)
+    CRITICAL_BLOCK(cs_wallet)
     {
+        if (IsLocked())
+            return false;
+
         CWalletDB walletdb(strWalletFile);
 
         // Top up key pool
@@ -1051,18 +1223,34 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
             if (!setKeyPool.empty())
                 nEnd = *(--setKeyPool.end()) + 1;
             if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey())))
-                throw runtime_error("ReserveKeyFromKeyPool() : writing generated key failed");
+                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_wallet)
+    {
+        if (!IsLocked())
+            TopUpKeyPool();
 
         // Get the oldest key
-        assert(!setKeyPool.empty());
+        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 (!mapKeys.count(keypool.vchPubKey))
+        if (!HaveKey(Hash160(keypool.vchPubKey)))
             throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
         assert(!keypool.vchPubKey.empty());
         printf("keypool reserve %"PRI64d"\n", nIndex);
@@ -1075,10 +1263,7 @@ void CWallet::KeepKey(int64 nIndex)
     if (fFileBacked)
     {
         CWalletDB walletdb(strWalletFile);
-        CRITICAL_BLOCK(cs_main)
-        {
-            walletdb.ErasePool(nIndex);
-        }
+        walletdb.ErasePool(nIndex);
     }
     printf("keypool keep %"PRI64d"\n", nIndex);
 }
@@ -1086,18 +1271,33 @@ void CWallet::KeepKey(int64 nIndex)
 void CWallet::ReturnKey(int64 nIndex)
 {
     // Return to key pool
-    CRITICAL_BLOCK(cs_setKeyPool)
+    CRITICAL_BLOCK(cs_wallet)
         setKeyPool.insert(nIndex);
     printf("keypool return %"PRI64d"\n", nIndex);
 }
 
-vector<unsigned char> CWallet::GetKeyFromKeyPool()
+bool CWallet::GetKeyFromPool(vector<unsigned char>& result, bool fAllowReuse)
 {
     int64 nIndex = 0;
     CKeyPool keypool;
-    ReserveKeyFromKeyPool(nIndex, keypool);
-    KeepKey(nIndex);
-    return keypool.vchPubKey;
+    CRITICAL_BLOCK(cs_wallet)
+    {
+        ReserveKeyFromKeyPool(nIndex, keypool);
+        if (nIndex == -1)
+        {
+            if (fAllowReuse && !vchDefaultKey.empty())
+            {
+                result = vchDefaultKey;
+                return true;
+            }
+            if (IsLocked()) return false;
+            result = GenerateNewKey();
+            return true;
+        }
+        KeepKey(nIndex);
+        result = keypool.vchPubKey;
+    }
+    return true;
 }
 
 int64 CWallet::GetOldestKeyPoolTime()
@@ -1105,6 +1305,8 @@ int64 CWallet::GetOldestKeyPoolTime()
     int64 nIndex = 0;
     CKeyPool keypool;
     ReserveKeyFromKeyPool(nIndex, keypool);
+    if (nIndex == -1)
+        return GetTime();
     ReturnKey(nIndex);
     return keypool.nTime;
 }
@@ -1115,7 +1317,13 @@ vector<unsigned char> CReserveKey::GetReservedKey()
     {
         CKeyPool keypool;
         pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
-        vchPubKey = keypool.vchPubKey;
+        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;
index 7d9db97..1dd2e51 100644 (file)
@@ -1,4 +1,5 @@
-// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers
+// 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
@@ -12,43 +13,59 @@ class CWalletTx;
 class CReserveKey;
 class CWalletDB;
 
-class CWallet : public CKeyStore
+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;
 
 public:
+    mutable CCriticalSection cs_wallet;
+
     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<std::string, std::string> mapAddressBook;
-    mutable CCriticalSection cs_mapAddressBook;
+    std::map<CBitcoinAddress, std::string> 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);
@@ -62,12 +79,13 @@ public:
     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(std::string strAddress, 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> GetKeyFromKeyPool();
+    bool GetKeyFromPool(std::vector<unsigned char> &key, bool fAllowReuse=true);
     int64 GetOldestKeyPoolTime();
 
     bool IsMine(const CTxIn& txin) const;
@@ -84,10 +102,10 @@ public:
     }
     bool IsChange(const CTxOut& txout) const
     {
-        std::vector<unsigned char> vchPubKey;
-        if (ExtractPubKey(txout.scriptPubKey, this, vchPubKey))
-            CRITICAL_BLOCK(cs_mapAddressBook)
-                if (!mapAddressBook.count(PubKeyToAddress(vchPubKey)))
+        CBitcoinAddress address;
+        if (ExtractAddress(txout.scriptPubKey, this, address))
+            CRITICAL_BLOCK(cs_wallet)
+                if (!mapAddressBook.count(address))
                     return true;
         return false;
     }
@@ -147,18 +165,16 @@ public:
         walletdb.WriteBestBlock(loc);
     }
 
-    bool LoadWallet(bool& fFirstRunRet);
+    int LoadWallet(bool& fFirstRunRet);
 //    bool BackupWallet(const std::string& strDest);
 
-    // requires cs_mapAddressBook lock
-    bool SetAddressBookName(const std::string& strAddress, const std::string& strName);
+    bool SetAddressBookName(const CBitcoinAddress& address, const std::string& strName);
 
-    // requires cs_mapAddressBook lock
-    bool DelAddressBookName(const std::string& strAddress);
+    bool DelAddressBookName(const CBitcoinAddress& address);
 
     void UpdatedTransaction(const uint256 &hashTx)
     {
-        CRITICAL_BLOCK(cs_mapWallet)
+        CRITICAL_BLOCK(cs_wallet)
             vWalletUpdated.push_back(hashTx);
     }
 
@@ -166,7 +182,7 @@ public:
 
     void Inventory(const uint256 &hash)
     {
-        CRITICAL_BLOCK(cs_mapRequestCount)
+        CRITICAL_BLOCK(cs_wallet)
         {
             std::map<uint256, int>::iterator mi = mapRequestCount.find(hash);
             if (mi != mapRequestCount.end())
@@ -174,6 +190,11 @@ public:
         }
     }
 
+    int GetKeyPoolSize()
+    {
+        return setKeyPool.size();
+    }
+
     bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx);
 
     bool SetDefaultKey(const std::vector<unsigned char> &vchPubKey);
@@ -439,8 +460,8 @@ public:
         return nChangeCached;
     }
 
-    void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<std::string /* address */, int64> >& listReceived,
-                    std::list<std::pair<std::string /* address */, int64> >& listSent, int64& nFee, std::string& strSentAccount) const;
+    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;