Compare commits
237 Commits
v0.3.20.01
...
v0.3.23rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce148944c7 | ||
|
|
76d660ebd3 | ||
|
|
e051f1b510 | ||
|
|
a299e551fe | ||
|
|
18e39300e6 | ||
|
|
b734954a63 | ||
|
|
6854a2ade6 | ||
|
|
6de1326ba4 | ||
|
|
65ee333ae0 | ||
|
|
2661f2f7c4 | ||
|
|
3a8182c105 | ||
|
|
60152827e3 | ||
|
|
c6710c7a70 | ||
|
|
04bc3f0a63 | ||
|
|
a9d3af8821 | ||
|
|
352b4ea5b9 | ||
|
|
6f07e22210 | ||
|
|
09d1484b22 | ||
|
|
e3d884479a | ||
|
|
7a234cdae5 | ||
|
|
39105dac1b | ||
|
|
ca81b168d9 | ||
|
|
4e6303d397 | ||
|
|
482cb65690 | ||
|
|
e104c79374 | ||
|
|
7c05877df2 | ||
|
|
5fecb27c1e | ||
|
|
12a1256c1d | ||
|
|
a452d9ee2d | ||
|
|
af531f0449 | ||
|
|
0649b6af90 | ||
|
|
1d418728b0 | ||
|
|
bd39b48f19 | ||
|
|
5e1e458ecb | ||
|
|
db69432dcd | ||
|
|
7709ee622c | ||
|
|
a757ed886a | ||
|
|
6740ad3706 | ||
|
|
7609e35f10 | ||
|
|
3d962315f2 | ||
|
|
db3b14c960 | ||
|
|
20d28e6031 | ||
|
|
77172463a3 | ||
|
|
2bfda1be11 | ||
|
|
e426776598 | ||
|
|
ca253d5911 | ||
|
|
00af90ab3c | ||
|
|
a9ea3cd76d | ||
|
|
d21876cdb8 | ||
|
|
54c465f25d | ||
|
|
e295947d04 | ||
|
|
32a1753e61 | ||
|
|
1fcf6f038e | ||
|
|
ec39b59a03 | ||
|
|
95f748c54e | ||
|
|
08cf0629f5 | ||
|
|
11adda400f | ||
|
|
1c528eeee9 | ||
|
|
e4c3232f42 | ||
|
|
7ee8e5bf86 | ||
|
|
cbb2b59a90 | ||
|
|
69a27a4ec6 | ||
|
|
69ae372b51 | ||
|
|
813a3b438f | ||
|
|
fbe6d5defa | ||
|
|
98199faa0b | ||
|
|
010ca705df | ||
|
|
6c5064b5c3 | ||
|
|
97c9d444ae | ||
|
|
b201c1f600 | ||
|
|
769e457d94 | ||
|
|
b3ff4878f8 | ||
|
|
0c97aa9e14 | ||
|
|
270e944e30 | ||
|
|
112262cb24 | ||
|
|
6d62d2fb56 | ||
|
|
f441949515 | ||
|
|
00bcfe0b7e | ||
|
|
223b6f1ba4 | ||
|
|
c22feee634 | ||
|
|
bcb971f930 | ||
|
|
f53faffb91 | ||
|
|
545a679aed | ||
|
|
95f5b36772 | ||
|
|
efe06e1efd | ||
|
|
73eb306cfd | ||
|
|
9398bf946c | ||
|
|
5d1d69453a | ||
|
|
4b2e21e7ee | ||
|
|
2a2487514a | ||
|
|
a630da6400 | ||
|
|
a6a5bb7c20 | ||
|
|
04a667b076 | ||
|
|
832fb114a7 | ||
|
|
d9068ad5a1 | ||
|
|
e8adcf88cd | ||
|
|
91b8932eb1 | ||
|
|
59d18adc4c | ||
|
|
b17be7e14b | ||
|
|
c0430f42b8 | ||
|
|
6244e44999 | ||
|
|
752e598a16 | ||
|
|
e6ad2c8792 | ||
|
|
ec86134a0d | ||
|
|
2fb1124b0f | ||
|
|
4408034bcd | ||
|
|
2f62b1299f | ||
|
|
62b427ec55 | ||
|
|
894031bbd9 | ||
|
|
5c4aeb779f | ||
|
|
5f56b28629 | ||
|
|
d299c28ecc | ||
|
|
3451c5a9b3 | ||
|
|
e5577d5541 | ||
|
|
b99c23af40 | ||
|
|
519365cfa5 | ||
|
|
8737e1ee20 | ||
|
|
fbfbf94deb | ||
|
|
d67cfd146a | ||
|
|
bd3bd83dda | ||
|
|
3b7925eb7d | ||
|
|
76160f784a | ||
|
|
2296647e01 | ||
|
|
249aff45c2 | ||
|
|
06d9156b8d | ||
|
|
ddbc4647fa | ||
|
|
dec289e821 | ||
|
|
26e0de41c3 | ||
|
|
2d9b9fecd5 | ||
|
|
be2fa90b94 | ||
|
|
84c3fb07b0 | ||
|
|
a925c32cca | ||
|
|
1a5364bd19 | ||
|
|
64ad448adc | ||
|
|
ca5884873e | ||
|
|
344888addd | ||
|
|
8857aeb223 | ||
|
|
5ec05f0a28 | ||
|
|
72e962cf55 | ||
|
|
6a76c60e6c | ||
|
|
e93e5349cb | ||
|
|
657cfe721b | ||
|
|
f285d4f4f3 | ||
|
|
bf3a0902ef | ||
|
|
9a189be740 | ||
|
|
9ff411f7f7 | ||
|
|
a381eb8ddb | ||
|
|
17616eac17 | ||
|
|
a584320357 | ||
|
|
5aef2c0d55 | ||
|
|
973800b52f | ||
|
|
d7f0287235 | ||
|
|
b37f09aa2e | ||
|
|
66fb32d267 | ||
|
|
485dda9774 | ||
|
|
d89d456655 | ||
|
|
c59b6f704c | ||
|
|
79706a8e48 | ||
|
|
2e8b33824f | ||
|
|
aca3f961db | ||
|
|
335e878be8 | ||
|
|
d12ea887bc | ||
|
|
d98beea894 | ||
|
|
198fd7b0bd | ||
|
|
0a4cb86976 | ||
|
|
57b7fe4e6f | ||
|
|
6f074b71bb | ||
|
|
f5f1878ba1 | ||
|
|
b26141e2c5 | ||
|
|
a2b6c1930d | ||
|
|
8bb5edc1c9 | ||
|
|
454bc86479 | ||
|
|
3a47bf7265 | ||
|
|
8203ec4b11 | ||
|
|
0b8e4738f9 | ||
|
|
d38e683a6f | ||
|
|
c3f140033c | ||
|
|
1c09a4adb2 | ||
|
|
a07dca7cd2 | ||
|
|
b7ebc662eb | ||
|
|
f30dabb2ac | ||
|
|
e2e5f5cd9d | ||
|
|
27b7f3b43a | ||
|
|
4b88647966 | ||
|
|
d43fd8a038 | ||
|
|
2abd56f428 | ||
|
|
1bf9b3b06f | ||
|
|
dfd059173d | ||
|
|
b931ed8563 | ||
|
|
88abf70386 | ||
|
|
5de8b54c51 | ||
|
|
f4f2987273 | ||
|
|
8f58d0dbc8 | ||
|
|
12e091842f | ||
|
|
81d3b1c825 | ||
|
|
32fb5dfef7 | ||
|
|
ca221e6c21 | ||
|
|
fe460d47b0 | ||
|
|
448b4516ff | ||
|
|
f684aec4f3 | ||
|
|
cbc920d474 | ||
|
|
b104df742d | ||
|
|
8e5aaada2e | ||
|
|
c1f74f152b | ||
|
|
279ab5e62f | ||
|
|
e1205e4d15 | ||
|
|
ea7cd31751 | ||
|
|
a79409afa9 | ||
|
|
dda48ccd0f | ||
|
|
f36b494aeb | ||
|
|
395c1f44bd | ||
|
|
411493b1f7 | ||
|
|
a14bf1946d | ||
|
|
8a9cad44a5 | ||
|
|
6665aca024 | ||
|
|
c993ac6932 | ||
|
|
a357424a25 | ||
|
|
5078a54b52 | ||
|
|
84711b18bc | ||
|
|
84778a5b46 | ||
|
|
3415b15a56 | ||
|
|
8314b7f5e6 | ||
|
|
32e94947dc | ||
|
|
b0ad55a08a | ||
|
|
87504abb07 | ||
|
|
789259d2e7 | ||
|
|
83b9f42796 | ||
|
|
ccd7fe8de5 | ||
|
|
2175c9dae1 | ||
|
|
10e135af70 | ||
|
|
4d9b223ac2 | ||
|
|
6696beed45 | ||
|
|
0d0bd331ae | ||
|
|
8fd402bfcf | ||
|
|
768b41017c | ||
|
|
b1ca5eb58a | ||
|
|
f0b7952caa |
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
src/*.exe
|
||||
src/bitcoin
|
||||
src/bitcoind
|
||||
.*.swp
|
||||
*.*~*
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009-2010 Bitcoin Developers
|
||||
Copyright (c) 2009-2011 Bitcoin Developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
48
contrib/gitian.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: "bitcoin"
|
||||
suites:
|
||||
- "lucid"
|
||||
architectures:
|
||||
- "i386"
|
||||
- "amd64"
|
||||
packages:
|
||||
- "libdb4.8++-dev"
|
||||
- "libxxf86vm-dev"
|
||||
- "libgtk2.0-dev"
|
||||
- "libboost-all-dev"
|
||||
- "libssl-dev"
|
||||
- "git-core"
|
||||
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"
|
||||
script: |
|
||||
INSTDIR="$HOME/install"
|
||||
export LIBRARY_PATH="$INSTDIR/lib"
|
||||
#
|
||||
tar xzf miniupnpc-1.5.tar.gz
|
||||
cd miniupnpc-1.5
|
||||
INSTALLPREFIX=$INSTDIR make $MAKEOPTS install
|
||||
cd ..
|
||||
#
|
||||
tar xjf wxWidgets-2.9.1.tar.bz2
|
||||
cd wxWidgets-2.9.1
|
||||
./configure --prefix=$INSTDIR --enable-monolithic --disable-shared
|
||||
perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h
|
||||
make $MAKEOPTS install
|
||||
cd ..
|
||||
#
|
||||
cd bitcoin
|
||||
mkdir -p $OUTDIR/src
|
||||
cp -a . $OUTDIR/src
|
||||
rm -rf $OUTDIR/src/.git
|
||||
mv $OUTDIR/src/locale $OUTDIR
|
||||
cp $OUTDIR/src/doc/README $OUTDIR
|
||||
cp $OUTDIR/src/COPYING $OUTDIR
|
||||
cd src
|
||||
PATH=$INSTDIR/bin:$PATH make -f makefile.unix CXX="g++ -I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoin bitcoind
|
||||
mkdir -p $OUTDIR/bin/$GBUILD_BITS
|
||||
install -s bitcoin bitcoind $OUTDIR/bin/$GBUILD_BITS
|
||||
30
doc/README
Normal file
@@ -0,0 +1,30 @@
|
||||
Bitcoin 0.3.23 BETA
|
||||
|
||||
Copyright (c) 2009-2011 Bitcoin Developers
|
||||
Distributed under the MIT/X11 software license, see the accompanying
|
||||
file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
This product includes software developed by the OpenSSL Project for use in
|
||||
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com).
|
||||
|
||||
|
||||
Intro
|
||||
-----
|
||||
Bitcoin is a free open source peer-to-peer electronic cash system that is
|
||||
completely decentralized, without the need for a central server or trusted
|
||||
parties. Users hold the crypto keys to their own money and transact directly
|
||||
with each other, with the help of a P2P network to check for double-spending.
|
||||
|
||||
|
||||
Setup
|
||||
-----
|
||||
Unpack the files into a directory and run:
|
||||
bin/32/bitcoin (GUI, 32-bit)
|
||||
bin/32/bitcoind (headless, 32-bit)
|
||||
bin/64/bitcoin (GUI, 64-bit)
|
||||
bin/64/bitcoind (headless, 64-bit)
|
||||
|
||||
See the documentation at the bitcoin wiki:
|
||||
https://en.bitcoin.it/wiki/Main_Page
|
||||
|
||||
... for help and more information.
|
||||
34
doc/README_windows.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
Bitcoin 0.3.23 BETA
|
||||
|
||||
Copyright (c) 2009-2011 Bitcoin Developers
|
||||
Distributed under the MIT/X11 software license, see the accompanying
|
||||
file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
This product includes software developed by the OpenSSL Project for use in
|
||||
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com).
|
||||
|
||||
|
||||
Intro
|
||||
-----
|
||||
Bitcoin is a free open source peer-to-peer electronic cash system that is
|
||||
completely decentralized, without the need for a central server or trusted
|
||||
parties. Users hold the crypto keys to their own money and transact directly
|
||||
with each other, with the help of a P2P network to check for double-spending.
|
||||
|
||||
|
||||
Setup
|
||||
-----
|
||||
Unpack the files into a directory and run bitcoin.exe.
|
||||
|
||||
If you have Microsoft Security Essentials, you need to add bitcoin.exe to its
|
||||
"Excluded processes" list. Microsoft Security Essentials->Settings tab,
|
||||
select Excluded processes, press Add, select bitcoin.exe, OK, Save changes.
|
||||
|
||||
The software automatically finds other nodes to connect to. You can
|
||||
enable Universal Plug and Play using a menu entry or set your firewall
|
||||
to forward port 8333 (TCP) to your computer so you can receive
|
||||
incoming connections. Bitcoin work without incoming connections,
|
||||
but allowing incoming connections helps the Bitcoin network.
|
||||
|
||||
See the bitcoin wiki at: https://en.bitcoin.it/wiki/Main_Page
|
||||
for more help and information.
|
||||
@@ -3,7 +3,8 @@ Distributed under the MIT/X11 software license, see the accompanying
|
||||
file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
This product includes software developed by the OpenSSL Project for use in
|
||||
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com).
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
|
||||
software written by Thomas Bernard.
|
||||
|
||||
|
||||
WINDOWS BUILD NOTES
|
||||
@@ -25,23 +26,26 @@ Dependencies
|
||||
------------
|
||||
Libraries you need to download separately and build:
|
||||
|
||||
default path download
|
||||
wxWidgets \wxwidgets-2.9.1-mgw http://www.wxwidgets.org/downloads/
|
||||
OpenSSL \openssl-1.0.0c-mgw http://www.openssl.org/source/
|
||||
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/
|
||||
default path download
|
||||
wxWidgets \wxwidgets-2.9.1-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/
|
||||
|
||||
Their licenses:
|
||||
wxWidgets LGPL 2.1 with very liberal exceptions
|
||||
OpenSSL Old BSD license with the problematic advertising requirement
|
||||
Berkeley DB New BSD license with additional requirement that linked software must be free open source
|
||||
Boost MIT-like license
|
||||
miniupnpc New (3-clause) BSD license
|
||||
|
||||
Versions used in this release:
|
||||
wxWidgets 2.9.1
|
||||
OpenSSL 1.0.0c
|
||||
OpenSSL 1.0.0d
|
||||
Berkeley DB 4.7.25.NC
|
||||
Boost 1.43.0
|
||||
miniupnpc 1.5-20110215
|
||||
|
||||
|
||||
Notes
|
||||
@@ -62,15 +66,10 @@ MSYS shell:
|
||||
un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377)
|
||||
change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe'
|
||||
|
||||
cd /c/openssl-1.0.0c-mgw
|
||||
cd /c/openssl-1.0.0d-mgw
|
||||
./config
|
||||
make
|
||||
|
||||
perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
|
||||
dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
|
||||
|
||||
after that openssl libeay is in main source dir (openssl-1.0.0c-mgw)
|
||||
|
||||
Berkeley DB
|
||||
-----------
|
||||
MSYS shell:
|
||||
@@ -90,10 +89,19 @@ 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
|
||||
|
||||
Bitcoin
|
||||
-------
|
||||
DOS prompt:
|
||||
cd \bitcoin
|
||||
cd \bitcoin\src
|
||||
mingw32-make bitcoin.exe bitcoind.exe -f makefile.mingw
|
||||
strip bitcoin.exe
|
||||
strip bitcoind.exe
|
||||
@@ -3,7 +3,8 @@ Distributed under the MIT/X11 software license, see the accompanying
|
||||
file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
This product includes software developed by the OpenSSL Project for use in
|
||||
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com).
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
|
||||
software written by Thomas Bernard.
|
||||
|
||||
|
||||
Mac OS X build instructions
|
||||
@@ -58,7 +59,10 @@ cd ~/bitcoin/deps
|
||||
tar xvjf ~/Downloads/boost_1_42_0.tar.bz2
|
||||
cd boost_1_42_0
|
||||
./bootstrap.sh
|
||||
./bjam architecture=combined address-model=32_64 macosx-version=10.6 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
|
||||
./bjam architecture=combined address-model=32_64 macosx-version=10.5 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
|
||||
|
||||
If you're using Snow Leopard, you will need to specify 10.6 as your Mac OS X
|
||||
version instead of 10.5.
|
||||
|
||||
This part takes a while.. use your judgement and fix it if something doesn't
|
||||
build for some reason.
|
||||
@@ -89,12 +93,12 @@ tar xvf ~/Downloads/openssl-1.0.0.tar
|
||||
mv openssl-1.0.0 openssl-1.0.0-x86_64
|
||||
# build i386 (32 bit intel) binary
|
||||
cd openssl-1.0.0-i386
|
||||
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin-i386-cc && make
|
||||
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin-i386-cc && make
|
||||
make install # only do this on one of the architectures, to install the headers
|
||||
cd ..
|
||||
# build x86_64 (64 bit intel) binary
|
||||
cd openssl-1.0.0-x86_64
|
||||
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin64-x86_64-cc && make
|
||||
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin64-x86_64-cc && make
|
||||
cd ..
|
||||
|
||||
# combine the libs
|
||||
@@ -108,11 +112,51 @@ file lib/libcrypto.a
|
||||
|
||||
output should look like this:
|
||||
|
||||
ib/libcrypto.a: Mach-O universal binary with 2 architectures
|
||||
lib/libcrypto.a: Mach-O universal binary with 2 architectures
|
||||
lib/libcrypto.a (for architecture i386): current ar archive random library
|
||||
lib/libcrypto.a (for architecture x86_64): current ar archive random library
|
||||
|
||||
|
||||
miniupnpc
|
||||
---------
|
||||
|
||||
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
|
||||
# build x86_64 (64 bit intel) binary
|
||||
cd miniupnpc-1.5-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
|
||||
export CFLAGS="-arch i386"
|
||||
export LDFLAGS="-arch i386"
|
||||
export PREFIX="/Users/macuser/bitcoin/deps"
|
||||
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
|
||||
|
||||
Verify your binaries
|
||||
|
||||
file lib/libminiupnpc.a
|
||||
|
||||
output should look like this:
|
||||
|
||||
lib/libminiupnpc.a: Mach-O universal binary with 2 architectures
|
||||
lib/libminiupnpc.a (for architecture i386): current ar archive random library
|
||||
lib/libminiupnpc.a (for architecture x86_64): current ar archive random library
|
||||
|
||||
|
||||
Berkeley DB
|
||||
-----------
|
||||
|
||||
@@ -3,7 +3,8 @@ Distributed under the MIT/X11 software license, see the accompanying
|
||||
file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
This product includes software developed by the OpenSSL Project for use in
|
||||
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com).
|
||||
cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
|
||||
software written by Thomas Bernard.
|
||||
|
||||
|
||||
UNIX BUILD NOTES
|
||||
@@ -12,6 +13,8 @@ UNIX BUILD NOTES
|
||||
To Build
|
||||
--------
|
||||
|
||||
cd src/
|
||||
|
||||
make -f makefile.unix # Bitcoin with wxWidgets GUI
|
||||
or
|
||||
make -f makefile.unix bitcoind # Headless bitcoin
|
||||
@@ -29,17 +32,25 @@ 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.
|
||||
|
||||
We're using wxWidgets 2.9.0, which uses UTF-8. Don't try 2.8, it won't work.
|
||||
The build hasn't been updated to work with wxWidgets 2.9.1 yet.
|
||||
Requires wxWidgets 2.9.0 or greater, which uses UTF-8. Don't try 2.8, it
|
||||
won't work.
|
||||
|
||||
You need to download wxWidgets from http://www.wxwidgets.org/downloads/
|
||||
and build it yourself. See the build instructions and configure parameters
|
||||
below.
|
||||
|
||||
Requires miniupnpc for UPnP port mapping. It can be downloaded from
|
||||
http://miniupnp.tuxfamily.org/files/. UPnP support is compiled in and
|
||||
turned off by default. Set USE_UPNP to a different value to control this:
|
||||
USE_UPNP= no UPnP support, miniupnp not required;
|
||||
USE_UPNP=0 (the default) UPnP support turned off by default at runtime;
|
||||
USE_UPNP=1 UPnP support turned on by default at runtime.
|
||||
|
||||
Licenses of statically linked libraries:
|
||||
wxWidgets LGPL 2.1 with very liberal exceptions
|
||||
Berkeley DB New BSD license with additional requirement that linked software must be free open source
|
||||
Boost MIT-like license
|
||||
miniupnpc New (3-clause) BSD license
|
||||
|
||||
Versions used in this release:
|
||||
GCC 4.3.3
|
||||
@@ -47,6 +58,7 @@ OpenSSL 0.9.8g
|
||||
wxWidgets 2.9.0
|
||||
Berkeley DB 4.7.25.NC
|
||||
Boost 1.37
|
||||
miniupnpc 1.5
|
||||
|
||||
|
||||
Notes
|
||||
@@ -66,13 +78,22 @@ tar -xzvf wxWidgets-2.9.0.tar.gz
|
||||
cd wxWidgets-2.9.0
|
||||
mkdir buildgtk
|
||||
cd buildgtk
|
||||
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
|
||||
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg
|
||||
make
|
||||
sudo su
|
||||
make install
|
||||
ldconfig
|
||||
|
||||
|
||||
miniupnpc
|
||||
---------
|
||||
tar -xzvf miniupnpc-1.5.tar.gz
|
||||
cd miniupnpc-1.5
|
||||
make
|
||||
sudo su
|
||||
make install
|
||||
|
||||
|
||||
Berkeley DB
|
||||
-----------
|
||||
You need Berkeley DB 4.7. Don't use 4.8, the database/log0000* files
|
||||
29
doc/release-process.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
* tag version in git
|
||||
|
||||
$ git tag -a v0.3.23
|
||||
|
||||
* write release notes. git shortlog helps a lot:
|
||||
|
||||
$ git shortlog --no-merges v0.3.22..
|
||||
|
||||
* create source-only archive
|
||||
|
||||
$ git archive --format=tar --prefix=bitcoin-0.3.23/ HEAD | \
|
||||
gzip -9c > ~/tmp/bitcoin-0.3.23-src.tar.gz
|
||||
|
||||
* perform gitian builds
|
||||
|
||||
{ insert useful info here }
|
||||
|
||||
* upload source and builds to SF
|
||||
|
||||
* update bitcoin.org version
|
||||
|
||||
* update forum version
|
||||
|
||||
* update wiki
|
||||
|
||||
* update wiki download links
|
||||
|
||||
|
||||
BIN
locale/cs/LC_MESSAGES/bitcoin.mo
Normal file
975
locale/cs/LC_MESSAGES/bitcoin.po
Normal file
@@ -0,0 +1,975 @@
|
||||
# This file is distributed under the same license as the Bitcoin package.
|
||||
# xHire <xhire@mujmalysvet.cz>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-05-26 21:44+0200\n"
|
||||
"PO-Revision-Date: 2011-05-26 22:31+0100\n"
|
||||
"Last-Translator: xHire <xhire@mujmalysvet.cz>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-SearchPath-0: ../../..\n"
|
||||
|
||||
#: ../../../src/net.cpp:1503
|
||||
#, 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/ui.cpp:204
|
||||
#, c-format
|
||||
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
|
||||
msgstr "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
|
||||
msgid "Status"
|
||||
msgstr "Stav"
|
||||
|
||||
#: ../../../src/ui.cpp:304
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#: ../../../src/ui.cpp:305
|
||||
msgid "Description"
|
||||
msgstr "Popis"
|
||||
|
||||
#: ../../../src/ui.cpp:306
|
||||
msgid "Debit"
|
||||
msgstr "Výdaje"
|
||||
|
||||
#: ../../../src/ui.cpp:307
|
||||
msgid "Credit"
|
||||
msgstr "Příjmy"
|
||||
|
||||
#: ../../../src/ui.cpp:513
|
||||
#, c-format
|
||||
msgid "Open for %d blocks"
|
||||
msgstr "Otevřeno pro %d bloků"
|
||||
|
||||
#: ../../../src/ui.cpp:515
|
||||
#, c-format
|
||||
msgid "Open until %s"
|
||||
msgstr "Otřevřeno dokud %s"
|
||||
|
||||
#: ../../../src/ui.cpp:521
|
||||
#, c-format
|
||||
msgid "%d/offline?"
|
||||
msgstr "%d/offline?"
|
||||
|
||||
#: ../../../src/ui.cpp:523
|
||||
#, c-format
|
||||
msgid "%d/unconfirmed"
|
||||
msgstr "%d/nepotvrzeno"
|
||||
|
||||
#: ../../../src/ui.cpp:525
|
||||
#, c-format
|
||||
msgid "%d confirmations"
|
||||
msgstr "%d potvrzení"
|
||||
|
||||
#: ../../../src/ui.cpp:610
|
||||
msgid "Generated"
|
||||
msgstr "Vygenerováno"
|
||||
|
||||
#: ../../../src/ui.cpp:618
|
||||
#, c-format
|
||||
msgid "Generated (%s matures in %d more blocks)"
|
||||
msgstr "Vygenerováno (%s dozraje po %d blocích)"
|
||||
|
||||
#: ../../../src/ui.cpp:622
|
||||
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
|
||||
msgid "Generated (not accepted)"
|
||||
msgstr "Vygenerováno (neakceptováno)"
|
||||
|
||||
#: ../../../src/ui.cpp:636
|
||||
msgid "From: "
|
||||
msgstr "Od: "
|
||||
|
||||
#: ../../../src/ui.cpp:660
|
||||
msgid "Received with: "
|
||||
msgstr "Přijato adresou: "
|
||||
|
||||
#: ../../../src/ui.cpp:706
|
||||
msgid "Payment to yourself"
|
||||
msgstr "Platba pro sebe sama"
|
||||
|
||||
#: ../../../src/ui.cpp:740
|
||||
msgid "To: "
|
||||
msgstr "Pro: "
|
||||
|
||||
#: ../../../src/ui.cpp:1055
|
||||
msgid " Generating"
|
||||
msgstr " Generuji"
|
||||
|
||||
#: ../../../src/ui.cpp:1057
|
||||
msgid "(not connected)"
|
||||
msgstr "(nepřipojen)"
|
||||
|
||||
#: ../../../src/ui.cpp:1060
|
||||
#, c-format
|
||||
msgid " %d connections %d blocks %d transactions"
|
||||
msgstr " %d spojení %d bloků %d transakcí"
|
||||
|
||||
#: ../../../src/ui.cpp:1165
|
||||
#: ../../../src/ui.cpp:2529
|
||||
msgid "New Receiving Address"
|
||||
msgstr "Nová Bitcoinová adresa"
|
||||
|
||||
#: ../../../src/ui.cpp:1166
|
||||
#: ../../../src/ui.cpp:2530
|
||||
msgid ""
|
||||
"You should use a new address for each payment you receive.\n"
|
||||
"\n"
|
||||
"Label"
|
||||
msgstr ""
|
||||
"Měl bys vždy použít novou adresu pro každou platbu, kterou přijímáš.\n"
|
||||
"\n"
|
||||
"Označení"
|
||||
|
||||
#: ../../../src/ui.cpp:1235
|
||||
msgid "<b>Status:</b> "
|
||||
msgstr "<b>Stav:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1240
|
||||
msgid ", has not been successfully broadcast yet"
|
||||
msgstr ", ještě nebylo rozesláno"
|
||||
|
||||
#: ../../../src/ui.cpp:1242
|
||||
#, c-format
|
||||
msgid ", broadcast through %d node"
|
||||
msgstr ", rozesláno přes %d uzel"
|
||||
|
||||
#: ../../../src/ui.cpp:1244
|
||||
#, c-format
|
||||
msgid ", broadcast through %d nodes"
|
||||
msgstr ", rozesláno přes %d uzlů"
|
||||
|
||||
#: ../../../src/ui.cpp:1248
|
||||
msgid "<b>Date:</b> "
|
||||
msgstr "<b>Datum:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1256
|
||||
msgid "<b>Source:</b> Generated<br>"
|
||||
msgstr "<b>Zdroj:</b> Vygenerováno<br>"
|
||||
|
||||
#: ../../../src/ui.cpp:1262
|
||||
#: ../../../src/ui.cpp:1280
|
||||
msgid "<b>From:</b> "
|
||||
msgstr "<b>Od:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1280
|
||||
msgid "unknown"
|
||||
msgstr "neznámo"
|
||||
|
||||
#: ../../../src/ui.cpp:1281
|
||||
#: ../../../src/ui.cpp:1305
|
||||
#: ../../../src/ui.cpp:1364
|
||||
msgid "<b>To:</b> "
|
||||
msgstr "<b>Pro:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1284
|
||||
msgid " (yours, label: "
|
||||
msgstr " (tvoje, označení: "
|
||||
|
||||
#: ../../../src/ui.cpp:1286
|
||||
msgid " (yours)"
|
||||
msgstr " (tvoje)"
|
||||
|
||||
#: ../../../src/ui.cpp:1323
|
||||
#: ../../../src/ui.cpp:1335
|
||||
#: ../../../src/ui.cpp:1381
|
||||
#: ../../../src/ui.cpp:1398
|
||||
msgid "<b>Credit:</b> "
|
||||
msgstr "<b>Příjem:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1325
|
||||
#, c-format
|
||||
msgid "(%s matures in %d more blocks)"
|
||||
msgstr "(%s dozraje po %d blocích)"
|
||||
|
||||
#: ../../../src/ui.cpp:1327
|
||||
msgid "(not accepted)"
|
||||
msgstr "(neakceptováno)"
|
||||
|
||||
#: ../../../src/ui.cpp:1372
|
||||
#: ../../../src/ui.cpp:1380
|
||||
#: ../../../src/ui.cpp:1395
|
||||
msgid "<b>Debit:</b> "
|
||||
msgstr "<b>Výdaj:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1386
|
||||
msgid "<b>Transaction fee:</b> "
|
||||
msgstr "<b>Transakční poplatek:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1402
|
||||
msgid "<b>Net amount:</b> "
|
||||
msgstr "<b>Čistá částka:</b> "
|
||||
|
||||
#: ../../../src/ui.cpp:1409
|
||||
msgid "Message:"
|
||||
msgstr "Zpráva:"
|
||||
|
||||
#: ../../../src/ui.cpp:1411
|
||||
msgid "Comment:"
|
||||
msgstr "Komentář:"
|
||||
|
||||
#: ../../../src/ui.cpp:1414
|
||||
msgid "Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
|
||||
msgstr "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
|
||||
msgid "Cannot write autostart/bitcoin.desktop file"
|
||||
msgstr "Nemohu zapisovat do souboru autostart/bitcoin.desktop"
|
||||
|
||||
#: ../../../src/ui.cpp:1630
|
||||
msgid "Main"
|
||||
msgstr "Hlavní"
|
||||
|
||||
#: ../../../src/ui.cpp:1638
|
||||
msgid "&Start Bitcoin on window system startup"
|
||||
msgstr "&Spustit Bitcoin při startu okenního systému"
|
||||
|
||||
#: ../../../src/ui.cpp:1645
|
||||
msgid "&Minimize on close"
|
||||
msgstr "&Zavřením pouze skrýt"
|
||||
|
||||
#: ../../../src/ui.cpp:1787
|
||||
#, c-format
|
||||
msgid "version %s"
|
||||
msgstr "verze %s"
|
||||
|
||||
#: ../../../src/ui.cpp:1899
|
||||
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
|
||||
msgid "Amount exceeds your balance "
|
||||
msgstr "Částka překračuje stav účtu"
|
||||
|
||||
#: ../../../src/ui.cpp:1909
|
||||
msgid "Total exceeds your balance when the "
|
||||
msgstr "Celková částka přesahuje stav tvého účtu, když "
|
||||
|
||||
#: ../../../src/ui.cpp:1909
|
||||
msgid " transaction fee is included "
|
||||
msgstr " transakční poplatek je zahrnut"
|
||||
|
||||
#: ../../../src/ui.cpp:1927
|
||||
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
|
||||
msgid "Invalid address "
|
||||
msgstr "Neplatná adresa"
|
||||
|
||||
#: ../../../src/ui.cpp:1997
|
||||
#, c-format
|
||||
msgid "Sending %s to %s"
|
||||
msgstr "Posílám %s %s"
|
||||
|
||||
#: ../../../src/ui.cpp:2070
|
||||
#: ../../../src/ui.cpp:2103
|
||||
msgid "CANCELLED"
|
||||
msgstr "ZRUŠENO"
|
||||
|
||||
#: ../../../src/ui.cpp:2074
|
||||
msgid "Cancelled"
|
||||
msgstr "Zrušeno"
|
||||
|
||||
#: ../../../src/ui.cpp:2076
|
||||
msgid "Transfer cancelled "
|
||||
msgstr "Převod zrušen"
|
||||
|
||||
#: ../../../src/ui.cpp:2129
|
||||
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
|
||||
msgid "Connecting..."
|
||||
msgstr "Připojuji..."
|
||||
|
||||
#: ../../../src/ui.cpp:2153
|
||||
msgid "Unable to connect"
|
||||
msgstr "Nemohu se připojit"
|
||||
|
||||
#: ../../../src/ui.cpp:2158
|
||||
msgid "Requesting public key..."
|
||||
msgstr "Požaduji veřejný klíč..."
|
||||
|
||||
#: ../../../src/ui.cpp:2170
|
||||
msgid "Received public key..."
|
||||
msgstr "Přijat veřejný klíč..."
|
||||
|
||||
#: ../../../src/ui.cpp:2184
|
||||
msgid "Recipient is not accepting transactions sent by IP address"
|
||||
msgstr "Příjemce neakceptuje transakce poslané IP adresou"
|
||||
|
||||
#: ../../../src/ui.cpp:2186
|
||||
msgid "Transfer was not accepted"
|
||||
msgstr "Převod nebyl akceptován"
|
||||
|
||||
#: ../../../src/ui.cpp:2195
|
||||
msgid "Invalid response received"
|
||||
msgstr "Přišla neplatná odpověď"
|
||||
|
||||
#: ../../../src/ui.cpp:2210
|
||||
msgid "Creating transaction..."
|
||||
msgstr "Vytvářím transakci..."
|
||||
|
||||
#: ../../../src/ui.cpp:2222
|
||||
#, c-format
|
||||
msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
|
||||
msgstr "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
|
||||
msgid "Transaction creation failed"
|
||||
msgstr "Vytvoření transakce selhalo"
|
||||
|
||||
#: ../../../src/ui.cpp:2231
|
||||
msgid "Transaction aborted"
|
||||
msgstr "Transakce zrušena"
|
||||
|
||||
#: ../../../src/ui.cpp:2239
|
||||
msgid "Lost connection, transaction cancelled"
|
||||
msgstr "Spojení se ztratilo, takže transakce byla zrušena"
|
||||
|
||||
#: ../../../src/ui.cpp:2255
|
||||
msgid "Sending payment..."
|
||||
msgstr "Posílám platbu..."
|
||||
|
||||
#: ../../../src/ui.cpp:2261
|
||||
msgid "The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
|
||||
msgstr "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
|
||||
msgid "Waiting for confirmation..."
|
||||
msgstr "Čekám na potvrzení..."
|
||||
|
||||
#: ../../../src/ui.cpp:2288
|
||||
msgid ""
|
||||
"The payment was sent, but the recipient was unable to verify it.\n"
|
||||
"The transaction is recorded and will credit to the recipient,\n"
|
||||
"but the comment information will be blank."
|
||||
msgstr ""
|
||||
"Platba byla poslána, ale příjemce není schopen ji ověřit.\n"
|
||||
"Transakce je zaznamenána a bude připsána příjemci,\n"
|
||||
"ale poznámka u platby bude prázdná."
|
||||
|
||||
#: ../../../src/ui.cpp:2297
|
||||
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
|
||||
msgid "Payment completed"
|
||||
msgstr "Platba je kompletní"
|
||||
|
||||
#: ../../../src/ui.cpp:2334
|
||||
#: ../../../src/ui.cpp:2480
|
||||
#: ../../../src/ui.cpp:2517
|
||||
msgid "Name"
|
||||
msgstr "Jméno"
|
||||
|
||||
#: ../../../src/ui.cpp:2335
|
||||
#: ../../../src/ui.cpp:2480
|
||||
#: ../../../src/ui.cpp:2517
|
||||
msgid "Address"
|
||||
msgstr "Adresa"
|
||||
|
||||
#: ../../../src/ui.cpp:2337
|
||||
#: ../../../src/ui.cpp:2492
|
||||
msgid "Label"
|
||||
msgstr "Označení"
|
||||
|
||||
#: ../../../src/ui.cpp:2338
|
||||
#: ../../../src/uibase.cpp:837
|
||||
msgid "Bitcoin Address"
|
||||
msgstr "Bitcoinová adresa"
|
||||
|
||||
#: ../../../src/ui.cpp:2462
|
||||
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
|
||||
msgid "Edit Address"
|
||||
msgstr "Upravit adresu"
|
||||
|
||||
#: ../../../src/ui.cpp:2492
|
||||
msgid "Edit Address Label"
|
||||
msgstr "Upravit označení adresy"
|
||||
|
||||
#: ../../../src/ui.cpp:2517
|
||||
#: ../../../src/ui.cpp:2523
|
||||
msgid "Add Address"
|
||||
msgstr "Přidat adresu"
|
||||
|
||||
#: ../../../src/ui.cpp:2600
|
||||
msgid "Bitcoin"
|
||||
msgstr "Bitcoin"
|
||||
|
||||
#: ../../../src/ui.cpp:2602
|
||||
msgid "Bitcoin - Generating"
|
||||
msgstr "Bitcoin - Generování"
|
||||
|
||||
#: ../../../src/ui.cpp:2604
|
||||
msgid "Bitcoin - (not connected)"
|
||||
msgstr "Bitcoin - (nepřipojen)"
|
||||
|
||||
#: ../../../src/ui.cpp:2683
|
||||
msgid "&Open Bitcoin"
|
||||
msgstr "&Otevřít Bitcoin"
|
||||
|
||||
#: ../../../src/ui.cpp:2684
|
||||
msgid "&Send Bitcoins"
|
||||
msgstr "&Poslat Bitcoiny"
|
||||
|
||||
#: ../../../src/ui.cpp:2685
|
||||
msgid "O&ptions..."
|
||||
msgstr "&Možnosti..."
|
||||
|
||||
#: ../../../src/ui.cpp:2688
|
||||
#: ../../../src/uibase.cpp:25
|
||||
msgid "E&xit"
|
||||
msgstr "&Konec"
|
||||
|
||||
#: ../../../src/ui.cpp:2904
|
||||
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:140
|
||||
msgid " beta"
|
||||
msgstr " beta"
|
||||
|
||||
#: ../../../src/init.cpp:142
|
||||
msgid "Bitcoin version"
|
||||
msgstr "Bitcoin verze"
|
||||
|
||||
#: ../../../src/init.cpp:143
|
||||
msgid "Usage:"
|
||||
msgstr "Užití:"
|
||||
|
||||
#: ../../../src/init.cpp:145
|
||||
msgid "Send command to -server or bitcoind\n"
|
||||
msgstr "Poslat příkaz pro -server nebo bitcoind\n"
|
||||
|
||||
#: ../../../src/init.cpp:146
|
||||
msgid "List commands\n"
|
||||
msgstr "Výpis příkazů\n"
|
||||
|
||||
#: ../../../src/init.cpp:147
|
||||
msgid "Get help for a command\n"
|
||||
msgstr "Získat nápovědu pro příkaz\n"
|
||||
|
||||
#: ../../../src/init.cpp:148
|
||||
msgid "Options:\n"
|
||||
msgstr "Možnosti:\n"
|
||||
|
||||
#: ../../../src/init.cpp:149
|
||||
msgid "Specify configuration file (default: bitcoin.conf)\n"
|
||||
msgstr "Konfigurační soubor (výchozí: bitcoin.conf)\n"
|
||||
|
||||
#: ../../../src/init.cpp:150
|
||||
msgid "Specify pid file (default: bitcoind.pid)\n"
|
||||
msgstr "PID soubor (výchozí: bitcoind.pid)\n"
|
||||
|
||||
#: ../../../src/init.cpp:151
|
||||
msgid "Generate coins\n"
|
||||
msgstr "Generovat mince\n"
|
||||
|
||||
#: ../../../src/init.cpp:152
|
||||
msgid "Don't generate coins\n"
|
||||
msgstr "Negenerovat mince\n"
|
||||
|
||||
#: ../../../src/init.cpp:153
|
||||
msgid "Start minimized\n"
|
||||
msgstr "Startovat minimalizovaně\n"
|
||||
|
||||
#: ../../../src/init.cpp:154
|
||||
msgid "Specify data directory\n"
|
||||
msgstr "Adresář pro data\n"
|
||||
|
||||
#: ../../../src/init.cpp:155
|
||||
msgid "Connect through socks4 proxy\n"
|
||||
msgstr "Připojovat se skrz socks4 proxy\n"
|
||||
|
||||
#: ../../../src/init.cpp:156
|
||||
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
|
||||
msgid "Add a node to connect to\n"
|
||||
msgstr "Přidat uzel, ke kterému se připojit\n"
|
||||
|
||||
#: ../../../src/init.cpp:158
|
||||
msgid "Connect only to the specified node\n"
|
||||
msgstr "Připojovat se pouze k udanému uzlu\n"
|
||||
|
||||
#: ../../../src/init.cpp:159
|
||||
msgid "Don't accept connections from outside\n"
|
||||
msgstr "Nepřijímat připojení zvenčí\n"
|
||||
|
||||
#: ../../../src/init.cpp:162
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
msgid "Use the test network\n"
|
||||
msgstr "Použít testovací síť\n"
|
||||
|
||||
#: ../../../src/init.cpp:175
|
||||
msgid "Username for JSON-RPC connections\n"
|
||||
msgstr "Uživatelské jméno pro JSON-RPC spojení\n"
|
||||
|
||||
#: ../../../src/init.cpp:176
|
||||
msgid "Password for JSON-RPC connections\n"
|
||||
msgstr "Heslo pro JSON-RPC spojení\n"
|
||||
|
||||
#: ../../../src/init.cpp:177
|
||||
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
|
||||
msgid "Allow JSON-RPC connections from specified IP address\n"
|
||||
msgstr "Povolit JSON-RPC spojení ze specifikované IP adresy\n"
|
||||
|
||||
#: ../../../src/init.cpp:179
|
||||
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
|
||||
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
|
||||
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
|
||||
msgid ""
|
||||
"\n"
|
||||
"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Možnosti SSL: (viz instrukce nastavení SSL v Bitcoin Wiki)\n"
|
||||
|
||||
#: ../../../src/init.cpp:186
|
||||
msgid "Use OpenSSL (https) for JSON-RPC connections\n"
|
||||
msgstr "Použít OpenSSL (https) pro JSON-RPC spojení\n"
|
||||
|
||||
#: ../../../src/init.cpp:187
|
||||
msgid "Server certificate file (default: server.cert)\n"
|
||||
msgstr "Soubor se serverovým certifikátem (výchozí: server.cert)\n"
|
||||
|
||||
#: ../../../src/init.cpp:188
|
||||
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
|
||||
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
|
||||
msgid "This help message\n"
|
||||
msgstr "Tato nápověda\n"
|
||||
|
||||
#: ../../../src/init.cpp:330
|
||||
#, 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
|
||||
msgid "Error loading addr.dat \n"
|
||||
msgstr "Chyba při načítání addr.dat \n"
|
||||
|
||||
#: ../../../src/init.cpp:362
|
||||
msgid "Error loading blkindex.dat \n"
|
||||
msgstr "Chyba při načítání blkindex.dat \n"
|
||||
|
||||
#: ../../../src/init.cpp:369
|
||||
msgid "Error loading wallet.dat \n"
|
||||
msgstr "Chyba při načítání wallet.dat \n"
|
||||
|
||||
#: ../../../src/init.cpp:449
|
||||
msgid "Invalid -proxy address"
|
||||
msgstr "Neplatná -proxy adresa"
|
||||
|
||||
#: ../../../src/init.cpp:472
|
||||
msgid "Invalid amount for -paytxfee=<amount>"
|
||||
msgstr "Neplatná částka pro -paytxfee=<částka>"
|
||||
|
||||
#: ../../../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 "Varování: -paytxfee je nastaveno velmi vysoko. Toto je transakční poplatek, který zaplatíš za každou poslanou transakci."
|
||||
|
||||
#: ../../../src/uibase.h:147
|
||||
msgid "Transaction Details"
|
||||
msgstr "Detaily transakce"
|
||||
|
||||
#: ../../../src/uibase.h:199
|
||||
msgid "Options"
|
||||
msgstr "Možnosti"
|
||||
|
||||
#: ../../../src/uibase.h:228
|
||||
msgid "About Bitcoin"
|
||||
msgstr "O Bitcoinu"
|
||||
|
||||
#: ../../../src/uibase.h:337
|
||||
msgid "Your Bitcoin Addresses"
|
||||
msgstr "Tvá Bitcoinová adresa"
|
||||
|
||||
BIN
locale/eo/LC_MESSAGES/bitcoin.mo
Normal file
1081
locale/eo/LC_MESSAGES/bitcoin.po
Normal file
@@ -559,11 +559,6 @@ msgstr "&Ouvrir Bitcoin"
|
||||
msgid "O&ptions..."
|
||||
msgstr "O&ptions..."
|
||||
|
||||
#: ../../../ui.cpp:2521
|
||||
#: ../../../uibase.cpp:32
|
||||
msgid "&Generate Coins"
|
||||
msgstr "&Générer des pièces"
|
||||
|
||||
#: ../../../ui.cpp:2524
|
||||
#: ../../../uibase.cpp:25
|
||||
msgid "E&xit"
|
||||
@@ -739,7 +734,7 @@ msgid ""
|
||||
"\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)."
|
||||
"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
|
||||
msgstr ""
|
||||
"Copyright (c) 2009-2010 Bitcoin Developers\n"
|
||||
"\n"
|
||||
@@ -750,7 +745,7 @@ msgstr ""
|
||||
"\n"
|
||||
"Ce produit comprend des composants logiciels développés pour le Projet OpenSSL \n"
|
||||
"OpenSSL Toolkit (http://www.openssl.org/) ainsi que des composants cryptographiques \n"
|
||||
"écrits par Eric Young (eay@cryptsoft.com)."
|
||||
"écrits par Eric Young (eay@cryptsoft.com) et des logiciels UPnP écrits par Thomas Bernard.."
|
||||
|
||||
#: ../../../uibase.cpp:613
|
||||
msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
|
||||
|
||||
BIN
locale/lt/LC_MESSAGES/bitcoin.mo
Normal file
1027
locale/lt/LC_MESSAGES/bitcoin.po
Normal file
@@ -527,11 +527,6 @@ msgstr "&Abrir Bitcoin"
|
||||
msgid "O&ptions..."
|
||||
msgstr "O&pções"
|
||||
|
||||
#: ../../../ui.cpp:2502
|
||||
#: ../../../uibase.cpp:34
|
||||
msgid "&Generate Coins"
|
||||
msgstr "&Gerar Moedas"
|
||||
|
||||
#: ../../../ui.cpp:2505
|
||||
#: ../../../uibase.cpp:27
|
||||
msgid "E&xit"
|
||||
@@ -705,7 +700,7 @@ msgid ""
|
||||
"\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)."
|
||||
"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
|
||||
msgstr ""
|
||||
"Copyright (c) 2009-2010 Bitcoin Developers\n"
|
||||
"\n"
|
||||
@@ -716,7 +711,8 @@ msgstr ""
|
||||
"http://www.opensource.org/licenses/mit-license.php.\n"
|
||||
"Este producto inclui software desenvolvido pelo projecto OpenSSL, para \n"
|
||||
"ser utilizado no OpenSSL Toolkit (http://www.openssl.org) e software de \n"
|
||||
"criptografia desenvolvido por Eric Young (eay@cryptsoft.com)."
|
||||
"criptografia desenvolvido por Eric Young (eay@cryptsoft.com)\n"
|
||||
"e UPnP software escrito por Thomas Bernard."
|
||||
|
||||
#: ../../../uibase.cpp:619
|
||||
msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
|
||||
|
||||
978
locale/sv/LC_MESSAGES/bitcoin.po
Normal file
@@ -0,0 +1,978 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-06-11 00:11+0100\n"
|
||||
"PO-Revision-Date: 2011-06-11 02:09+0100\n"
|
||||
"Last-Translator: Codler <github>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-SearchPath-0: ../../..\n"
|
||||
|
||||
#: ../../../init.cpp:140
|
||||
msgid " beta"
|
||||
msgstr " beta"
|
||||
|
||||
#: ../../../init.cpp:142
|
||||
msgid "Bitcoin version"
|
||||
msgstr "Bitcoin version"
|
||||
|
||||
#: ../../../init.cpp:143
|
||||
msgid "Usage:"
|
||||
msgstr "Användning:"
|
||||
|
||||
#: ../../../init.cpp:145
|
||||
msgid "Send command to -server or bitcoind\n"
|
||||
msgstr "Skicka kommando till -server eller bitcoind\n"
|
||||
|
||||
#: ../../../init.cpp:146
|
||||
msgid "List commands\n"
|
||||
msgstr "Lista kommandon\n"
|
||||
|
||||
#: ../../../init.cpp:147
|
||||
msgid "Get help for a command\n"
|
||||
msgstr "Få hjälp från en kommando\n"
|
||||
|
||||
#: ../../../init.cpp:148
|
||||
msgid "Options:\n"
|
||||
msgstr "Val:\n"
|
||||
|
||||
#: ../../../init.cpp:149
|
||||
msgid "Specify configuration file (default: bitcoin.conf)\n"
|
||||
msgstr "Specify configuration file (default: bitcoin.conf)\n"
|
||||
|
||||
#: ../../../init.cpp:150
|
||||
msgid "Specify pid file (default: bitcoind.pid)\n"
|
||||
msgstr "Specificera pid-fil (standard: bitcoind.pid)\n"
|
||||
|
||||
#: ../../../init.cpp:151
|
||||
msgid "Generate coins\n"
|
||||
msgstr "Generera mynt\n"
|
||||
|
||||
#: ../../../init.cpp:152
|
||||
msgid "Don't generate coins\n"
|
||||
msgstr "Genetera inte mynt\n"
|
||||
|
||||
#: ../../../init.cpp:153
|
||||
msgid "Start minimized\n"
|
||||
msgstr "Starta minimerad\n"
|
||||
|
||||
#: ../../../init.cpp:154
|
||||
msgid "Specify data directory\n"
|
||||
msgstr "Specificera data mappen\n"
|
||||
|
||||
#: ../../../init.cpp:155
|
||||
msgid "Connect through socks4 proxy\n"
|
||||
msgstr "Ansluter via socks4 proxy\n"
|
||||
|
||||
#: ../../../init.cpp:156
|
||||
msgid "Allow DNS lookups for addnode and connect\n"
|
||||
msgstr "Tillåt DNS uppslagningar för addnode och connect\n"
|
||||
|
||||
#: ../../../init.cpp:157
|
||||
msgid "Add a node to connect to\n"
|
||||
msgstr "Lägg till en nod att ansluta till\n"
|
||||
|
||||
#: ../../../init.cpp:158
|
||||
msgid "Connect only to the specified node\n"
|
||||
msgstr "Anslut endast till specifik nod\n"
|
||||
|
||||
#: ../../../init.cpp:159
|
||||
msgid "Don't accept connections from outside\n"
|
||||
msgstr "Acceptera inte anslutningar från utsidan\n"
|
||||
|
||||
#: ../../../init.cpp:162
|
||||
msgid "Don't attempt to use UPnP to map the listening port\n"
|
||||
msgstr "Försök inte att använda UPnP för att mappa avslyssningsporten\n"
|
||||
|
||||
#: ../../../init.cpp:164
|
||||
msgid "Attempt to use UPnP to map the listening port\n"
|
||||
msgstr "Försöker att använda UPnP för att mappa avlyssningsporten\n"
|
||||
|
||||
#: ../../../init.cpp:167
|
||||
msgid "Fee per KB to add to transactions you send\n"
|
||||
msgstr "Avgift per KB att lägga till transaktionen du sänder\n"
|
||||
|
||||
#: ../../../init.cpp:169
|
||||
msgid "Accept command line and JSON-RPC commands\n"
|
||||
msgstr "Accepterar kommandoraden och JSON-RPC kommando\n"
|
||||
|
||||
#: ../../../init.cpp:172
|
||||
msgid "Run in the background as a daemon and accept commands\n"
|
||||
msgstr "Kör daemon i bakgrunden och acceptera kommando\n"
|
||||
|
||||
#: ../../../init.cpp:174
|
||||
msgid "Use the test network\n"
|
||||
msgstr "Använd test nätverk\n"
|
||||
|
||||
#: ../../../init.cpp:175
|
||||
msgid "Username for JSON-RPC connections\n"
|
||||
msgstr "Användarnamn till JSON-RPC anslutning\n"
|
||||
|
||||
#: ../../../init.cpp:176
|
||||
msgid "Password for JSON-RPC connections\n"
|
||||
msgstr "Lösenord till JSON-RPC anslutning\n"
|
||||
|
||||
#: ../../../init.cpp:177
|
||||
msgid "Listen for JSON-RPC connections on <port> (default: 8332)\n"
|
||||
msgstr "Lyssnar på JSON-RPC anslutningar på <port> (standard: 8332)\n"
|
||||
|
||||
#: ../../../init.cpp:178
|
||||
msgid "Allow JSON-RPC connections from specified IP address\n"
|
||||
msgstr "Tillåt JSON-RPC anslutningar från specifik IP-adress\n"
|
||||
|
||||
#: ../../../init.cpp:179
|
||||
msgid "Send commands to node running on <ip> (default: 127.0.0.1)\n"
|
||||
msgstr "Skicka kommando till noden som körs på <ip> (standard: 127.0.0.1)\n"
|
||||
|
||||
#: ../../../init.cpp:180
|
||||
msgid "Set key pool size to <n> (default: 100)\n"
|
||||
msgstr "Sätt nyckel pool storlek till <n> (standard: 100)\n"
|
||||
|
||||
#: ../../../init.cpp:181
|
||||
msgid "Rescan the block chain for missing wallet transactions\n"
|
||||
msgstr "Scanna om block kedja efter saknade plånbokstransaktioner\n"
|
||||
|
||||
#: ../../../init.cpp:185
|
||||
msgid ""
|
||||
"\n"
|
||||
"SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"SSL val: (Se Bitcoin Wiki för SSL inställningsinstruktioner)\n"
|
||||
|
||||
#: ../../../init.cpp:186
|
||||
msgid "Use OpenSSL (https) for JSON-RPC connections\n"
|
||||
msgstr "Använd OpenSSL (https) för JSON-RPC anslutningar\n"
|
||||
|
||||
#: ../../../init.cpp:187
|
||||
msgid "Server certificate file (default: server.cert)\n"
|
||||
msgstr "Server certifikatfil (standard: server.cert)\n"
|
||||
|
||||
#: ../../../init.cpp:188
|
||||
msgid "Server private key (default: server.pem)\n"
|
||||
msgstr "Server privat nyckel (standard: server.pem)\n"
|
||||
|
||||
#: ../../../init.cpp:189
|
||||
msgid "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
|
||||
msgstr "Acceptabel kryptering (standard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n"
|
||||
|
||||
#: ../../../init.cpp:193
|
||||
msgid "This help message\n"
|
||||
msgstr "Denna hjälp meddelande\n"
|
||||
|
||||
#: ../../../init.cpp:330
|
||||
#, c-format
|
||||
msgid "Cannot obtain a lock on data directory %s. Bitcoin is probably already running."
|
||||
msgstr "Kan inte sätta lås på data mappen %s. Bitcoin körs troligen redan."
|
||||
|
||||
#: ../../../init.cpp:356
|
||||
msgid "Error loading addr.dat \n"
|
||||
msgstr "Fel vid laddning av addr.dat \n"
|
||||
|
||||
#: ../../../init.cpp:362
|
||||
msgid "Error loading blkindex.dat \n"
|
||||
msgstr "Fel vid laddning av blkindex.dat \n"
|
||||
|
||||
#: ../../../init.cpp:369
|
||||
msgid "Error loading wallet.dat \n"
|
||||
msgstr "Fel vid laddning av wallet.dat \n"
|
||||
|
||||
#: ../../../init.cpp:449
|
||||
msgid "Invalid -proxy address"
|
||||
msgstr "Ogiltig -proxy adress"
|
||||
|
||||
#: ../../../init.cpp:472
|
||||
msgid "Invalid amount for -paytxfee=<amount>"
|
||||
msgstr "Ogiltig belopp på -paytxfee=<belopp>"
|
||||
|
||||
#: ../../../init.cpp:476
|
||||
msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
|
||||
msgstr "Varning: -paytxfee är satt väldigt högt. Denna är transaktionsavgiften som du kommer att betala om du skickar en transaktion."
|
||||
|
||||
#: ../../../main.cpp:1866
|
||||
msgid "Warning: Disk space is low "
|
||||
msgstr "Varning: Diskutrymme är låg "
|
||||
|
||||
#: ../../../main.cpp:3999
|
||||
#, c-format
|
||||
msgid "Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "
|
||||
msgstr "Fel: Denna transaktion kräver en transaktionsavgift minst %s för dess belopp, komplexitet, eller användning av nyligen mottagna pengar "
|
||||
|
||||
#: ../../../main.cpp:4001
|
||||
msgid "Error: Transaction creation failed "
|
||||
msgstr "Fel: Misslyckades att skapa transaktion "
|
||||
|
||||
#: ../../../main.cpp:4006
|
||||
#: ../../../ui.cpp:1951
|
||||
#: ../../../ui.cpp:1956
|
||||
#: ../../../ui.cpp:2102
|
||||
#: ../../../ui.cpp:2255
|
||||
msgid "Sending..."
|
||||
msgstr "Skickar..."
|
||||
|
||||
#: ../../../main.cpp:4010
|
||||
msgid "Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
|
||||
msgstr "Fel: Transaktionen blev nekad. Detta kan hända om några av dina mynt i din plånbok var redan spenderad. Till exempel om du använde en kopia av wallet.dat och mynten var redan spenderad i kopian, men som inte var markerad som spenderad här."
|
||||
|
||||
#: ../../../main.cpp:4023
|
||||
msgid "Invalid amount"
|
||||
msgstr "Ogiltig belopp"
|
||||
|
||||
#: ../../../main.cpp:4025
|
||||
#: ../../../ui.cpp:2169
|
||||
#: ../../../ui.cpp:2240
|
||||
msgid "Insufficient funds"
|
||||
msgstr "Otillräckligt med pengar"
|
||||
|
||||
#: ../../../main.cpp:4030
|
||||
msgid "Invalid bitcoin address"
|
||||
msgstr "Ogiltig bitcoin adress"
|
||||
|
||||
#: ../../../net.cpp:1505
|
||||
#, c-format
|
||||
msgid "Unable to bind to port %d on this computer. Bitcoin is probably already running."
|
||||
msgstr "Det gick inte att binda till port %d på denna dator. Bitcoin körs troligen redan."
|
||||
|
||||
#: ../../../rpc.cpp:1816
|
||||
#: ../../../rpc.cpp:1818
|
||||
#, c-format
|
||||
msgid "To use the %s option"
|
||||
msgstr "För att använda %s val"
|
||||
|
||||
#: ../../../rpc.cpp:1820
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: %s, you must set rpcpassword=<password>\n"
|
||||
"in the configuration file: %s\n"
|
||||
"If the file does not exist, create it with owner-readable-only file permissions.\n"
|
||||
msgstr ""
|
||||
"Varning: %s, du måste sätta rpcpassword=<lösenord>\n"
|
||||
"i konfigurationsfilen: %s\n"
|
||||
"Om filen inte existerar, skapa med ägare med filbehörigheten -readable-only.\n"
|
||||
|
||||
#: ../../../rpc.cpp:1988
|
||||
#, c-format
|
||||
msgid ""
|
||||
"You must set rpcpassword=<password> in the configuration file:\n"
|
||||
"%s\n"
|
||||
"If the file does not exist, create it with owner-readable-only file permissions."
|
||||
msgstr ""
|
||||
"Du måste sätta rpcpassword=<lösenord> i konfigurationsfilen:\n"
|
||||
"%s\n"
|
||||
"Om filen inte existerar, skapa med ägare med filbehörighete -readable-only."
|
||||
|
||||
#: ../../../ui.cpp:211
|
||||
#, c-format
|
||||
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
|
||||
msgstr "Denna transaktion är över storleksbegränsningen. Du kan fortfarande skicka mot en avgift på %s, som går till noderna som bearbetar din transaktion och hjälper att stödja nätverket. Vill du fortfarande betala avgiften?"
|
||||
|
||||
#: ../../../ui.cpp:311
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#: ../../../ui.cpp:312
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#: ../../../ui.cpp:313
|
||||
msgid "Description"
|
||||
msgstr "Beskrivning"
|
||||
|
||||
#: ../../../ui.cpp:314
|
||||
msgid "Debit"
|
||||
msgstr "Debitera"
|
||||
|
||||
#: ../../../ui.cpp:315
|
||||
msgid "Credit"
|
||||
msgstr "Kreditera"
|
||||
|
||||
#: ../../../ui.cpp:521
|
||||
#, c-format
|
||||
msgid "Open for %d blocks"
|
||||
msgstr "Öppna för %d blocks"
|
||||
|
||||
#: ../../../ui.cpp:523
|
||||
#, c-format
|
||||
msgid "Open until %s"
|
||||
msgstr "Öppen tills %s"
|
||||
|
||||
#: ../../../ui.cpp:529
|
||||
#, c-format
|
||||
msgid "%d/offline?"
|
||||
msgstr "%d/offline?"
|
||||
|
||||
#: ../../../ui.cpp:531
|
||||
#, c-format
|
||||
msgid "%d/unconfirmed"
|
||||
msgstr "%d/obekräftade"
|
||||
|
||||
#: ../../../ui.cpp:533
|
||||
#, c-format
|
||||
msgid "%d confirmations"
|
||||
msgstr "%d bekräftelser"
|
||||
|
||||
#: ../../../ui.cpp:618
|
||||
msgid "Generated"
|
||||
msgstr "Genererad"
|
||||
|
||||
#: ../../../ui.cpp:626
|
||||
#, fuzzy, c-format
|
||||
msgid "Generated (%s matures in %d more blocks)"
|
||||
msgstr "Genererad (%s mogna i %d fler block)"
|
||||
|
||||
#: ../../../ui.cpp:630
|
||||
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
|
||||
msgstr "Genererad - Varning: Denna block har inte blivit mottagen av någon annan nod och kommer troligtvis inte bli accepterad"
|
||||
|
||||
#: ../../../ui.cpp:634
|
||||
msgid "Generated (not accepted)"
|
||||
msgstr "Genererad (ej accepterad)"
|
||||
|
||||
#: ../../../ui.cpp:644
|
||||
msgid "From: "
|
||||
msgstr "Från: "
|
||||
|
||||
#: ../../../ui.cpp:668
|
||||
msgid "Received with: "
|
||||
msgstr "Mottagen med: "
|
||||
|
||||
#: ../../../ui.cpp:714
|
||||
msgid "Payment to yourself"
|
||||
msgstr "Betalning till dig själv"
|
||||
|
||||
#: ../../../ui.cpp:748
|
||||
msgid "To: "
|
||||
msgstr "Till: "
|
||||
|
||||
#: ../../../ui.cpp:1063
|
||||
msgid " Generating"
|
||||
msgstr " Generering"
|
||||
|
||||
#: ../../../ui.cpp:1065
|
||||
msgid "(not connected)"
|
||||
msgstr "(inte ansluten)"
|
||||
|
||||
#: ../../../ui.cpp:1068
|
||||
#, c-format
|
||||
msgid " %d connections %d blocks %d transactions"
|
||||
msgstr " %d anslutningar %d block %d transaktioner"
|
||||
|
||||
#: ../../../ui.cpp:1173
|
||||
#: ../../../ui.cpp:2566
|
||||
msgid "New Receiving Address"
|
||||
msgstr "Ny Mottagningsadress"
|
||||
|
||||
#: ../../../ui.cpp:1174
|
||||
#: ../../../ui.cpp:2567
|
||||
msgid ""
|
||||
"You should use a new address for each payment you receive.\n"
|
||||
"\n"
|
||||
"Label"
|
||||
msgstr ""
|
||||
"Du borde använda en ny adress för varje betalning som du mottar.\n"
|
||||
"\n"
|
||||
"Etikett"
|
||||
|
||||
#: ../../../ui.cpp:1246
|
||||
msgid "<b>Status:</b> "
|
||||
msgstr "<b>Status:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1251
|
||||
msgid ", has not been successfully broadcast yet"
|
||||
msgstr ", has not been successfully broadcast yet"
|
||||
|
||||
#: ../../../ui.cpp:1253
|
||||
#, c-format
|
||||
msgid ", broadcast through %d node"
|
||||
msgstr ", broadcast genom %d nod"
|
||||
|
||||
#: ../../../ui.cpp:1255
|
||||
#, c-format
|
||||
msgid ", broadcast through %d nodes"
|
||||
msgstr ", broadcast genom %d noder"
|
||||
|
||||
#: ../../../ui.cpp:1259
|
||||
msgid "<b>Date:</b> "
|
||||
msgstr "<b>Datum:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1267
|
||||
msgid "<b>Source:</b> Generated<br>"
|
||||
msgstr "<b>Källa:</b> Genererad<br>"
|
||||
|
||||
#: ../../../ui.cpp:1273
|
||||
#: ../../../ui.cpp:1291
|
||||
msgid "<b>From:</b> "
|
||||
msgstr "<b>Från:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1291
|
||||
msgid "unknown"
|
||||
msgstr "okänd"
|
||||
|
||||
#: ../../../ui.cpp:1292
|
||||
#: ../../../ui.cpp:1316
|
||||
#: ../../../ui.cpp:1375
|
||||
msgid "<b>To:</b> "
|
||||
msgstr "<b>Till:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1295
|
||||
msgid " (yours, label: "
|
||||
msgstr " (din, etikett: "
|
||||
|
||||
#: ../../../ui.cpp:1297
|
||||
msgid " (yours)"
|
||||
msgstr " (ditt)"
|
||||
|
||||
#: ../../../ui.cpp:1334
|
||||
#: ../../../ui.cpp:1346
|
||||
#: ../../../ui.cpp:1392
|
||||
#: ../../../ui.cpp:1409
|
||||
msgid "<b>Credit:</b> "
|
||||
msgstr "<b>Kredit:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1336
|
||||
#, fuzzy, c-format
|
||||
msgid "(%s matures in %d more blocks)"
|
||||
msgstr "(%s matures in %d more blocks)"
|
||||
|
||||
#: ../../../ui.cpp:1338
|
||||
msgid "(not accepted)"
|
||||
msgstr "(ej accepterad)"
|
||||
|
||||
#: ../../../ui.cpp:1383
|
||||
#: ../../../ui.cpp:1391
|
||||
#: ../../../ui.cpp:1406
|
||||
msgid "<b>Debit:</b> "
|
||||
msgstr "<b>Debit:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1397
|
||||
msgid "<b>Transaction fee:</b> "
|
||||
msgstr "<b>Transaktionsavgift:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1413
|
||||
#, fuzzy
|
||||
msgid "<b>Net amount:</b> "
|
||||
msgstr "<b>Nät belopp:</b> "
|
||||
|
||||
#: ../../../ui.cpp:1420
|
||||
msgid "Message:"
|
||||
msgstr "Meddelande:"
|
||||
|
||||
#: ../../../ui.cpp:1422
|
||||
msgid "Comment:"
|
||||
msgstr "Kommentar:"
|
||||
|
||||
#: ../../../ui.cpp:1425
|
||||
msgid "Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
|
||||
msgstr "Genererad mynt måste vänta 120 block innan dem kan användas.När du genererat denna block, skickades en broadcast till nätet och lades till block kedjan. Om den misslyckas att lägga till kedjan så kommer det ändras till \"not accepted\" och är icke brukbar. Detta kan hända om en annan nod genererat en block några sekunder efter din."
|
||||
|
||||
#: ../../../ui.cpp:1605
|
||||
msgid "Cannot write autostart/bitcoin.desktop file"
|
||||
msgstr "Kan inte skriva autostart/bitcoin.desktop fil"
|
||||
|
||||
#: ../../../ui.cpp:1641
|
||||
msgid "Main"
|
||||
msgstr "Huvud"
|
||||
|
||||
#: ../../../ui.cpp:1651
|
||||
msgid "&Start Bitcoin on window system startup"
|
||||
msgstr "&Starta Bitcoin vid uppstart i windows"
|
||||
|
||||
#: ../../../ui.cpp:1658
|
||||
msgid "&Minimize on close"
|
||||
msgstr "&Minimera vid stängning"
|
||||
|
||||
#: ../../../ui.cpp:1800
|
||||
#, c-format
|
||||
msgid "version %s"
|
||||
msgstr "version %s"
|
||||
|
||||
#: ../../../ui.cpp:1923
|
||||
msgid "Error in amount "
|
||||
msgstr "Fel i belopp "
|
||||
|
||||
#: ../../../ui.cpp:1923
|
||||
#: ../../../ui.cpp:1928
|
||||
#: ../../../ui.cpp:1933
|
||||
#: ../../../ui.cpp:1968
|
||||
#: ../../../uibase.cpp:55
|
||||
msgid "Send Coins"
|
||||
msgstr "Skicka mynt"
|
||||
|
||||
#: ../../../ui.cpp:1928
|
||||
msgid "Amount exceeds your balance "
|
||||
msgstr "Belopp överskrider din balans "
|
||||
|
||||
#: ../../../ui.cpp:1933
|
||||
msgid "Total exceeds your balance when the "
|
||||
msgstr "Totals överskrider din balans när "
|
||||
|
||||
#: ../../../ui.cpp:1933
|
||||
msgid " transaction fee is included "
|
||||
msgstr " transaktionsavgift är inkluderad "
|
||||
|
||||
#: ../../../ui.cpp:1951
|
||||
msgid "Payment sent "
|
||||
msgstr "Betalning skickad "
|
||||
|
||||
#: ../../../ui.cpp:1968
|
||||
msgid "Invalid address "
|
||||
msgstr "Ogiltig adress "
|
||||
|
||||
#: ../../../ui.cpp:2023
|
||||
#, c-format
|
||||
msgid "Sending %s to %s"
|
||||
msgstr "Skickar %s till %s"
|
||||
|
||||
#: ../../../ui.cpp:2096
|
||||
#: ../../../ui.cpp:2129
|
||||
msgid "CANCELLED"
|
||||
msgstr "AVBRUTEN"
|
||||
|
||||
#: ../../../ui.cpp:2100
|
||||
msgid "Cancelled"
|
||||
msgstr "Avbruten"
|
||||
|
||||
#: ../../../ui.cpp:2102
|
||||
msgid "Transfer cancelled "
|
||||
msgstr "Överföring avbruten "
|
||||
|
||||
#: ../../../ui.cpp:2155
|
||||
msgid "Error: "
|
||||
msgstr "Fel: "
|
||||
|
||||
#: ../../../ui.cpp:2174
|
||||
msgid "Connecting..."
|
||||
msgstr "Ansluter..."
|
||||
|
||||
#: ../../../ui.cpp:2179
|
||||
msgid "Unable to connect"
|
||||
msgstr "Det gick inte att ansluta"
|
||||
|
||||
#: ../../../ui.cpp:2184
|
||||
msgid "Requesting public key..."
|
||||
msgstr "Efterfrågar publik nyckel..."
|
||||
|
||||
#: ../../../ui.cpp:2196
|
||||
msgid "Received public key..."
|
||||
msgstr "Mottagen publik nyckel..."
|
||||
|
||||
#: ../../../ui.cpp:2210
|
||||
msgid "Recipient is not accepting transactions sent by IP address"
|
||||
msgstr "Mottagaren accepterar inte transaktioner skickat från IP adress"
|
||||
|
||||
#: ../../../ui.cpp:2212
|
||||
msgid "Transfer was not accepted"
|
||||
msgstr "Överföringen var inte accepterad"
|
||||
|
||||
#: ../../../ui.cpp:2221
|
||||
msgid "Invalid response received"
|
||||
msgstr "Ogiltig respons mottagen"
|
||||
|
||||
#: ../../../ui.cpp:2236
|
||||
msgid "Creating transaction..."
|
||||
msgstr "Skapar transation..."
|
||||
|
||||
#: ../../../ui.cpp:2248
|
||||
#, c-format
|
||||
msgid "This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"
|
||||
msgstr "Denna transaktion kräver en transaktionsavgift minst %s för dess belopp, komplexitet, eller användning av nyligen mottagna pengar"
|
||||
|
||||
#: ../../../ui.cpp:2250
|
||||
msgid "Transaction creation failed"
|
||||
msgstr "Misslyckades skapa transaktion"
|
||||
|
||||
#: ../../../ui.cpp:2257
|
||||
msgid "Transaction aborted"
|
||||
msgstr "Transaktion avbruten"
|
||||
|
||||
#: ../../../ui.cpp:2265
|
||||
msgid "Lost connection, transaction cancelled"
|
||||
msgstr "Förlorad anslutning, transaktionen avbruten"
|
||||
|
||||
#: ../../../ui.cpp:2281
|
||||
msgid "Sending payment..."
|
||||
msgstr "Skickar betalning..."
|
||||
|
||||
#: ../../../ui.cpp:2287
|
||||
msgid "The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
|
||||
msgstr "Transaktionen blev nekad. Detta kan hända om några av dina mynt i din plånbok var redan spenderad. Till exempel om du använde en kopia av wallet.dat och mynten var redan spenderad i kopian, men som inte var markerad som spenderad här."
|
||||
|
||||
#: ../../../ui.cpp:2296
|
||||
msgid "Waiting for confirmation..."
|
||||
msgstr "Väntar på bekräftelse..."
|
||||
|
||||
#: ../../../ui.cpp:2314
|
||||
msgid ""
|
||||
"The payment was sent, but the recipient was unable to verify it.\n"
|
||||
"The transaction is recorded and will credit to the recipient,\n"
|
||||
"but the comment information will be blank."
|
||||
msgstr ""
|
||||
"Betalning var skickat, men mottagaren kunde inte verifiera det.\n"
|
||||
"Transaktionen är registrerad och kommer att kreditera mottagaren,\n"
|
||||
"men kommentar informationen kommer att vara tom."
|
||||
|
||||
#: ../../../ui.cpp:2323
|
||||
msgid "Payment was sent, but an invalid response was received"
|
||||
msgstr "Betalning var skickad, men en ogiltig respons var mottagen"
|
||||
|
||||
#: ../../../ui.cpp:2329
|
||||
msgid "Payment completed"
|
||||
msgstr "Betalning slutförd"
|
||||
|
||||
#: ../../../ui.cpp:2371
|
||||
#: ../../../ui.cpp:2517
|
||||
#: ../../../ui.cpp:2554
|
||||
msgid "Name"
|
||||
msgstr "Namn"
|
||||
|
||||
#: ../../../ui.cpp:2372
|
||||
#: ../../../ui.cpp:2517
|
||||
#: ../../../ui.cpp:2554
|
||||
msgid "Address"
|
||||
msgstr "Adress"
|
||||
|
||||
#: ../../../ui.cpp:2374
|
||||
#: ../../../ui.cpp:2529
|
||||
msgid "Label"
|
||||
msgstr "Etikett"
|
||||
|
||||
#: ../../../ui.cpp:2375
|
||||
#: ../../../uibase.cpp:837
|
||||
msgid "Bitcoin Address"
|
||||
msgstr "Bitcoin Adress"
|
||||
|
||||
#: ../../../ui.cpp:2499
|
||||
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
|
||||
msgstr "Denna är en av dina egna adresser för mottagning av betalningar och kan inte slås in i adressboken. "
|
||||
|
||||
#: ../../../ui.cpp:2517
|
||||
#: ../../../ui.cpp:2523
|
||||
msgid "Edit Address"
|
||||
msgstr "Ändra Adress"
|
||||
|
||||
#: ../../../ui.cpp:2529
|
||||
msgid "Edit Address Label"
|
||||
msgstr "Ändra Address Etikett"
|
||||
|
||||
#: ../../../ui.cpp:2554
|
||||
#: ../../../ui.cpp:2560
|
||||
msgid "Add Address"
|
||||
msgstr "Lägg till Adress"
|
||||
|
||||
#: ../../../ui.cpp:2637
|
||||
msgid "Bitcoin"
|
||||
msgstr "Bitcoin"
|
||||
|
||||
#: ../../../ui.cpp:2639
|
||||
msgid "Bitcoin - Generating"
|
||||
msgstr "Bitcoin - Genererar"
|
||||
|
||||
#: ../../../ui.cpp:2641
|
||||
msgid "Bitcoin - (not connected)"
|
||||
msgstr "Bitcoin - (ej ansluten)"
|
||||
|
||||
#: ../../../ui.cpp:2720
|
||||
msgid "&Open Bitcoin"
|
||||
msgstr "&Öppna Bitcoin"
|
||||
|
||||
#: ../../../ui.cpp:2721
|
||||
msgid "&Send Bitcoins"
|
||||
msgstr "&Skicka Bitcoins"
|
||||
|
||||
#: ../../../ui.cpp:2722
|
||||
#, fuzzy
|
||||
msgid "O&ptions..."
|
||||
msgstr "O&ptions..."
|
||||
|
||||
#: ../../../ui.cpp:2725
|
||||
#: ../../../uibase.cpp:25
|
||||
#, fuzzy
|
||||
msgid "E&xit"
|
||||
msgstr "E&xit"
|
||||
|
||||
#: ../../../ui.cpp:2951
|
||||
msgid "Program has crashed and will terminate. "
|
||||
msgstr "Programmet har krachat och kommer att avslutas. "
|
||||
|
||||
#: ../../../uibase.cpp:28
|
||||
msgid "&File"
|
||||
msgstr "&Fil"
|
||||
|
||||
#: ../../../uibase.cpp:32
|
||||
msgid "&Your Receiving Addresses..."
|
||||
msgstr "&Din Mottagar adress..."
|
||||
|
||||
#: ../../../uibase.cpp:36
|
||||
msgid "&Options..."
|
||||
msgstr "&Val..."
|
||||
|
||||
#: ../../../uibase.cpp:39
|
||||
msgid "&Settings"
|
||||
msgstr "&Inställning"
|
||||
|
||||
#: ../../../uibase.cpp:43
|
||||
msgid "&About..."
|
||||
msgstr "&Om..."
|
||||
|
||||
#: ../../../uibase.cpp:46
|
||||
msgid "&Help"
|
||||
msgstr "&Hjälp"
|
||||
|
||||
#: ../../../uibase.cpp:56
|
||||
msgid "Address Book"
|
||||
msgstr "Adressbok"
|
||||
|
||||
#: ../../../uibase.cpp:69
|
||||
msgid "Your Bitcoin Address:"
|
||||
msgstr "Din Bitcoin Adress:"
|
||||
|
||||
#: ../../../uibase.cpp:76
|
||||
msgid " &New... "
|
||||
msgstr " &Nytt... "
|
||||
|
||||
#: ../../../uibase.cpp:79
|
||||
#: ../../../uibase.cpp:780
|
||||
#: ../../../uibase.cpp:883
|
||||
msgid " &Copy to Clipboard "
|
||||
msgstr " &Kopiera till Urklipp "
|
||||
|
||||
#: ../../../uibase.cpp:93
|
||||
msgid "Balance:"
|
||||
msgstr "Balans:"
|
||||
|
||||
#: ../../../uibase.cpp:109
|
||||
msgid " All"
|
||||
msgstr " Alla"
|
||||
|
||||
#: ../../../uibase.cpp:109
|
||||
msgid " Sent"
|
||||
msgstr " Skickat"
|
||||
|
||||
#: ../../../uibase.cpp:109
|
||||
msgid " Received"
|
||||
msgstr " Mottagen"
|
||||
|
||||
#: ../../../uibase.cpp:109
|
||||
msgid " In Progress"
|
||||
msgstr " Pågående"
|
||||
|
||||
#: ../../../uibase.cpp:130
|
||||
msgid "All Transactions"
|
||||
msgstr "Alla Transaktioner"
|
||||
|
||||
#: ../../../uibase.cpp:141
|
||||
msgid "Sent/Received"
|
||||
msgstr "Skickat/Mottagen"
|
||||
|
||||
#: ../../../uibase.cpp:152
|
||||
msgid "Sent"
|
||||
msgstr "Skickat"
|
||||
|
||||
#: ../../../uibase.cpp:163
|
||||
msgid "Received"
|
||||
msgstr "Mottagen"
|
||||
|
||||
#: ../../../uibase.cpp:302
|
||||
#: ../../../uibase.cpp:443
|
||||
#: ../../../uibase.cpp:542
|
||||
#: ../../../uibase.cpp:722
|
||||
#: ../../../uibase.cpp:783
|
||||
#: ../../../uibase.cpp:892
|
||||
#: ../../../uibase.cpp:981
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: ../../../uibase.cpp:345
|
||||
msgid "&Start Bitcoin on system startup"
|
||||
msgstr "&Starta Bitcoin vid system uppstart"
|
||||
|
||||
#: ../../../uibase.cpp:348
|
||||
#, fuzzy
|
||||
msgid "&Minimize to the tray instead of the taskbar"
|
||||
msgstr "&Minimerar till tray istället för aktivitetsfält"
|
||||
|
||||
#: ../../../uibase.cpp:351
|
||||
msgid "Map port using &UPnP"
|
||||
msgstr "Mapp port använder &UPnP"
|
||||
|
||||
#: ../../../uibase.cpp:354
|
||||
#, fuzzy
|
||||
msgid "M&inimize to the tray on close"
|
||||
msgstr "M&inimize to the tray on close"
|
||||
|
||||
#: ../../../uibase.cpp:360
|
||||
msgid "&Connect through socks4 proxy: "
|
||||
msgstr "&Anslut via socks4 proxy: "
|
||||
|
||||
#: ../../../uibase.cpp:371
|
||||
msgid "Proxy &IP:"
|
||||
msgstr "Proxy &IP:"
|
||||
|
||||
#: ../../../uibase.cpp:379
|
||||
msgid " &Port:"
|
||||
msgstr " &Port:"
|
||||
|
||||
#: ../../../uibase.cpp:392
|
||||
msgid "Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."
|
||||
msgstr "Frivillig transaktionsavgift per KB som garanterar att din transaktion bearbetas snabbt. Flesta transaktioner är 1KB. Most transactions are 1KB. Avgift 0.01 rekommenderas."
|
||||
|
||||
#: ../../../uibase.cpp:399
|
||||
msgid "Pay transaction fee:"
|
||||
msgstr "Betala transaktionsavgift:"
|
||||
|
||||
#: ../../../uibase.cpp:420
|
||||
msgid "// [don't translate] Test panel 2 for future expansion"
|
||||
msgstr ""
|
||||
|
||||
#: ../../../uibase.cpp:424
|
||||
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
|
||||
msgstr ""
|
||||
|
||||
#: ../../../uibase.cpp:446
|
||||
#: ../../../uibase.cpp:668
|
||||
#: ../../../uibase.cpp:727
|
||||
#: ../../../uibase.cpp:786
|
||||
#: ../../../uibase.cpp:895
|
||||
#: ../../../uibase.cpp:984
|
||||
msgid "Cancel"
|
||||
msgstr "Avbryt"
|
||||
|
||||
#: ../../../uibase.cpp:449
|
||||
msgid "&Apply"
|
||||
msgstr "&Använd"
|
||||
|
||||
#: ../../../uibase.cpp:508
|
||||
msgid "Bitcoin "
|
||||
msgstr "Bitcoin "
|
||||
|
||||
#: ../../../uibase.cpp:514
|
||||
msgid "version"
|
||||
msgstr "version"
|
||||
|
||||
#: ../../../uibase.cpp:525
|
||||
msgid ""
|
||||
"Copyright (c) 2009-2011 Bitcoin Developers\n"
|
||||
"\n"
|
||||
"This is experimental software.\n"
|
||||
"\n"
|
||||
"Distributed under the MIT/X11 software license, see the accompanying file \n"
|
||||
"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
|
||||
"\n"
|
||||
"This product includes software developed by the OpenSSL Project for use in the \n"
|
||||
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
|
||||
"Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard."
|
||||
msgstr ""
|
||||
"Copyright (c) 2009-2011 Bitcoin Developers\n"
|
||||
"\n"
|
||||
"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."
|
||||
|
||||
#: ../../../uibase.cpp:581
|
||||
msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
|
||||
msgstr "Ange en Bitcoin adress (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"
|
||||
|
||||
#: ../../../uibase.cpp:595
|
||||
msgid "Pay &To:"
|
||||
msgstr "Betala &Till:"
|
||||
|
||||
#: ../../../uibase.cpp:610
|
||||
msgid "&Paste"
|
||||
msgstr "&Klistra in"
|
||||
|
||||
#: ../../../uibase.cpp:613
|
||||
#, fuzzy
|
||||
msgid " Address &Book..."
|
||||
msgstr " Adress &Bok..."
|
||||
|
||||
#: ../../../uibase.cpp:620
|
||||
msgid "&Amount:"
|
||||
msgstr "&Belopp:"
|
||||
|
||||
#: ../../../uibase.cpp:630
|
||||
#, fuzzy
|
||||
msgid "T&ransfer:"
|
||||
msgstr "T&ransfer:"
|
||||
|
||||
#: ../../../uibase.cpp:636
|
||||
msgid " Standard"
|
||||
msgstr " Standard"
|
||||
|
||||
#: ../../../uibase.cpp:663
|
||||
msgid "&Send"
|
||||
msgstr "&Skicka"
|
||||
|
||||
#: ../../../uibase.cpp:711
|
||||
msgid ""
|
||||
"\n"
|
||||
"\n"
|
||||
"Connecting..."
|
||||
msgstr ""
|
||||
"\n"
|
||||
"\n"
|
||||
"Ansluter..."
|
||||
|
||||
#: ../../../uibase.cpp:761
|
||||
msgid "These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you. The highlighted address is displayed in the main window."
|
||||
msgstr "Dessa är dina Bitcoin adresser för mottagning av betalningar. Du rekommenderas att ge olika till varje avsändare så du kan ha koll på vem som betalar dig. Den markerade adressen är visar i huvudfönstret."
|
||||
|
||||
#: ../../../uibase.cpp:774
|
||||
#: ../../../uibase.cpp:886
|
||||
msgid "&Edit..."
|
||||
msgstr "&Redigera..."
|
||||
|
||||
#: ../../../uibase.cpp:777
|
||||
#: ../../../uibase.cpp:889
|
||||
msgid " &New Address... "
|
||||
msgstr " &Ny Adress... "
|
||||
|
||||
#: ../../../uibase.cpp:849
|
||||
msgid "Sending"
|
||||
msgstr "Skickar"
|
||||
|
||||
#: ../../../uibase.cpp:857
|
||||
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
|
||||
msgstr "Dessa är dina Bitcoin adresser för mottagning av betalningar. Du kan ge olika till varje avsändare så du kan ha koll på vem som betalar dig. Den markerade adressen är visar i huvudfönstret."
|
||||
|
||||
#: ../../../uibase.cpp:870
|
||||
msgid "Receiving"
|
||||
msgstr "Mottar"
|
||||
|
||||
#: ../../../uibase.cpp:880
|
||||
msgid "&Delete"
|
||||
msgstr "&Ta bort"
|
||||
|
||||
#: ../../../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 "Varning: Var god och kolla att din dator har rätt datum och klockslag. Om din klocka är fel så kommer Bitcoin inte att fungera."
|
||||
|
||||
#: ../../../util.cpp:899
|
||||
msgid "-beta"
|
||||
msgstr "-beta"
|
||||
|
||||
#: ../../../uibase.h:147
|
||||
msgid "Transaction Details"
|
||||
msgstr "Transaktion detaljer"
|
||||
|
||||
#: ../../../uibase.h:199
|
||||
msgid "Options"
|
||||
msgstr "Val"
|
||||
|
||||
#: ../../../uibase.h:228
|
||||
msgid "About Bitcoin"
|
||||
msgstr "Om Bitcoin"
|
||||
|
||||
#: ../../../uibase.h:337
|
||||
msgid "Your Bitcoin Addresses"
|
||||
msgstr "Dina Bitcoin Adresser"
|
||||
|
||||
BIN
locale/zh_cn/LC_MESSAGES/bitcoin.mo
Normal file
1017
locale/zh_cn/LC_MESSAGES/bitcoin.po
Normal file
475
sha256.cpp
@@ -1,475 +0,0 @@
|
||||
// Copyright (c) 2010 Nils Schneider
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
// 4-way 128-bit SSE2 SHA-256
|
||||
|
||||
#ifdef FOURWAYSSE2
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <xmmintrin.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define NPAR 32
|
||||
|
||||
extern void DoubleBlockSHA256(const void* pin, void* pout, const void* pinit, unsigned int hash[8][NPAR], const void* init2);
|
||||
|
||||
static const unsigned int sha256_consts[] = {
|
||||
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, /* 0 */
|
||||
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, /* 8 */
|
||||
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
||||
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, /* 16 */
|
||||
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
||||
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, /* 24 */
|
||||
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
||||
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, /* 32 */
|
||||
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
||||
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, /* 40 */
|
||||
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
||||
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, /* 48 */
|
||||
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
||||
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, /* 56 */
|
||||
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
||||
};
|
||||
|
||||
|
||||
static inline __m128i Ch(const __m128i b, const __m128i c, const __m128i d) {
|
||||
return (b & c) ^ (~b & d);
|
||||
}
|
||||
|
||||
static inline __m128i Maj(const __m128i b, const __m128i c, const __m128i d) {
|
||||
return (b & c) ^ (b & d) ^ (c & d);
|
||||
}
|
||||
|
||||
static inline __m128i ROTR(__m128i x, const int n) {
|
||||
return _mm_srli_epi32(x, n) | _mm_slli_epi32(x, 32 - n);
|
||||
}
|
||||
|
||||
static inline __m128i SHR(__m128i x, const int n) {
|
||||
return _mm_srli_epi32(x, n);
|
||||
}
|
||||
|
||||
/* SHA256 Functions */
|
||||
#define BIGSIGMA0_256(x) (ROTR((x), 2) ^ ROTR((x), 13) ^ ROTR((x), 22))
|
||||
#define BIGSIGMA1_256(x) (ROTR((x), 6) ^ ROTR((x), 11) ^ ROTR((x), 25))
|
||||
#define SIGMA0_256(x) (ROTR((x), 7) ^ ROTR((x), 18) ^ SHR((x), 3))
|
||||
#define SIGMA1_256(x) (ROTR((x), 17) ^ ROTR((x), 19) ^ SHR((x), 10))
|
||||
|
||||
static inline unsigned int store32(const __m128i x, int i) {
|
||||
union { unsigned int ret[4]; __m128i x; } box;
|
||||
box.x = x;
|
||||
return box.ret[i];
|
||||
}
|
||||
|
||||
static inline void store_epi32(const __m128i x, unsigned int *x0, unsigned int *x1, unsigned int *x2, unsigned int *x3) {
|
||||
union { unsigned int ret[4]; __m128i x; } box;
|
||||
box.x = x;
|
||||
*x0 = box.ret[3]; *x1 = box.ret[2]; *x2 = box.ret[1]; *x3 = box.ret[0];
|
||||
}
|
||||
|
||||
#define add4(x0, x1, x2, x3) _mm_add_epi32(_mm_add_epi32(_mm_add_epi32(x0, x1), x2), x3)
|
||||
#define add5(x0, x1, x2, x3, x4) _mm_add_epi32(add4(x0, x1, x2, x3), x4)
|
||||
|
||||
#define SHA256ROUND(a, b, c, d, e, f, g, h, i, w) \
|
||||
T1 = add5(h, BIGSIGMA1_256(e), Ch(e, f, g), _mm_set1_epi32(sha256_consts[i]), w); \
|
||||
d = _mm_add_epi32(d, T1); \
|
||||
h = _mm_add_epi32(T1, _mm_add_epi32(BIGSIGMA0_256(a), Maj(a, b, c)));
|
||||
|
||||
static inline void dumpreg(__m128i x, char *msg) {
|
||||
union { unsigned int ret[4]; __m128i x; } box;
|
||||
box.x = x ;
|
||||
printf("%s %08x %08x %08x %08x\n", msg, box.ret[0], box.ret[1], box.ret[2], box.ret[3]);
|
||||
}
|
||||
|
||||
#if 1
|
||||
#define dumpstate(i) printf("%s: %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", \
|
||||
__func__, store32(w0, i), store32(a, i), store32(b, i), store32(c, i), store32(d, i), store32(e, i), store32(f, i), store32(g, i), store32(h, i));
|
||||
#else
|
||||
#define dumpstate()
|
||||
#endif
|
||||
|
||||
// Align by increasing pointer, must have extra space at end of buffer
|
||||
template <size_t nBytes, typename T>
|
||||
T* alignup(T* p)
|
||||
{
|
||||
union
|
||||
{
|
||||
T* ptr;
|
||||
size_t n;
|
||||
} u;
|
||||
u.ptr = p;
|
||||
u.n = (u.n + (nBytes-1)) & ~(nBytes-1);
|
||||
return u.ptr;
|
||||
}
|
||||
|
||||
static const unsigned int pSHA256InitState[8] =
|
||||
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
|
||||
|
||||
|
||||
unsigned int ScanHash_4WaySSE2(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
|
||||
{
|
||||
unsigned int& nNonce = *(unsigned int*)(pdata + 12);
|
||||
for (;;)
|
||||
{
|
||||
nNonce += NPAR;
|
||||
unsigned int thashbuf[9][NPAR];
|
||||
unsigned int (&thash)[9][NPAR] = *alignup<16>(&thashbuf);
|
||||
DoubleBlockSHA256(pdata, phash1, pmidstate, thash, pSHA256InitState);
|
||||
|
||||
for (int j = 0; j < NPAR; j++)
|
||||
{
|
||||
if (thash[7][j] == 0)
|
||||
{
|
||||
for (int i = 0; i < 32/4; i++)
|
||||
((unsigned int*)phash)[i] = thash[i][j];
|
||||
return nNonce + j;
|
||||
}
|
||||
}
|
||||
|
||||
if ((nNonce & 0xffff) == 0)
|
||||
{
|
||||
nHashesDone = 0xffff+1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DoubleBlockSHA256(const void* pin, void* pad, const void *pre, unsigned int thash[9][NPAR], const void *init)
|
||||
{
|
||||
unsigned int* In = (unsigned int*)pin;
|
||||
unsigned int* Pad = (unsigned int*)pad;
|
||||
unsigned int* hPre = (unsigned int*)pre;
|
||||
unsigned int* hInit = (unsigned int*)init;
|
||||
unsigned int i, j, k;
|
||||
|
||||
/* vectors used in calculation */
|
||||
__m128i w0, w1, w2, w3, w4, w5, w6, w7;
|
||||
__m128i w8, w9, w10, w11, w12, w13, w14, w15;
|
||||
__m128i T1;
|
||||
__m128i a, b, c, d, e, f, g, h;
|
||||
__m128i nonce;
|
||||
|
||||
/* nonce offset for vector */
|
||||
__m128i offset = _mm_set_epi32(0x00000003, 0x00000002, 0x00000001, 0x00000000);
|
||||
|
||||
|
||||
for(k = 0; k<NPAR; k+=4) {
|
||||
w0 = _mm_set1_epi32(In[0]);
|
||||
w1 = _mm_set1_epi32(In[1]);
|
||||
w2 = _mm_set1_epi32(In[2]);
|
||||
//w3 = _mm_set1_epi32(In[3]); nonce will be later hacked into the hash
|
||||
w4 = _mm_set1_epi32(In[4]);
|
||||
w5 = _mm_set1_epi32(In[5]);
|
||||
w6 = _mm_set1_epi32(In[6]);
|
||||
w7 = _mm_set1_epi32(In[7]);
|
||||
w8 = _mm_set1_epi32(In[8]);
|
||||
w9 = _mm_set1_epi32(In[9]);
|
||||
w10 = _mm_set1_epi32(In[10]);
|
||||
w11 = _mm_set1_epi32(In[11]);
|
||||
w12 = _mm_set1_epi32(In[12]);
|
||||
w13 = _mm_set1_epi32(In[13]);
|
||||
w14 = _mm_set1_epi32(In[14]);
|
||||
w15 = _mm_set1_epi32(In[15]);
|
||||
|
||||
/* hack nonce into lowest byte of w3 */
|
||||
nonce = _mm_set1_epi32(In[3]);
|
||||
nonce = _mm_add_epi32(nonce, offset);
|
||||
nonce = _mm_add_epi32(nonce, _mm_set1_epi32(k));
|
||||
w3 = nonce;
|
||||
|
||||
a = _mm_set1_epi32(hPre[0]);
|
||||
b = _mm_set1_epi32(hPre[1]);
|
||||
c = _mm_set1_epi32(hPre[2]);
|
||||
d = _mm_set1_epi32(hPre[3]);
|
||||
e = _mm_set1_epi32(hPre[4]);
|
||||
f = _mm_set1_epi32(hPre[5]);
|
||||
g = _mm_set1_epi32(hPre[6]);
|
||||
h = _mm_set1_epi32(hPre[7]);
|
||||
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
|
||||
|
||||
#define store_load(x, i, dest) \
|
||||
T1 = _mm_set1_epi32((hPre)[i]); \
|
||||
dest = _mm_add_epi32(T1, x);
|
||||
|
||||
store_load(a, 0, w0);
|
||||
store_load(b, 1, w1);
|
||||
store_load(c, 2, w2);
|
||||
store_load(d, 3, w3);
|
||||
store_load(e, 4, w4);
|
||||
store_load(f, 5, w5);
|
||||
store_load(g, 6, w6);
|
||||
store_load(h, 7, w7);
|
||||
|
||||
w8 = _mm_set1_epi32(Pad[8]);
|
||||
w9 = _mm_set1_epi32(Pad[9]);
|
||||
w10 = _mm_set1_epi32(Pad[10]);
|
||||
w11 = _mm_set1_epi32(Pad[11]);
|
||||
w12 = _mm_set1_epi32(Pad[12]);
|
||||
w13 = _mm_set1_epi32(Pad[13]);
|
||||
w14 = _mm_set1_epi32(Pad[14]);
|
||||
w15 = _mm_set1_epi32(Pad[15]);
|
||||
|
||||
a = _mm_set1_epi32(hInit[0]);
|
||||
b = _mm_set1_epi32(hInit[1]);
|
||||
c = _mm_set1_epi32(hInit[2]);
|
||||
d = _mm_set1_epi32(hInit[3]);
|
||||
e = _mm_set1_epi32(hInit[4]);
|
||||
f = _mm_set1_epi32(hInit[5]);
|
||||
g = _mm_set1_epi32(hInit[6]);
|
||||
h = _mm_set1_epi32(hInit[7]);
|
||||
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
|
||||
|
||||
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
|
||||
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
|
||||
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
|
||||
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
|
||||
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
|
||||
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
|
||||
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
|
||||
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
|
||||
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
|
||||
SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
|
||||
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
|
||||
SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
|
||||
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
|
||||
SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
|
||||
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
|
||||
SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
|
||||
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
|
||||
SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
|
||||
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
|
||||
SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
|
||||
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
|
||||
SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
|
||||
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
|
||||
SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
|
||||
|
||||
/* store resulsts directly in thash */
|
||||
#define store_2(x,i) \
|
||||
w0 = _mm_set1_epi32(hInit[i]); \
|
||||
*(__m128i *)&(thash)[i][0+k] = _mm_add_epi32(w0, x);
|
||||
|
||||
store_2(a, 0);
|
||||
store_2(b, 1);
|
||||
store_2(c, 2);
|
||||
store_2(d, 3);
|
||||
store_2(e, 4);
|
||||
store_2(f, 5);
|
||||
store_2(g, 6);
|
||||
store_2(h, 7);
|
||||
*(__m128i *)&(thash)[8][0+k] = nonce;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FOURWAYSSE2
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
@@ -4,12 +4,12 @@ RequestExecutionLevel highest
|
||||
|
||||
# General Symbol Definitions
|
||||
!define REGKEY "SOFTWARE\$(^Name)"
|
||||
!define VERSION 0.3.20
|
||||
!define VERSION 0.3.23
|
||||
!define COMPANY "Bitcoin project"
|
||||
!define URL http://www.bitcoin.org/
|
||||
|
||||
# MUI Symbol Definitions
|
||||
!define MUI_ICON "src\rc\bitcoin.ico"
|
||||
!define MUI_ICON "../share/pixmaps/bitcoin.ico"
|
||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
|
||||
@@ -39,12 +39,12 @@ Var StartMenuGroup
|
||||
!insertmacro MUI_LANGUAGE English
|
||||
|
||||
# Installer attributes
|
||||
OutFile bitcoin-0.3.20-win32-setup.exe
|
||||
OutFile bitcoin-0.3.23-win32-setup.exe
|
||||
InstallDir $PROGRAMFILES\Bitcoin
|
||||
CRCCheck on
|
||||
XPStyle on
|
||||
ShowInstDetails show
|
||||
VIProductVersion 0.3.20.0
|
||||
VIProductVersion 0.3.23.0
|
||||
VIAddVersionKey ProductName Bitcoin
|
||||
VIAddVersionKey ProductVersion "${VERSION}"
|
||||
VIAddVersionKey CompanyName "${COMPANY}"
|
||||
@@ -59,16 +59,15 @@ ShowUninstDetails show
|
||||
Section -Main SEC0000
|
||||
SetOutPath $INSTDIR
|
||||
SetOverwrite on
|
||||
File bitcoin.exe
|
||||
File libeay32.dll
|
||||
File license.txt
|
||||
File readme.txt
|
||||
File ../src/bitcoin.exe
|
||||
File /oname=license.txt ../COPYING
|
||||
File /oname=readme.txt ../doc/README_windows.txt
|
||||
SetOutPath $INSTDIR\daemon
|
||||
File /r daemon\*.*
|
||||
File ../src/bitcoind.exe
|
||||
SetOutPath $INSTDIR\locale
|
||||
File /r locale\*.*
|
||||
File /r ../locale/*.*
|
||||
SetOutPath $INSTDIR\src
|
||||
File /r src\*.*
|
||||
File /r /x *.exe /x *.o ../src\*.*
|
||||
SetOutPath $INSTDIR
|
||||
WriteRegStr HKCU "${REGKEY}\Components" Main 1
|
||||
SectionEnd
|
||||
@@ -108,7 +107,6 @@ done${UNSECTION_ID}:
|
||||
# Uninstaller sections
|
||||
Section /o -un.Main UNSEC0000
|
||||
Delete /REBOOTOK $INSTDIR\bitcoin.exe
|
||||
Delete /REBOOTOK $INSTDIR\libeay32.dll
|
||||
Delete /REBOOTOK $INSTDIR\license.txt
|
||||
Delete /REBOOTOK $INSTDIR\readme.txt
|
||||
RMDir /r /REBOOTOK $INSTDIR\daemon
|
||||
15
share/ui.rc
Normal file
@@ -0,0 +1,15 @@
|
||||
bitcoin ICON "pixmaps/bitcoin.ico"
|
||||
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
check ICON "pixmaps/check.ico"
|
||||
send16 BITMAP "pixmaps/send16.bmp"
|
||||
send16mask BITMAP "pixmaps/send16mask.bmp"
|
||||
send16masknoshadow BITMAP "pixmaps/send16masknoshadow.bmp"
|
||||
send20 BITMAP "pixmaps/send20.bmp"
|
||||
send20mask BITMAP "pixmaps/send20mask.bmp"
|
||||
addressbook16 BITMAP "pixmaps/addressbook16.bmp"
|
||||
addressbook16mask BITMAP "pixmaps/addressbook16mask.bmp"
|
||||
addressbook20 BITMAP "pixmaps/addressbook20.bmp"
|
||||
addressbook20mask BITMAP "pixmaps/addressbook20mask.bmp"
|
||||
favicon ICON "pixmaps/favicon.ico"
|
||||
@@ -11,12 +11,17 @@
|
||||
// - E-mail usually won't line-break if there's no punctuation to break at.
|
||||
// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
|
||||
//
|
||||
#ifndef BITCOIN_BASE58_H
|
||||
#define BITCOIN_BASE58_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "bignum.h"
|
||||
|
||||
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
|
||||
|
||||
inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
|
||||
inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
|
||||
{
|
||||
CAutoBN_CTX pctx;
|
||||
CBigNum bn58 = 58;
|
||||
@@ -24,15 +29,17 @@ inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pen
|
||||
|
||||
// Convert big endian data to little endian
|
||||
// Extra zero at the end make sure bignum will interpret as a positive number
|
||||
vector<unsigned char> vchTmp(pend-pbegin+1, 0);
|
||||
std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
|
||||
reverse_copy(pbegin, pend, vchTmp.begin());
|
||||
|
||||
// Convert little endian data to bignum
|
||||
CBigNum bn;
|
||||
bn.setvch(vchTmp);
|
||||
|
||||
// Convert bignum to string
|
||||
string str;
|
||||
// Convert bignum to std::string
|
||||
std::string str;
|
||||
// Expected size increase from base58 conversion is approximately 137%
|
||||
// use 138% to be safe
|
||||
str.reserve((pend - pbegin) * 138 / 100 + 1);
|
||||
CBigNum dv;
|
||||
CBigNum rem;
|
||||
@@ -49,17 +56,17 @@ inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pen
|
||||
for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
|
||||
str += pszBase58[0];
|
||||
|
||||
// Convert little endian string to big endian
|
||||
// Convert little endian std::string to big endian
|
||||
reverse(str.begin(), str.end());
|
||||
return str;
|
||||
}
|
||||
|
||||
inline string EncodeBase58(const vector<unsigned char>& vch)
|
||||
inline std::string EncodeBase58(const std::vector<unsigned char>& vch)
|
||||
{
|
||||
return EncodeBase58(&vch[0], &vch[0] + vch.size());
|
||||
}
|
||||
|
||||
inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
|
||||
inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
|
||||
{
|
||||
CAutoBN_CTX pctx;
|
||||
vchRet.clear();
|
||||
@@ -88,7 +95,7 @@ inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
|
||||
}
|
||||
|
||||
// Get bignum as little endian data
|
||||
vector<unsigned char> vchTmp = bn.getvch();
|
||||
std::vector<unsigned char> vchTmp = bn.getvch();
|
||||
|
||||
// Trim off sign byte if present
|
||||
if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
|
||||
@@ -105,7 +112,7 @@ inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool DecodeBase58(const string& str, vector<unsigned char>& vchRet)
|
||||
inline bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
|
||||
{
|
||||
return DecodeBase58(str.c_str(), vchRet);
|
||||
}
|
||||
@@ -114,16 +121,16 @@ inline bool DecodeBase58(const string& str, vector<unsigned char>& vchRet)
|
||||
|
||||
|
||||
|
||||
inline string EncodeBase58Check(const vector<unsigned char>& vchIn)
|
||||
inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
|
||||
{
|
||||
// add 4-byte hash check to the end
|
||||
vector<unsigned char> vch(vchIn);
|
||||
std::vector<unsigned char> vch(vchIn);
|
||||
uint256 hash = Hash(vch.begin(), vch.end());
|
||||
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
|
||||
return EncodeBase58(vch);
|
||||
}
|
||||
|
||||
inline bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet)
|
||||
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
|
||||
{
|
||||
if (!DecodeBase58(psz, vchRet))
|
||||
return false;
|
||||
@@ -142,7 +149,7 @@ inline bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet)
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
|
||||
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
|
||||
{
|
||||
return DecodeBase58Check(str.c_str(), vchRet);
|
||||
}
|
||||
@@ -154,17 +161,17 @@ inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
|
||||
|
||||
#define ADDRESSVERSION ((unsigned char)(fTestNet ? 111 : 0))
|
||||
|
||||
inline string Hash160ToAddress(uint160 hash160)
|
||||
inline std::string Hash160ToAddress(uint160 hash160)
|
||||
{
|
||||
// add 1-byte version number to the front
|
||||
vector<unsigned char> vch(1, ADDRESSVERSION);
|
||||
std::vector<unsigned char> vch(1, ADDRESSVERSION);
|
||||
vch.insert(vch.end(), UBEGIN(hash160), UEND(hash160));
|
||||
return EncodeBase58Check(vch);
|
||||
}
|
||||
|
||||
inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
|
||||
{
|
||||
vector<unsigned char> vch;
|
||||
std::vector<unsigned char> vch;
|
||||
if (!DecodeBase58Check(psz, vch))
|
||||
return false;
|
||||
if (vch.empty())
|
||||
@@ -176,7 +183,7 @@ inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
|
||||
return (nVersion <= ADDRESSVERSION);
|
||||
}
|
||||
|
||||
inline bool AddressToHash160(const string& str, uint160& hash160Ret)
|
||||
inline bool AddressToHash160(const std::string& str, uint160& hash160Ret)
|
||||
{
|
||||
return AddressToHash160(str.c_str(), hash160Ret);
|
||||
}
|
||||
@@ -187,7 +194,7 @@ inline bool IsValidBitcoinAddress(const char* psz)
|
||||
return AddressToHash160(psz, hash160);
|
||||
}
|
||||
|
||||
inline bool IsValidBitcoinAddress(const string& str)
|
||||
inline bool IsValidBitcoinAddress(const std::string& str)
|
||||
{
|
||||
return IsValidBitcoinAddress(str.c_str());
|
||||
}
|
||||
@@ -195,7 +202,9 @@ inline bool IsValidBitcoinAddress(const string& str)
|
||||
|
||||
|
||||
|
||||
inline string PubKeyToAddress(const vector<unsigned char>& vchPubKey)
|
||||
inline std::string PubKeyToAddress(const std::vector<unsigned char>& vchPubKey)
|
||||
{
|
||||
return Hash160ToAddress(Hash160(vchPubKey));
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_BIGNUM_H
|
||||
#define BITCOIN_BIGNUM_H
|
||||
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#include "util.h"
|
||||
|
||||
class bignum_error : public std::runtime_error
|
||||
{
|
||||
@@ -228,10 +228,13 @@ public:
|
||||
{
|
||||
std::vector<unsigned char> vch2(vch.size() + 4);
|
||||
unsigned int nSize = vch.size();
|
||||
// BIGNUM's byte stream format expects 4 bytes of
|
||||
// big endian size data info at the front
|
||||
vch2[0] = (nSize >> 24) & 0xff;
|
||||
vch2[1] = (nSize >> 16) & 0xff;
|
||||
vch2[2] = (nSize >> 8) & 0xff;
|
||||
vch2[3] = (nSize >> 0) & 0xff;
|
||||
// swap data to big endian
|
||||
reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4);
|
||||
BN_mpi2bn(&vch2[0], vch2.size(), this);
|
||||
}
|
||||
@@ -308,7 +311,7 @@ public:
|
||||
CAutoBN_CTX pctx;
|
||||
CBigNum bnBase = nBase;
|
||||
CBigNum bn0 = 0;
|
||||
string str;
|
||||
std::string str;
|
||||
CBigNum bn = *this;
|
||||
BN_set_negative(&bn, false);
|
||||
CBigNum dv;
|
||||
@@ -348,7 +351,7 @@ public:
|
||||
template<typename Stream>
|
||||
void Unserialize(Stream& s, int nType=0, int nVersion=VERSION)
|
||||
{
|
||||
vector<unsigned char> vch;
|
||||
std::vector<unsigned char> vch;
|
||||
::Unserialize(s, vch, nType, nVersion);
|
||||
setvch(vch);
|
||||
}
|
||||
@@ -530,3 +533,5 @@ inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a,
|
||||
inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
|
||||
inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); }
|
||||
inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); }
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
#include "headers.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
void ThreadFlushWalletDB(void* parg);
|
||||
|
||||
|
||||
@@ -434,13 +437,13 @@ bool CTxDB::LoadBlockIndex()
|
||||
// Calculate bnChainWork
|
||||
vector<pair<int, CBlockIndex*> > vSortedByHeight;
|
||||
vSortedByHeight.reserve(mapBlockIndex.size());
|
||||
foreach(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
|
||||
BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
|
||||
{
|
||||
CBlockIndex* pindex = item.second;
|
||||
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
|
||||
}
|
||||
sort(vSortedByHeight.begin(), vSortedByHeight.end());
|
||||
foreach(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
|
||||
BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
|
||||
{
|
||||
CBlockIndex* pindex = item.second;
|
||||
pindex->bnChainWork = (pindex->pprev ? pindex->pprev->bnChainWork : 0) + pindex->GetBlockWork();
|
||||
@@ -603,7 +606,7 @@ int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
|
||||
ListAccountCreditDebit(strAccount, entries);
|
||||
|
||||
int64 nCreditDebit = 0;
|
||||
foreach (const CAccountingEntry& entry, entries)
|
||||
BOOST_FOREACH (const CAccountingEntry& entry, entries)
|
||||
nCreditDebit += entry.nCreditDebit;
|
||||
|
||||
return nCreditDebit;
|
||||
@@ -668,8 +671,8 @@ bool CWalletDB::LoadWallet()
|
||||
#endif
|
||||
|
||||
//// todo: shouldn't we catch exceptions and try to recover and continue?
|
||||
CRITICAL_BLOCK(cs_mapKeys)
|
||||
CRITICAL_BLOCK(cs_mapWallet)
|
||||
CRITICAL_BLOCK(cs_mapKeys)
|
||||
{
|
||||
// Get cursor
|
||||
Dbc* pcursor = GetCursor();
|
||||
@@ -778,10 +781,10 @@ bool CWalletDB::LoadWallet()
|
||||
string strKey;
|
||||
ssKey >> strKey;
|
||||
|
||||
// Menu state
|
||||
if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins;
|
||||
|
||||
// Options
|
||||
#ifndef GUI
|
||||
if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins;
|
||||
#endif
|
||||
if (strKey == "nTransactionFee") ssValue >> nTransactionFee;
|
||||
if (strKey == "addrIncoming") ssValue >> addrIncoming;
|
||||
if (strKey == "fLimitProcessors") ssValue >> fLimitProcessors;
|
||||
@@ -790,13 +793,13 @@ bool CWalletDB::LoadWallet()
|
||||
if (strKey == "fMinimizeOnClose") ssValue >> fMinimizeOnClose;
|
||||
if (strKey == "fUseProxy") ssValue >> fUseProxy;
|
||||
if (strKey == "addrProxy") ssValue >> addrProxy;
|
||||
|
||||
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
|
||||
}
|
||||
}
|
||||
pcursor->close();
|
||||
}
|
||||
|
||||
foreach(uint256 hash, vWalletUpgrade)
|
||||
BOOST_FOREACH(uint256 hash, vWalletUpgrade)
|
||||
WriteTx(hash, mapWallet[hash]);
|
||||
|
||||
printf("nFileVersion = %d\n", nFileVersion);
|
||||
@@ -807,6 +810,8 @@ bool CWalletDB::LoadWallet()
|
||||
printf("fMinimizeOnClose = %d\n", fMinimizeOnClose);
|
||||
printf("fUseProxy = %d\n", fUseProxy);
|
||||
printf("addrProxy = %s\n", addrProxy.ToString().c_str());
|
||||
if (fHaveUPnP)
|
||||
printf("fUseUPnP = %d\n", fUseUPnP);
|
||||
|
||||
|
||||
// Upgrade
|
||||
@@ -840,12 +845,11 @@ bool LoadWallet(bool& fFirstRunRet)
|
||||
{
|
||||
// Create new keyUser and set as default key
|
||||
RandAddSeedPerfmon();
|
||||
keyUser.MakeNewKey();
|
||||
if (!AddKey(keyUser))
|
||||
return false;
|
||||
if (!SetAddressBookName(PubKeyToAddress(keyUser.GetPubKey()), "Your Address"))
|
||||
return false;
|
||||
CWalletDB().WriteDefaultKey(keyUser.GetPubKey());
|
||||
|
||||
CWalletDB walletdb;
|
||||
vchDefaultKey = GetKeyFromKeyPool();
|
||||
walletdb.WriteDefaultKey(vchDefaultKey);
|
||||
walletdb.WriteName(PubKeyToAddress(vchDefaultKey), "");
|
||||
}
|
||||
|
||||
CreateThread(ThreadFlushWalletDB, NULL);
|
||||
104
db.h → src/db.h
@@ -1,6 +1,16 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_DB_H
|
||||
#define BITCOIN_DB_H
|
||||
|
||||
#include "key.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <db_cxx.h>
|
||||
|
||||
class CTransaction;
|
||||
class CTxIndex;
|
||||
@@ -13,10 +23,11 @@ class CAddress;
|
||||
class CWalletTx;
|
||||
class CAccount;
|
||||
class CAccountingEntry;
|
||||
class CBlockLocator;
|
||||
|
||||
extern map<string, string> mapAddressBook;
|
||||
extern std::map<std::string, std::string> mapAddressBook;
|
||||
extern CCriticalSection cs_mapAddressBook;
|
||||
extern vector<unsigned char> vchDefaultKey;
|
||||
extern std::vector<unsigned char> vchDefaultKey;
|
||||
extern bool fClient;
|
||||
extern int nBestHeight;
|
||||
|
||||
@@ -26,7 +37,7 @@ extern DbEnv dbenv;
|
||||
|
||||
|
||||
extern void DBFlush(bool fShutdown);
|
||||
extern vector<unsigned char> GetKeyFromKeyPool();
|
||||
extern std::vector<unsigned char> GetKeyFromKeyPool();
|
||||
extern int64 GetOldestKeyPoolTime();
|
||||
|
||||
|
||||
@@ -36,8 +47,8 @@ class CDB
|
||||
{
|
||||
protected:
|
||||
Db* pdb;
|
||||
string strFile;
|
||||
vector<DbTxn*> vTxn;
|
||||
std::string strFile;
|
||||
std::vector<DbTxn*> vTxn;
|
||||
bool fReadOnly;
|
||||
|
||||
explicit CDB(const char* pszFile, const char* pszMode="r+");
|
||||
@@ -246,12 +257,12 @@ public:
|
||||
bool ReadVersion(int& nVersion)
|
||||
{
|
||||
nVersion = 0;
|
||||
return Read(string("version"), nVersion);
|
||||
return Read(std::string("version"), nVersion);
|
||||
}
|
||||
|
||||
bool WriteVersion(int nVersion)
|
||||
{
|
||||
return Write(string("version"), nVersion);
|
||||
return Write(std::string("version"), nVersion);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -275,7 +286,7 @@ public:
|
||||
bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight);
|
||||
bool EraseTxIndex(const CTransaction& tx);
|
||||
bool ContainsTx(uint256 hash);
|
||||
bool ReadOwnerTxes(uint160 hash160, int nHeight, vector<CTransaction>& vtx);
|
||||
bool ReadOwnerTxes(uint160 hash160, int nHeight, std::vector<CTransaction>& vtx);
|
||||
bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex);
|
||||
bool ReadDiskTx(uint256 hash, CTransaction& tx);
|
||||
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex);
|
||||
@@ -317,14 +328,14 @@ class CKeyPool
|
||||
{
|
||||
public:
|
||||
int64 nTime;
|
||||
vector<unsigned char> vchPubKey;
|
||||
std::vector<unsigned char> vchPubKey;
|
||||
|
||||
CKeyPool()
|
||||
{
|
||||
nTime = GetTime();
|
||||
}
|
||||
|
||||
CKeyPool(const vector<unsigned char>& vchPubKeyIn)
|
||||
CKeyPool(const std::vector<unsigned char>& vchPubKeyIn)
|
||||
{
|
||||
nTime = GetTime();
|
||||
vchPubKey = vchPubKeyIn;
|
||||
@@ -352,90 +363,101 @@ private:
|
||||
CWalletDB(const CWalletDB&);
|
||||
void operator=(const CWalletDB&);
|
||||
public:
|
||||
bool ReadName(const string& strAddress, string& strName)
|
||||
bool ReadName(const std::string& strAddress, std::string& strName)
|
||||
{
|
||||
strName = "";
|
||||
return Read(make_pair(string("name"), strAddress), strName);
|
||||
return Read(std::make_pair(std::string("name"), strAddress), strName);
|
||||
}
|
||||
|
||||
bool WriteName(const string& strAddress, const string& strName)
|
||||
bool WriteName(const std::string& strAddress, const std::string& strName)
|
||||
{
|
||||
CRITICAL_BLOCK(cs_mapAddressBook)
|
||||
mapAddressBook[strAddress] = strName;
|
||||
nWalletDBUpdated++;
|
||||
return Write(make_pair(string("name"), strAddress), strName);
|
||||
return Write(std::make_pair(std::string("name"), strAddress), strName);
|
||||
}
|
||||
|
||||
bool EraseName(const string& strAddress)
|
||||
bool EraseName(const std::string& strAddress)
|
||||
{
|
||||
// This should only be used for sending addresses, never for receiving addresses,
|
||||
// receiving addresses must always have an address book entry if they're not change return.
|
||||
CRITICAL_BLOCK(cs_mapAddressBook)
|
||||
mapAddressBook.erase(strAddress);
|
||||
nWalletDBUpdated++;
|
||||
return Erase(make_pair(string("name"), strAddress));
|
||||
return Erase(std::make_pair(std::string("name"), strAddress));
|
||||
}
|
||||
|
||||
bool ReadTx(uint256 hash, CWalletTx& wtx)
|
||||
{
|
||||
return Read(make_pair(string("tx"), hash), wtx);
|
||||
return Read(std::make_pair(std::string("tx"), hash), wtx);
|
||||
}
|
||||
|
||||
bool WriteTx(uint256 hash, const CWalletTx& wtx)
|
||||
{
|
||||
nWalletDBUpdated++;
|
||||
return Write(make_pair(string("tx"), hash), wtx);
|
||||
return Write(std::make_pair(std::string("tx"), hash), wtx);
|
||||
}
|
||||
|
||||
bool EraseTx(uint256 hash)
|
||||
{
|
||||
nWalletDBUpdated++;
|
||||
return Erase(make_pair(string("tx"), hash));
|
||||
return Erase(std::make_pair(std::string("tx"), hash));
|
||||
}
|
||||
|
||||
bool ReadKey(const vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
|
||||
bool ReadKey(const std::vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
|
||||
{
|
||||
vchPrivKey.clear();
|
||||
return Read(make_pair(string("key"), vchPubKey), vchPrivKey);
|
||||
return Read(std::make_pair(std::string("key"), vchPubKey), vchPrivKey);
|
||||
}
|
||||
|
||||
bool WriteKey(const vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
|
||||
bool WriteKey(const std::vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
|
||||
{
|
||||
nWalletDBUpdated++;
|
||||
return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
|
||||
return Write(std::make_pair(std::string("key"), vchPubKey), vchPrivKey, false);
|
||||
}
|
||||
|
||||
bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
|
||||
bool WriteBestBlock(const CBlockLocator& locator)
|
||||
{
|
||||
nWalletDBUpdated++;
|
||||
return Write(std::string("bestblock"), locator);
|
||||
}
|
||||
|
||||
bool ReadBestBlock(CBlockLocator& locator)
|
||||
{
|
||||
return Read(std::string("bestblock"), locator);
|
||||
}
|
||||
|
||||
bool ReadDefaultKey(std::vector<unsigned char>& vchPubKey)
|
||||
{
|
||||
vchPubKey.clear();
|
||||
return Read(string("defaultkey"), vchPubKey);
|
||||
return Read(std::string("defaultkey"), vchPubKey);
|
||||
}
|
||||
|
||||
bool WriteDefaultKey(const vector<unsigned char>& vchPubKey)
|
||||
bool WriteDefaultKey(const std::vector<unsigned char>& vchPubKey)
|
||||
{
|
||||
vchDefaultKey = vchPubKey;
|
||||
nWalletDBUpdated++;
|
||||
return Write(string("defaultkey"), vchPubKey);
|
||||
return Write(std::string("defaultkey"), vchPubKey);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool ReadSetting(const string& strKey, T& value)
|
||||
bool ReadSetting(const std::string& strKey, T& value)
|
||||
{
|
||||
return Read(make_pair(string("setting"), strKey), value);
|
||||
return Read(std::make_pair(std::string("setting"), strKey), value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool WriteSetting(const string& strKey, const T& value)
|
||||
bool WriteSetting(const std::string& strKey, const T& value)
|
||||
{
|
||||
nWalletDBUpdated++;
|
||||
return Write(make_pair(string("setting"), strKey), value);
|
||||
return Write(std::make_pair(std::string("setting"), strKey), value);
|
||||
}
|
||||
|
||||
bool ReadAccount(const string& strAccount, CAccount& account);
|
||||
bool WriteAccount(const string& strAccount, const CAccount& account);
|
||||
bool ReadAccount(const std::string& strAccount, CAccount& account);
|
||||
bool WriteAccount(const std::string& strAccount, const CAccount& account);
|
||||
bool WriteAccountingEntry(const CAccountingEntry& acentry);
|
||||
int64 GetAccountCreditDebit(const string& strAccount);
|
||||
void ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& acentries);
|
||||
int64 GetAccountCreditDebit(const std::string& strAccount);
|
||||
void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
|
||||
|
||||
bool LoadWallet();
|
||||
protected:
|
||||
@@ -443,14 +465,14 @@ protected:
|
||||
void KeepKey(int64 nIndex);
|
||||
static void ReturnKey(int64 nIndex);
|
||||
friend class CReserveKey;
|
||||
friend vector<unsigned char> GetKeyFromKeyPool();
|
||||
friend std::vector<unsigned char> GetKeyFromKeyPool();
|
||||
friend int64 GetOldestKeyPoolTime();
|
||||
};
|
||||
|
||||
bool LoadWallet(bool& fFirstRunRet);
|
||||
void BackupWallet(const string& strDest);
|
||||
void BackupWallet(const std::string& strDest);
|
||||
|
||||
inline bool SetAddressBookName(const string& strAddress, const string& strName)
|
||||
inline bool SetAddressBookName(const std::string& strAddress, const std::string& strName)
|
||||
{
|
||||
return CWalletDB().WriteName(strAddress, strName);
|
||||
}
|
||||
@@ -459,7 +481,7 @@ class CReserveKey
|
||||
{
|
||||
protected:
|
||||
int64 nIndex;
|
||||
vector<unsigned char> vchPubKey;
|
||||
std::vector<unsigned char> vchPubKey;
|
||||
public:
|
||||
CReserveKey()
|
||||
{
|
||||
@@ -472,7 +494,7 @@ public:
|
||||
ReturnKey();
|
||||
}
|
||||
|
||||
vector<unsigned char> GetReservedKey()
|
||||
std::vector<unsigned char> GetReservedKey()
|
||||
{
|
||||
if (nIndex == -1)
|
||||
{
|
||||
@@ -500,3 +522,5 @@ public:
|
||||
vchPubKey.clear();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -109,8 +109,6 @@
|
||||
|
||||
|
||||
#pragma hdrstop
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
#include "strlcpy.h"
|
||||
#include "serialize.h"
|
||||
@@ -133,6 +131,7 @@ using namespace boost;
|
||||
#endif
|
||||
#include "init.h"
|
||||
|
||||
#ifdef GUI
|
||||
#include "xpm/addressbook16.xpm"
|
||||
#include "xpm/addressbook20.xpm"
|
||||
#include "xpm/bitcoin16.xpm"
|
||||
@@ -145,3 +144,4 @@ using namespace boost;
|
||||
#include "xpm/send16noshadow.xpm"
|
||||
#include "xpm/send20.xpm"
|
||||
#include "xpm/about.xpm"
|
||||
#endif
|
||||
@@ -1,14 +1,10 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "headers.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -41,6 +37,7 @@ void Shutdown(void* parg)
|
||||
DBFlush(false);
|
||||
StopNode();
|
||||
DBFlush(true);
|
||||
boost::filesystem::remove(GetPidFile());
|
||||
CreateThread(ExitTimeout, NULL);
|
||||
Sleep(50);
|
||||
printf("Bitcoin exiting\n\n");
|
||||
@@ -70,36 +67,16 @@ void HandleSIGTERM(int)
|
||||
//
|
||||
// Start
|
||||
//
|
||||
|
||||
#ifndef GUI
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
for (int i = 1; i < argc; i++)
|
||||
if (!IsSwitchChar(argv[i][0]))
|
||||
fCommandLine = true;
|
||||
fDaemon = !fCommandLine;
|
||||
bool fRet = false;
|
||||
fRet = AppInit(argc, argv);
|
||||
|
||||
#ifdef __WXGTK__
|
||||
if (!fCommandLine)
|
||||
{
|
||||
// Daemonize
|
||||
pid_t pid = fork();
|
||||
if (pid < 0)
|
||||
{
|
||||
fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno);
|
||||
return 1;
|
||||
}
|
||||
if (pid > 0)
|
||||
pthread_exit((void*)0);
|
||||
}
|
||||
#endif
|
||||
if (fRet && fDaemon)
|
||||
return 0;
|
||||
|
||||
if (!AppInit(argc, argv))
|
||||
return 1;
|
||||
|
||||
while (!fShutdown)
|
||||
Sleep(1000000);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -141,6 +118,8 @@ bool AppInit2(int argc, char* argv[])
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGHUP, &sa, NULL);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -158,9 +137,8 @@ bool AppInit2(int argc, char* argv[])
|
||||
|
||||
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
||||
{
|
||||
string beta = VERSION_IS_BETA ? _(" beta") : "";
|
||||
string strUsage = string() +
|
||||
_("Bitcoin version") + " " + FormatVersion(VERSION) + pszSubVer + beta + "\n\n" +
|
||||
_("Bitcoin version") + " " + FormatFullVersion() + "\n\n" +
|
||||
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
|
||||
" bitcoin [options] \t " + "\n" +
|
||||
" bitcoin [options] <command> [params]\t " + _("Send command to -server or bitcoind\n") +
|
||||
@@ -168,17 +146,31 @@ bool AppInit2(int argc, char* argv[])
|
||||
" bitcoin [options] help <command> \t\t " + _("Get help for a command\n") +
|
||||
_("Options:\n") +
|
||||
" -conf=<file> \t\t " + _("Specify configuration file (default: bitcoin.conf)\n") +
|
||||
" -pid=<file> \t\t " + _("Specify pid file (default: bitcoind.pid)\n") +
|
||||
" -gen \t\t " + _("Generate coins\n") +
|
||||
" -gen=0 \t\t " + _("Don't generate coins\n") +
|
||||
" -min \t\t " + _("Start minimized\n") +
|
||||
" -datadir=<dir> \t\t " + _("Specify data directory\n") +
|
||||
" -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)\n") +
|
||||
" -proxy=<ip:port> \t " + _("Connect through socks4 proxy\n") +
|
||||
" -dns \t " + _("Allow DNS lookups for addnode and connect\n") +
|
||||
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
|
||||
" -connect=<ip> \t\t " + _("Connect only to the specified node\n") +
|
||||
" -nolisten \t " + _("Don't accept connections from outside") +
|
||||
" -nolisten \t " + _("Don't accept connections from outside\n") +
|
||||
#ifdef USE_UPNP
|
||||
#if USE_UPNP
|
||||
" -noupnp \t " + _("Don't attempt to use UPnP to map the listening port\n") +
|
||||
#else
|
||||
" -upnp \t " + _("Attempt to use UPnP to map the listening port\n") +
|
||||
#endif
|
||||
#endif
|
||||
" -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send\n") +
|
||||
#ifdef GUI
|
||||
" -server \t\t " + _("Accept command line and JSON-RPC commands\n") +
|
||||
#endif
|
||||
#ifndef __WXMSW__
|
||||
" -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
|
||||
#endif
|
||||
" -testnet \t\t " + _("Use the test network\n") +
|
||||
" -rpcuser=<user> \t " + _("Username for JSON-RPC connections\n") +
|
||||
" -rpcpassword=<pw>\t " + _("Password for JSON-RPC connections\n") +
|
||||
@@ -212,13 +204,34 @@ bool AppInit2(int argc, char* argv[])
|
||||
}
|
||||
|
||||
fDebug = GetBoolArg("-debug");
|
||||
fAllowDNS = GetBoolArg("-dns");
|
||||
|
||||
#ifndef __WXMSW__
|
||||
fDaemon = GetBoolArg("-daemon");
|
||||
#else
|
||||
fDaemon = false;
|
||||
#endif
|
||||
|
||||
if (fDaemon)
|
||||
fServer = true;
|
||||
else
|
||||
fServer = GetBoolArg("-server");
|
||||
|
||||
/* force fServer when running without GUI */
|
||||
#ifndef GUI
|
||||
fServer = true;
|
||||
#endif
|
||||
|
||||
fPrintToConsole = GetBoolArg("-printtoconsole");
|
||||
fPrintToDebugger = GetBoolArg("-printtodebugger");
|
||||
|
||||
fTestNet = GetBoolArg("-testnet");
|
||||
|
||||
fNoListen = GetBoolArg("-nolisten");
|
||||
fLogTimestamps = GetBoolArg("-logtimestamps");
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
if (!IsSwitchChar(argv[i][0]))
|
||||
fCommandLine = true;
|
||||
|
||||
if (fCommandLine)
|
||||
{
|
||||
@@ -226,10 +239,32 @@ bool AppInit2(int argc, char* argv[])
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
#ifndef __WXMSW__
|
||||
if (fDaemon)
|
||||
{
|
||||
// Daemonize
|
||||
pid_t pid = fork();
|
||||
if (pid < 0)
|
||||
{
|
||||
fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno);
|
||||
return false;
|
||||
}
|
||||
if (pid > 0)
|
||||
{
|
||||
CreatePidFile(GetPidFile(), pid);
|
||||
return true;
|
||||
}
|
||||
|
||||
pid_t sid = setsid();
|
||||
if (sid < 0)
|
||||
fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!fDebug && !pszSetDataDir[0])
|
||||
ShrinkDebugFile();
|
||||
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
printf("Bitcoin version %s%s%s\n", FormatVersion(VERSION).c_str(), pszSubVer, VERSION_IS_BETA ? _(" beta") : "");
|
||||
printf("Bitcoin version %s\n", FormatFullVersion().c_str());
|
||||
#ifdef GUI
|
||||
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
|
||||
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
|
||||
@@ -288,7 +323,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
// Make sure only a single bitcoin process is using the data directory.
|
||||
string strLockFile = GetDataDir() + "/.lock";
|
||||
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
|
||||
fclose(file);
|
||||
if (file) fclose(file);
|
||||
static boost::interprocess::file_lock lock(strLockFile.c_str());
|
||||
if (!lock.try_lock())
|
||||
{
|
||||
@@ -334,10 +369,21 @@ bool AppInit2(int argc, char* argv[])
|
||||
strErrors += _("Error loading wallet.dat \n");
|
||||
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
|
||||
|
||||
CBlockIndex *pindexRescan = pindexBest;
|
||||
if (GetBoolArg("-rescan"))
|
||||
pindexRescan = pindexGenesisBlock;
|
||||
else
|
||||
{
|
||||
CWalletDB walletdb;
|
||||
CBlockLocator locator;
|
||||
if (walletdb.ReadBestBlock(locator))
|
||||
pindexRescan = locator.GetBlockIndex();
|
||||
}
|
||||
if (pindexBest != pindexRescan)
|
||||
{
|
||||
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
|
||||
nStart = GetTimeMillis();
|
||||
ScanForWalletTransactions(pindexGenesisBlock);
|
||||
ScanForWalletTransactions(pindexRescan, true);
|
||||
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
|
||||
}
|
||||
|
||||
@@ -369,6 +415,13 @@ bool AppInit2(int argc, char* argv[])
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mapArgs.count("-timeout"))
|
||||
{
|
||||
int nNewTimeout = GetArg("-timeout", 5000);
|
||||
if (nNewTimeout > 0 && nNewTimeout < 600000)
|
||||
nConnectTimeout = nNewTimeout;
|
||||
}
|
||||
|
||||
if (mapArgs.count("-printblock"))
|
||||
{
|
||||
string strMatch = mapArgs["-printblock"];
|
||||
@@ -407,15 +460,18 @@ bool AppInit2(int argc, char* argv[])
|
||||
|
||||
if (mapArgs.count("-addnode"))
|
||||
{
|
||||
foreach(string strAddr, mapMultiArgs["-addnode"])
|
||||
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
|
||||
{
|
||||
CAddress addr(strAddr, NODE_NETWORK);
|
||||
CAddress addr(strAddr, fAllowDNS);
|
||||
addr.nTime = 0; // so it won't relay unless successfully connected
|
||||
if (addr.IsValid())
|
||||
AddAddress(addr);
|
||||
}
|
||||
}
|
||||
|
||||
if (mapArgs.count("-dnsseed"))
|
||||
DNSAddressSeed();
|
||||
|
||||
if (mapArgs.count("-paytxfee"))
|
||||
{
|
||||
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
|
||||
@@ -427,6 +483,17 @@ bool AppInit2(int argc, char* argv[])
|
||||
wxMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), "Bitcoin", wxOK | wxICON_EXCLAMATION);
|
||||
}
|
||||
|
||||
if (fHaveUPnP)
|
||||
{
|
||||
#if USE_UPNP
|
||||
if (GetBoolArg("-noupnp"))
|
||||
fUseUPnP = false;
|
||||
#else
|
||||
if (GetBoolArg("-upnp"))
|
||||
fUseUPnP = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Create the main window and start the node
|
||||
//
|
||||
@@ -443,7 +510,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
if (!CreateThread(StartNode, NULL))
|
||||
wxMessageBox("Error: CreateThread(StartNode) failed", "Bitcoin");
|
||||
|
||||
if (GetBoolArg("-server") || fDaemon)
|
||||
if (fServer)
|
||||
CreateThread(ThreadRPCServer, NULL);
|
||||
|
||||
#if defined(__WXMSW__) && defined(GUI)
|
||||
@@ -451,5 +518,10 @@ bool AppInit2(int argc, char* argv[])
|
||||
SetStartOnSystemStartup(true);
|
||||
#endif
|
||||
|
||||
#ifndef GUI
|
||||
while (1)
|
||||
Sleep(5000);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_INIT_H
|
||||
#define BITCOIN_INIT_H
|
||||
|
||||
void Shutdown(void* parg);
|
||||
bool AppInit(int argc, char* argv[]);
|
||||
bool AppInit2(int argc, char* argv[]);
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
#include "headers.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
int nGotIRCAddresses = 0;
|
||||
bool fGotExternalIP = false;
|
||||
|
||||
@@ -41,7 +44,7 @@ bool DecodeAddress(string str, CAddress& addr)
|
||||
return false;
|
||||
memcpy(&tmp, &vch[0], sizeof(tmp));
|
||||
|
||||
addr = CAddress(tmp.ip, tmp.port, NODE_NETWORK);
|
||||
addr = CAddress(tmp.ip, ntohs(tmp.port), NODE_NETWORK);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -215,25 +218,15 @@ bool GetIPFromIRC(SOCKET hSocket, string strMyName, unsigned int& ipRet)
|
||||
return false;
|
||||
string strHost = str.substr(str.rfind("@")+1);
|
||||
|
||||
unsigned int a=0, b=0, c=0, d=0;
|
||||
if (sscanf(strHost.c_str(), "%u.%u.%u.%u", &a, &b, &c, &d) == 4 &&
|
||||
inet_addr(strHost.c_str()) != INADDR_NONE)
|
||||
{
|
||||
printf("GetIPFromIRC() userhost is IP %s\n", strHost.c_str());
|
||||
ipRet = CAddress(strHost).ip;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hybrid IRC used by lfnet always returns IP when you userhost yourself,
|
||||
// but in case another IRC is ever used this should work.
|
||||
printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
|
||||
if (fUseProxy)
|
||||
return false;
|
||||
struct hostent* phostent = gethostbyname(strHost.c_str());
|
||||
if (!phostent || !phostent->h_addr_list || !phostent->h_addr_list[0])
|
||||
return false;
|
||||
ipRet = *(u_long*)phostent->h_addr_list[0];
|
||||
}
|
||||
// Hybrid IRC used by lfnet always returns IP when you userhost yourself,
|
||||
// but in case another IRC is ever used this should work.
|
||||
printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
|
||||
if (fUseProxy)
|
||||
return false;
|
||||
CAddress addr(strHost, 0, true);
|
||||
if (!addr.IsValid())
|
||||
return false;
|
||||
ipRet = addr.ip;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -272,13 +265,13 @@ void ThreadIRCSeed2(void* parg)
|
||||
while (!fShutdown)
|
||||
{
|
||||
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
|
||||
CAddress addrConnect("92.243.23.21:6667"); // irc.lfnet.org
|
||||
CAddress addrConnect("92.243.23.21", 6667); // irc.lfnet.org
|
||||
if (!fTOR)
|
||||
{
|
||||
//struct hostent* phostent = gethostbyname("chat.freenode.net");
|
||||
struct hostent* phostent = gethostbyname("irc.lfnet.org");
|
||||
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
|
||||
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(6667));
|
||||
CAddress addrIRC("irc.lfnet.org", 6667, true);
|
||||
if (addrIRC.IsValid())
|
||||
addrConnect = addrIRC;
|
||||
}
|
||||
|
||||
SOCKET hSocket;
|
||||
@@ -346,9 +339,16 @@ void ThreadIRCSeed2(void* parg)
|
||||
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Send(hSocket, fTestNet ? "JOIN #bitcoinTEST\r" : "JOIN #bitcoin\r");
|
||||
Send(hSocket, fTestNet ? "WHO #bitcoinTEST\r" : "WHO #bitcoin\r");
|
||||
|
||||
if (fTestNet) {
|
||||
Send(hSocket, "JOIN #bitcoinTEST\r");
|
||||
Send(hSocket, "WHO #bitcoinTEST\r");
|
||||
} else {
|
||||
// randomly join #bitcoin00-#bitcoin99
|
||||
int channel_number = GetRandInt(100);
|
||||
Send(hSocket, strprintf("JOIN #bitcoin%02d\r", channel_number).c_str());
|
||||
Send(hSocket, strprintf("WHO #bitcoin%02d\r", channel_number).c_str());
|
||||
}
|
||||
|
||||
int64 nStart = GetTime();
|
||||
string strLine;
|
||||
@@ -390,7 +390,7 @@ void ThreadIRCSeed2(void* parg)
|
||||
{
|
||||
addr.nTime = GetAdjustedTime();
|
||||
if (AddAddress(addr, 51 * 60))
|
||||
printf("IRC got new address\n");
|
||||
printf("IRC got new address: %s\n", addr.ToString().c_str());
|
||||
nGotIRCAddresses++;
|
||||
}
|
||||
else
|
||||
@@ -1,9 +1,13 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_IRC_H
|
||||
#define BITCOIN_IRC_H
|
||||
|
||||
bool RecvLine(SOCKET hSocket, string& strLine);
|
||||
bool RecvLine(SOCKET hSocket, std::string& strLine);
|
||||
void ThreadIRCSeed(void* parg);
|
||||
|
||||
extern int nGotIRCAddresses;
|
||||
extern bool fGotExternalIP;
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,12 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_KEY_H
|
||||
#define BITCOIN_KEY_H
|
||||
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/ecdsa.h>
|
||||
#include <openssl/obj_mac.h>
|
||||
|
||||
// secp160k1
|
||||
// const unsigned int PRIVATE_KEY_SIZE = 192;
|
||||
@@ -36,7 +41,7 @@ public:
|
||||
|
||||
|
||||
// secure_allocator is defined in serialize.h
|
||||
typedef vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
|
||||
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +114,7 @@ public:
|
||||
return vchPrivKey;
|
||||
}
|
||||
|
||||
bool SetPubKey(const vector<unsigned char>& vchPubKey)
|
||||
bool SetPubKey(const std::vector<unsigned char>& vchPubKey)
|
||||
{
|
||||
const unsigned char* pbegin = &vchPubKey[0];
|
||||
if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.size()))
|
||||
@@ -118,19 +123,19 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<unsigned char> GetPubKey() const
|
||||
std::vector<unsigned char> GetPubKey() const
|
||||
{
|
||||
unsigned int nSize = i2o_ECPublicKey(pkey, NULL);
|
||||
if (!nSize)
|
||||
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed");
|
||||
vector<unsigned char> vchPubKey(nSize, 0);
|
||||
std::vector<unsigned char> vchPubKey(nSize, 0);
|
||||
unsigned char* pbegin = &vchPubKey[0];
|
||||
if (i2o_ECPublicKey(pkey, &pbegin) != nSize)
|
||||
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size");
|
||||
return vchPubKey;
|
||||
}
|
||||
|
||||
bool Sign(uint256 hash, vector<unsigned char>& vchSig)
|
||||
bool Sign(uint256 hash, std::vector<unsigned char>& vchSig)
|
||||
{
|
||||
vchSig.clear();
|
||||
unsigned char pchSig[10000];
|
||||
@@ -142,7 +147,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Verify(uint256 hash, const vector<unsigned char>& vchSig)
|
||||
bool Verify(uint256 hash, const std::vector<unsigned char>& vchSig)
|
||||
{
|
||||
// -1 = error, 0 = bad sig, 1 = good
|
||||
if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
|
||||
@@ -150,7 +155,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, vector<unsigned char>& vchSig)
|
||||
static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, std::vector<unsigned char>& vchSig)
|
||||
{
|
||||
CKey key;
|
||||
if (!key.SetPrivKey(vchPrivKey))
|
||||
@@ -158,7 +163,7 @@ public:
|
||||
return key.Sign(hash, vchSig);
|
||||
}
|
||||
|
||||
static bool Verify(const vector<unsigned char>& vchPubKey, uint256 hash, const vector<unsigned char>& vchSig)
|
||||
static bool Verify(const std::vector<unsigned char>& vchPubKey, uint256 hash, const std::vector<unsigned char>& vchSig)
|
||||
{
|
||||
CKey key;
|
||||
if (!key.SetPubKey(vchPubKey))
|
||||
@@ -166,3 +171,5 @@ public:
|
||||
return key.Verify(hash, vchSig);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,16 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_MAIN_H
|
||||
#define BITCOIN_MAIN_H
|
||||
|
||||
#include "bignum.h"
|
||||
#include "net.h"
|
||||
#include "key.h"
|
||||
#include "db.h"
|
||||
#include "script.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
class COutPoint;
|
||||
class CInPoint;
|
||||
@@ -19,9 +29,16 @@ static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
|
||||
static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
|
||||
static const int64 COIN = 100000000;
|
||||
static const int64 CENT = 1000000;
|
||||
static const int64 MIN_TX_FEE = 50000;
|
||||
static const int64 MIN_RELAY_TX_FEE = 10000;
|
||||
static const int64 MAX_MONEY = 21000000 * COIN;
|
||||
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
|
||||
static const int COINBASE_MATURITY = 100;
|
||||
#ifdef USE_UPNP
|
||||
static const int fHaveUPnP = true;
|
||||
#else
|
||||
static const int fHaveUPnP = false;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +46,7 @@ static const int COINBASE_MATURITY = 100;
|
||||
|
||||
|
||||
extern CCriticalSection cs_main;
|
||||
extern map<uint256, CBlockIndex*> mapBlockIndex;
|
||||
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
|
||||
extern uint256 hashGenesisBlock;
|
||||
extern CBigNum bnProofOfWorkLimit;
|
||||
extern CBlockIndex* pindexGenesisBlock;
|
||||
@@ -39,11 +56,11 @@ extern CBigNum bnBestInvalidWork;
|
||||
extern uint256 hashBestChain;
|
||||
extern CBlockIndex* pindexBest;
|
||||
extern unsigned int nTransactionsUpdated;
|
||||
extern map<uint256, int> mapRequestCount;
|
||||
extern std::map<uint256, int> mapRequestCount;
|
||||
extern CCriticalSection cs_mapRequestCount;
|
||||
extern map<string, string> mapAddressBook;
|
||||
extern std::map<std::string, std::string> mapAddressBook;
|
||||
extern CCriticalSection cs_mapAddressBook;
|
||||
extern vector<unsigned char> vchDefaultKey;
|
||||
extern std::vector<unsigned char> vchDefaultKey;
|
||||
extern double dHashesPerSec;
|
||||
extern int64 nHPSTimerStart;
|
||||
|
||||
@@ -55,7 +72,7 @@ extern int fLimitProcessors;
|
||||
extern int nLimitProcessors;
|
||||
extern int fMinimizeToTray;
|
||||
extern int fMinimizeOnClose;
|
||||
|
||||
extern int fUseUPnP;
|
||||
|
||||
|
||||
|
||||
@@ -66,22 +83,23 @@ bool CheckDiskSpace(uint64 nAdditionalBytes=0);
|
||||
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
|
||||
FILE* AppendBlockFile(unsigned int& nFileRet);
|
||||
bool AddKey(const CKey& key);
|
||||
vector<unsigned char> GenerateNewKey();
|
||||
std::vector<unsigned char> GenerateNewKey();
|
||||
bool AddToWallet(const CWalletTx& wtxIn);
|
||||
void WalletUpdateSpent(const COutPoint& prevout);
|
||||
int ScanForWalletTransactions(CBlockIndex* pindexStart);
|
||||
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
|
||||
void ReacceptWalletTransactions();
|
||||
bool LoadBlockIndex(bool fAllowNew=true);
|
||||
void PrintBlockTree();
|
||||
bool ProcessMessages(CNode* pfrom);
|
||||
bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv);
|
||||
bool ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vRecv);
|
||||
bool SendMessages(CNode* pto, bool fSendTrickle);
|
||||
int64 GetBalance();
|
||||
bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
|
||||
bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
|
||||
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
|
||||
bool BroadcastTransaction(CWalletTx& wtxNew);
|
||||
string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
|
||||
string SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
|
||||
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);
|
||||
void GenerateBitcoins(bool fGenerate);
|
||||
void ThreadBitcoinMiner(void* parg);
|
||||
CBlock* CreateNewBlock(CReserveKey& reservekey);
|
||||
@@ -91,7 +109,7 @@ bool CheckWork(CBlock* pblock, CReserveKey& reservekey);
|
||||
void BitcoinMiner();
|
||||
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
|
||||
bool IsInitialBlockDownload();
|
||||
string GetWarnings(string strFor);
|
||||
std::string GetWarnings(std::string strFor);
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +157,7 @@ public:
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
if (IsNull())
|
||||
return strprintf("null");
|
||||
@@ -198,7 +216,7 @@ public:
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
return strprintf("COutPoint(%s, %d)", hash.ToString().substr(0,10).c_str(), n);
|
||||
}
|
||||
@@ -267,9 +285,9 @@ public:
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
string str;
|
||||
std::string str;
|
||||
str += strprintf("CTxIn(");
|
||||
str += prevout.ToString();
|
||||
if (prevout.IsNull())
|
||||
@@ -345,14 +363,14 @@ public:
|
||||
int64 GetCredit() const
|
||||
{
|
||||
if (!MoneyRange(nValue))
|
||||
throw runtime_error("CTxOut::GetCredit() : value out of range");
|
||||
throw std::runtime_error("CTxOut::GetCredit() : value out of range");
|
||||
return (IsMine() ? nValue : 0);
|
||||
}
|
||||
|
||||
bool IsChange() const
|
||||
{
|
||||
// On a debit transaction, a txout that's mine but isn't in the address book is change
|
||||
vector<unsigned char> vchPubKey;
|
||||
std::vector<unsigned char> vchPubKey;
|
||||
if (ExtractPubKey(scriptPubKey, true, vchPubKey))
|
||||
CRITICAL_BLOCK(cs_mapAddressBook)
|
||||
if (!mapAddressBook.count(PubKeyToAddress(vchPubKey)))
|
||||
@@ -363,7 +381,7 @@ public:
|
||||
int64 GetChange() const
|
||||
{
|
||||
if (!MoneyRange(nValue))
|
||||
throw runtime_error("CTxOut::GetChange() : value out of range");
|
||||
throw std::runtime_error("CTxOut::GetChange() : value out of range");
|
||||
return (IsChange() ? nValue : 0);
|
||||
}
|
||||
|
||||
@@ -378,7 +396,7 @@ public:
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
if (scriptPubKey.size() < 6)
|
||||
return "CTxOut(error)";
|
||||
@@ -402,8 +420,8 @@ class CTransaction
|
||||
{
|
||||
public:
|
||||
int nVersion;
|
||||
vector<CTxIn> vin;
|
||||
vector<CTxOut> vout;
|
||||
std::vector<CTxIn> vin;
|
||||
std::vector<CTxOut> vout;
|
||||
unsigned int nLockTime;
|
||||
|
||||
|
||||
@@ -450,7 +468,7 @@ public:
|
||||
nBlockTime = GetAdjustedTime();
|
||||
if ((int64)nLockTime < (nLockTime < 500000000 ? (int64)nBlockHeight : nBlockTime))
|
||||
return true;
|
||||
foreach(const CTxIn& txin, vin)
|
||||
BOOST_FOREACH(const CTxIn& txin, vin)
|
||||
if (!txin.IsFinal())
|
||||
return false;
|
||||
return true;
|
||||
@@ -493,19 +511,19 @@ public:
|
||||
int GetSigOpCount() const
|
||||
{
|
||||
int n = 0;
|
||||
foreach(const CTxIn& txin, vin)
|
||||
BOOST_FOREACH(const CTxIn& txin, vin)
|
||||
n += txin.scriptSig.GetSigOpCount();
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
n += txout.scriptPubKey.GetSigOpCount();
|
||||
return n;
|
||||
}
|
||||
|
||||
bool IsStandard() const
|
||||
{
|
||||
foreach(const CTxIn& txin, vin)
|
||||
BOOST_FOREACH(const CTxIn& txin, vin)
|
||||
if (!txin.scriptSig.IsPushOnly())
|
||||
return error("nonstandard txin: %s", txin.scriptSig.ToString().c_str());
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
if (!::IsStandard(txout.scriptPubKey))
|
||||
return error("nonstandard txout: %s", txout.scriptPubKey.ToString().c_str());
|
||||
return true;
|
||||
@@ -513,7 +531,7 @@ public:
|
||||
|
||||
bool IsMine() const
|
||||
{
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
if (txout.IsMine())
|
||||
return true;
|
||||
return false;
|
||||
@@ -527,11 +545,11 @@ public:
|
||||
int64 GetDebit() const
|
||||
{
|
||||
int64 nDebit = 0;
|
||||
foreach(const CTxIn& txin, vin)
|
||||
BOOST_FOREACH(const CTxIn& txin, vin)
|
||||
{
|
||||
nDebit += txin.GetDebit();
|
||||
if (!MoneyRange(nDebit))
|
||||
throw runtime_error("CTransaction::GetDebit() : value out of range");
|
||||
throw std::runtime_error("CTransaction::GetDebit() : value out of range");
|
||||
}
|
||||
return nDebit;
|
||||
}
|
||||
@@ -539,11 +557,11 @@ public:
|
||||
int64 GetCredit() const
|
||||
{
|
||||
int64 nCredit = 0;
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
{
|
||||
nCredit += txout.GetCredit();
|
||||
if (!MoneyRange(nCredit))
|
||||
throw runtime_error("CTransaction::GetCredit() : value out of range");
|
||||
throw std::runtime_error("CTransaction::GetCredit() : value out of range");
|
||||
}
|
||||
return nCredit;
|
||||
}
|
||||
@@ -553,11 +571,11 @@ public:
|
||||
if (IsCoinBase())
|
||||
return 0;
|
||||
int64 nChange = 0;
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
{
|
||||
nChange += txout.GetChange();
|
||||
if (!MoneyRange(nChange))
|
||||
throw runtime_error("CTransaction::GetChange() : value out of range");
|
||||
throw std::runtime_error("CTransaction::GetChange() : value out of range");
|
||||
}
|
||||
return nChange;
|
||||
}
|
||||
@@ -565,21 +583,30 @@ public:
|
||||
int64 GetValueOut() const
|
||||
{
|
||||
int64 nValueOut = 0;
|
||||
foreach(const CTxOut& txout, vout)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
{
|
||||
nValueOut += txout.nValue;
|
||||
if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
|
||||
throw runtime_error("CTransaction::GetValueOut() : value out of range");
|
||||
throw std::runtime_error("CTransaction::GetValueOut() : value out of range");
|
||||
}
|
||||
return nValueOut;
|
||||
}
|
||||
|
||||
int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true) const
|
||||
static bool AllowFree(double dPriority)
|
||||
{
|
||||
// Base fee is 1 cent per kilobyte
|
||||
// Large (in bytes) low-priority (new, small-coin) transactions
|
||||
// need a fee.
|
||||
return dPriority > COIN * 144 / 250;
|
||||
}
|
||||
|
||||
int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true, bool fForRelay=false) const
|
||||
{
|
||||
// Base fee is either MIN_TX_FEE or MIN_RELAY_TX_FEE
|
||||
int64 nBaseFee = fForRelay ? MIN_RELAY_TX_FEE : MIN_TX_FEE;
|
||||
|
||||
unsigned int nBytes = ::GetSerializeSize(*this, SER_NETWORK);
|
||||
unsigned int nNewBlockSize = nBlockSize + nBytes;
|
||||
int64 nMinFee = (1 + (int64)nBytes / 1000) * CENT;
|
||||
int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;
|
||||
|
||||
if (fAllowFree)
|
||||
{
|
||||
@@ -598,11 +625,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// To limit dust spam, require a 0.01 fee if any output is less than 0.01
|
||||
if (nMinFee < CENT)
|
||||
foreach(const CTxOut& txout, vout)
|
||||
// To limit dust spam, require MIN_TX_FEE/MIN_RELAY_TX_FEE if any output is less than 0.01
|
||||
if (nMinFee < nBaseFee)
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
if (txout.nValue < CENT)
|
||||
nMinFee = CENT;
|
||||
nMinFee = nBaseFee;
|
||||
|
||||
// Raise the price as the block approaches full
|
||||
if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)
|
||||
@@ -653,9 +680,9 @@ public:
|
||||
}
|
||||
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
string str;
|
||||
std::string str;
|
||||
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%d, vout.size=%d, nLockTime=%d)\n",
|
||||
GetHash().ToString().substr(0,10).c_str(),
|
||||
nVersion,
|
||||
@@ -679,7 +706,7 @@ public:
|
||||
bool ReadFromDisk(CTxDB& txdb, COutPoint prevout);
|
||||
bool ReadFromDisk(COutPoint prevout);
|
||||
bool DisconnectInputs(CTxDB& txdb);
|
||||
bool ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
|
||||
bool ConnectInputs(CTxDB& txdb, std::map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
|
||||
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee=0);
|
||||
bool ClientConnectInputs();
|
||||
bool CheckTransaction() const;
|
||||
@@ -706,7 +733,7 @@ class CMerkleTx : public CTransaction
|
||||
{
|
||||
public:
|
||||
uint256 hashBlock;
|
||||
vector<uint256> vMerkleBranch;
|
||||
std::vector<uint256> vMerkleBranch;
|
||||
int nIndex;
|
||||
|
||||
// memory only
|
||||
@@ -730,6 +757,7 @@ public:
|
||||
fMerkleVerified = false;
|
||||
}
|
||||
|
||||
|
||||
IMPLEMENT_SERIALIZE
|
||||
(
|
||||
nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
|
||||
@@ -760,21 +788,23 @@ public:
|
||||
class CWalletTx : public CMerkleTx
|
||||
{
|
||||
public:
|
||||
vector<CMerkleTx> vtxPrev;
|
||||
map<string, string> mapValue;
|
||||
vector<pair<string, string> > vOrderForm;
|
||||
std::vector<CMerkleTx> vtxPrev;
|
||||
std::map<std::string, std::string> mapValue;
|
||||
std::vector<std::pair<std::string, std::string> > vOrderForm;
|
||||
unsigned int fTimeReceivedIsTxTime;
|
||||
unsigned int nTimeReceived; // time received by this node
|
||||
char fFromMe;
|
||||
char fSpent;
|
||||
string strFromAccount;
|
||||
std::string strFromAccount;
|
||||
std::vector<char> vfSpent;
|
||||
|
||||
// memory only
|
||||
mutable char fDebitCached;
|
||||
mutable char fCreditCached;
|
||||
mutable char fAvailableCreditCached;
|
||||
mutable char fChangeCached;
|
||||
mutable int64 nDebitCached;
|
||||
mutable int64 nCreditCached;
|
||||
mutable int64 nAvailableCreditCached;
|
||||
mutable int64 nChangeCached;
|
||||
|
||||
// memory only UI hints
|
||||
@@ -806,13 +836,15 @@ public:
|
||||
fTimeReceivedIsTxTime = false;
|
||||
nTimeReceived = 0;
|
||||
fFromMe = false;
|
||||
fSpent = false;
|
||||
strFromAccount.clear();
|
||||
vfSpent.clear();
|
||||
fDebitCached = false;
|
||||
fCreditCached = false;
|
||||
fAvailableCreditCached = false;
|
||||
fChangeCached = false;
|
||||
nDebitCached = 0;
|
||||
nCreditCached = 0;
|
||||
nAvailableCreditCached = 0;
|
||||
nChangeCached = 0;
|
||||
nTimeDisplayed = 0;
|
||||
nLinesDisplayed = 0;
|
||||
@@ -824,22 +856,96 @@ public:
|
||||
CWalletTx* pthis = const_cast<CWalletTx*>(this);
|
||||
if (fRead)
|
||||
pthis->Init();
|
||||
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion, ser_action);
|
||||
char fSpent = false;
|
||||
|
||||
if (!fRead)
|
||||
{
|
||||
pthis->mapValue["fromaccount"] = pthis->strFromAccount;
|
||||
|
||||
std::string str;
|
||||
BOOST_FOREACH(char f, vfSpent)
|
||||
{
|
||||
str += (f ? '1' : '0');
|
||||
if (f)
|
||||
fSpent = true;
|
||||
}
|
||||
pthis->mapValue["spent"] = str;
|
||||
}
|
||||
|
||||
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action);
|
||||
READWRITE(vtxPrev);
|
||||
|
||||
pthis->mapValue["fromaccount"] = pthis->strFromAccount;
|
||||
READWRITE(mapValue);
|
||||
pthis->strFromAccount = pthis->mapValue["fromaccount"];
|
||||
pthis->mapValue.erase("fromaccount");
|
||||
pthis->mapValue.erase("version");
|
||||
|
||||
READWRITE(vOrderForm);
|
||||
READWRITE(fTimeReceivedIsTxTime);
|
||||
READWRITE(nTimeReceived);
|
||||
READWRITE(fFromMe);
|
||||
READWRITE(fSpent);
|
||||
|
||||
if (fRead)
|
||||
{
|
||||
pthis->strFromAccount = pthis->mapValue["fromaccount"];
|
||||
|
||||
if (mapValue.count("spent"))
|
||||
BOOST_FOREACH(char c, pthis->mapValue["spent"])
|
||||
pthis->vfSpent.push_back(c != '0');
|
||||
else
|
||||
pthis->vfSpent.assign(vout.size(), fSpent);
|
||||
}
|
||||
|
||||
pthis->mapValue.erase("fromaccount");
|
||||
pthis->mapValue.erase("version");
|
||||
pthis->mapValue.erase("spent");
|
||||
)
|
||||
|
||||
// marks certain txout's as spent
|
||||
// returns true if any update took place
|
||||
bool UpdateSpent(const std::vector<char>& vfNewSpent)
|
||||
{
|
||||
bool fReturn = false;
|
||||
for (int i=0; i < vfNewSpent.size(); i++)
|
||||
{
|
||||
if (i == vfSpent.size())
|
||||
break;
|
||||
|
||||
if (vfNewSpent[i] && !vfSpent[i])
|
||||
{
|
||||
vfSpent[i] = true;
|
||||
fReturn = true;
|
||||
fAvailableCreditCached = false;
|
||||
}
|
||||
}
|
||||
return fReturn;
|
||||
}
|
||||
|
||||
void MarkDirty()
|
||||
{
|
||||
fCreditCached = false;
|
||||
fAvailableCreditCached = false;
|
||||
fDebitCached = false;
|
||||
fChangeCached = false;
|
||||
}
|
||||
|
||||
void MarkSpent(unsigned int nOut)
|
||||
{
|
||||
if (nOut >= vout.size())
|
||||
throw std::runtime_error("CWalletTx::MarkSpent() : nOut out of range");
|
||||
vfSpent.resize(vout.size());
|
||||
if (!vfSpent[nOut])
|
||||
{
|
||||
vfSpent[nOut] = true;
|
||||
fAvailableCreditCached = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsSpent(unsigned int nOut) const
|
||||
{
|
||||
if (nOut >= vout.size())
|
||||
throw std::runtime_error("CWalletTx::IsSpent() : nOut out of range");
|
||||
if (nOut >= vfSpent.size())
|
||||
return false;
|
||||
return (!!vfSpent[nOut]);
|
||||
}
|
||||
|
||||
int64 GetDebit() const
|
||||
{
|
||||
if (vin.empty())
|
||||
@@ -865,6 +971,33 @@ public:
|
||||
return nCreditCached;
|
||||
}
|
||||
|
||||
int64 GetAvailableCredit(bool fUseCache=true) const
|
||||
{
|
||||
// Must wait until coinbase is safely deep enough in the chain before valuing it
|
||||
if (IsCoinBase() && GetBlocksToMaturity() > 0)
|
||||
return 0;
|
||||
|
||||
if (fUseCache && fAvailableCreditCached)
|
||||
return nAvailableCreditCached;
|
||||
|
||||
int64 nCredit = 0;
|
||||
for (int i = 0; i < vout.size(); i++)
|
||||
{
|
||||
if (!IsSpent(i))
|
||||
{
|
||||
const CTxOut &txout = vout[i];
|
||||
nCredit += txout.GetCredit();
|
||||
if (!MoneyRange(nCredit))
|
||||
throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
|
||||
}
|
||||
}
|
||||
|
||||
nAvailableCreditCached = nCredit;
|
||||
fAvailableCreditCached = true;
|
||||
return nCredit;
|
||||
}
|
||||
|
||||
|
||||
int64 GetChange() const
|
||||
{
|
||||
if (fChangeCached)
|
||||
@@ -874,10 +1007,10 @@ public:
|
||||
return nChangeCached;
|
||||
}
|
||||
|
||||
void GetAmounts(int64& nGenerated, list<pair<string /* address */, int64> >& listReceived,
|
||||
list<pair<string /* address */, int64> >& listSent, int64& nFee, string& strSentAccount) const;
|
||||
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 GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
|
||||
void GetAccountAmounts(const std::string& strAccount, int64& nGenerated, int64& nReceived,
|
||||
int64& nSent, int64& nFee) const;
|
||||
|
||||
bool IsFromMe() const
|
||||
@@ -897,8 +1030,8 @@ public:
|
||||
|
||||
// If no confirmations but it's from us, we can still
|
||||
// consider it confirmed if all dependencies are confirmed
|
||||
map<uint256, const CMerkleTx*> mapPrev;
|
||||
vector<const CMerkleTx*> vWorkQueue;
|
||||
std::map<uint256, const CMerkleTx*> mapPrev;
|
||||
std::vector<const CMerkleTx*> vWorkQueue;
|
||||
vWorkQueue.reserve(vtxPrev.size()+1);
|
||||
vWorkQueue.push_back(this);
|
||||
for (int i = 0; i < vWorkQueue.size(); i++)
|
||||
@@ -908,15 +1041,15 @@ public:
|
||||
if (!ptx->IsFinal())
|
||||
return false;
|
||||
if (ptx->GetDepthInMainChain() >= 1)
|
||||
return true;
|
||||
continue;
|
||||
if (!ptx->IsFromMe())
|
||||
return false;
|
||||
|
||||
if (mapPrev.empty())
|
||||
foreach(const CMerkleTx& tx, vtxPrev)
|
||||
BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
|
||||
mapPrev[tx.GetHash()] = &tx;
|
||||
|
||||
foreach(const CTxIn& txin, ptx->vin)
|
||||
BOOST_FOREACH(const CTxIn& txin, ptx->vin)
|
||||
{
|
||||
if (!mapPrev.count(txin.prevout.hash))
|
||||
return false;
|
||||
@@ -956,7 +1089,7 @@ class CTxIndex
|
||||
{
|
||||
public:
|
||||
CDiskTxPos pos;
|
||||
vector<CDiskTxPos> vSpent;
|
||||
std::vector<CDiskTxPos> vSpent;
|
||||
|
||||
CTxIndex()
|
||||
{
|
||||
@@ -998,6 +1131,7 @@ public:
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
int GetDepthInMainChain() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -1027,10 +1161,10 @@ public:
|
||||
unsigned int nNonce;
|
||||
|
||||
// network and disk
|
||||
vector<CTransaction> vtx;
|
||||
std::vector<CTransaction> vtx;
|
||||
|
||||
// memory only
|
||||
mutable vector<uint256> vMerkleTree;
|
||||
mutable std::vector<uint256> vMerkleTree;
|
||||
|
||||
|
||||
CBlock()
|
||||
@@ -1085,7 +1219,7 @@ public:
|
||||
int GetSigOpCount() const
|
||||
{
|
||||
int n = 0;
|
||||
foreach(const CTransaction& tx, vtx)
|
||||
BOOST_FOREACH(const CTransaction& tx, vtx)
|
||||
n += tx.GetSigOpCount();
|
||||
return n;
|
||||
}
|
||||
@@ -1094,14 +1228,14 @@ public:
|
||||
uint256 BuildMerkleTree() const
|
||||
{
|
||||
vMerkleTree.clear();
|
||||
foreach(const CTransaction& tx, vtx)
|
||||
BOOST_FOREACH(const CTransaction& tx, vtx)
|
||||
vMerkleTree.push_back(tx.GetHash());
|
||||
int j = 0;
|
||||
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
|
||||
{
|
||||
for (int i = 0; i < nSize; i += 2)
|
||||
{
|
||||
int i2 = min(i+1, nSize-1);
|
||||
int i2 = std::min(i+1, nSize-1);
|
||||
vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]), END(vMerkleTree[j+i]),
|
||||
BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2])));
|
||||
}
|
||||
@@ -1110,15 +1244,15 @@ public:
|
||||
return (vMerkleTree.empty() ? 0 : vMerkleTree.back());
|
||||
}
|
||||
|
||||
vector<uint256> GetMerkleBranch(int nIndex) const
|
||||
std::vector<uint256> GetMerkleBranch(int nIndex) const
|
||||
{
|
||||
if (vMerkleTree.empty())
|
||||
BuildMerkleTree();
|
||||
vector<uint256> vMerkleBranch;
|
||||
std::vector<uint256> vMerkleBranch;
|
||||
int j = 0;
|
||||
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
|
||||
{
|
||||
int i = min(nIndex^1, nSize-1);
|
||||
int i = std::min(nIndex^1, nSize-1);
|
||||
vMerkleBranch.push_back(vMerkleTree[j+i]);
|
||||
nIndex >>= 1;
|
||||
j += nSize;
|
||||
@@ -1126,11 +1260,11 @@ public:
|
||||
return vMerkleBranch;
|
||||
}
|
||||
|
||||
static uint256 CheckMerkleBranch(uint256 hash, const vector<uint256>& vMerkleBranch, int nIndex)
|
||||
static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex)
|
||||
{
|
||||
if (nIndex == -1)
|
||||
return 0;
|
||||
foreach(const uint256& otherside, vMerkleBranch)
|
||||
BOOST_FOREACH(const uint256& otherside, vMerkleBranch)
|
||||
{
|
||||
if (nIndex & 1)
|
||||
hash = Hash(BEGIN(otherside), END(otherside), BEGIN(hash), END(hash));
|
||||
@@ -1361,7 +1495,7 @@ public:
|
||||
for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
|
||||
*(--pbegin) = pindex->GetBlockTime();
|
||||
|
||||
sort(pbegin, pend);
|
||||
std::sort(pbegin, pend);
|
||||
return pbegin[(pend - pbegin)/2];
|
||||
}
|
||||
|
||||
@@ -1379,7 +1513,7 @@ public:
|
||||
|
||||
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
return strprintf("CBlockIndex(nprev=%08x, pnext=%08x, nFile=%d, nBlockPos=%-6d nHeight=%d, merkle=%s, hashBlock=%s)",
|
||||
pprev, pnext, nFile, nBlockPos, nHeight,
|
||||
@@ -1448,9 +1582,9 @@ public:
|
||||
}
|
||||
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
string str = "CDiskBlockIndex(";
|
||||
std::string str = "CDiskBlockIndex(";
|
||||
str += CBlockIndex::ToString();
|
||||
str += strprintf("\n hashBlock=%s, hashPrev=%s, hashNext=%s)",
|
||||
GetBlockHash().ToString().c_str(),
|
||||
@@ -1480,7 +1614,7 @@ public:
|
||||
class CBlockLocator
|
||||
{
|
||||
protected:
|
||||
vector<uint256> vHave;
|
||||
std::vector<uint256> vHave;
|
||||
public:
|
||||
|
||||
CBlockLocator()
|
||||
@@ -1494,7 +1628,7 @@ public:
|
||||
|
||||
explicit CBlockLocator(uint256 hashBlock)
|
||||
{
|
||||
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
|
||||
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
|
||||
if (mi != mapBlockIndex.end())
|
||||
Set((*mi).second);
|
||||
}
|
||||
@@ -1538,9 +1672,9 @@ public:
|
||||
// Retrace how far back it was in the sender's branch
|
||||
int nDistance = 0;
|
||||
int nStep = 1;
|
||||
foreach(const uint256& hash, vHave)
|
||||
BOOST_FOREACH(const uint256& hash, vHave)
|
||||
{
|
||||
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
if (mi != mapBlockIndex.end())
|
||||
{
|
||||
CBlockIndex* pindex = (*mi).second;
|
||||
@@ -1557,9 +1691,9 @@ public:
|
||||
CBlockIndex* GetBlockIndex()
|
||||
{
|
||||
// Find the first block the caller has in the main chain
|
||||
foreach(const uint256& hash, vHave)
|
||||
BOOST_FOREACH(const uint256& hash, vHave)
|
||||
{
|
||||
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
if (mi != mapBlockIndex.end())
|
||||
{
|
||||
CBlockIndex* pindex = (*mi).second;
|
||||
@@ -1573,9 +1707,9 @@ public:
|
||||
uint256 GetBlockHash()
|
||||
{
|
||||
// Find the first block the caller has in the main chain
|
||||
foreach(const uint256& hash, vHave)
|
||||
BOOST_FOREACH(const uint256& hash, vHave)
|
||||
{
|
||||
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
|
||||
if (mi != mapBlockIndex.end())
|
||||
{
|
||||
CBlockIndex* pindex = (*mi).second;
|
||||
@@ -1609,7 +1743,7 @@ public:
|
||||
CPrivKey vchPrivKey;
|
||||
int64 nTimeCreated;
|
||||
int64 nTimeExpires;
|
||||
string strComment;
|
||||
std::string strComment;
|
||||
//// todo: add something to note what created it (user, getnewaddress, change)
|
||||
//// maybe should have a map<string, string> property map
|
||||
|
||||
@@ -1642,7 +1776,7 @@ public:
|
||||
class CAccount
|
||||
{
|
||||
public:
|
||||
vector<unsigned char> vchPubKey;
|
||||
std::vector<unsigned char> vchPubKey;
|
||||
|
||||
CAccount()
|
||||
{
|
||||
@@ -1671,11 +1805,11 @@ public:
|
||||
class CAccountingEntry
|
||||
{
|
||||
public:
|
||||
string strAccount;
|
||||
std::string strAccount;
|
||||
int64 nCreditDebit;
|
||||
int64 nTime;
|
||||
string strOtherAccount;
|
||||
string strComment;
|
||||
std::string strOtherAccount;
|
||||
std::string strComment;
|
||||
|
||||
CAccountingEntry()
|
||||
{
|
||||
@@ -1726,16 +1860,16 @@ public:
|
||||
int64 nExpiration;
|
||||
int nID;
|
||||
int nCancel;
|
||||
set<int> setCancel;
|
||||
std::set<int> setCancel;
|
||||
int nMinVer; // lowest version inclusive
|
||||
int nMaxVer; // highest version inclusive
|
||||
set<string> setSubVer; // empty matches all
|
||||
std::set<std::string> setSubVer; // empty matches all
|
||||
int nPriority;
|
||||
|
||||
// Actions
|
||||
string strComment;
|
||||
string strStatusBar;
|
||||
string strReserved;
|
||||
std::string strComment;
|
||||
std::string strStatusBar;
|
||||
std::string strReserved;
|
||||
|
||||
IMPLEMENT_SERIALIZE
|
||||
(
|
||||
@@ -1774,13 +1908,13 @@ public:
|
||||
strReserved.clear();
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
string strSetCancel;
|
||||
foreach(int n, setCancel)
|
||||
std::string strSetCancel;
|
||||
BOOST_FOREACH(int n, setCancel)
|
||||
strSetCancel += strprintf("%d ", n);
|
||||
string strSetSubVer;
|
||||
foreach(string str, setSubVer)
|
||||
std::string strSetSubVer;
|
||||
BOOST_FOREACH(std::string str, setSubVer)
|
||||
strSetSubVer += "\"" + str + "\" ";
|
||||
return strprintf(
|
||||
"CAlert(\n"
|
||||
@@ -1820,8 +1954,8 @@ public:
|
||||
class CAlert : public CUnsignedAlert
|
||||
{
|
||||
public:
|
||||
vector<unsigned char> vchMsg;
|
||||
vector<unsigned char> vchSig;
|
||||
std::vector<unsigned char> vchMsg;
|
||||
std::vector<unsigned char> vchSig;
|
||||
|
||||
CAlert()
|
||||
{
|
||||
@@ -1863,7 +1997,7 @@ public:
|
||||
return (alert.nID <= nCancel || setCancel.count(alert.nID));
|
||||
}
|
||||
|
||||
bool AppliesTo(int nVersion, string strSubVerIn) const
|
||||
bool AppliesTo(int nVersion, std::string strSubVerIn) const
|
||||
{
|
||||
return (IsInEffect() &&
|
||||
nMinVer <= nVersion && nVersion <= nMaxVer &&
|
||||
@@ -1919,11 +2053,13 @@ public:
|
||||
|
||||
|
||||
|
||||
extern map<uint256, CTransaction> mapTransactions;
|
||||
extern map<uint256, CWalletTx> mapWallet;
|
||||
extern vector<uint256> vWalletUpdated;
|
||||
extern std::map<uint256, CTransaction> mapTransactions;
|
||||
extern std::map<uint256, CWalletTx> mapWallet;
|
||||
extern std::vector<uint256> vWalletUpdated;
|
||||
extern CCriticalSection cs_mapWallet;
|
||||
extern map<vector<unsigned char>, CPrivKey> mapKeys;
|
||||
extern map<uint160, vector<unsigned char> > mapPubKeys;
|
||||
extern std::map<std::vector<unsigned char>, CPrivKey> mapKeys;
|
||||
extern std::map<uint160, std::vector<unsigned char> > mapPubKeys;
|
||||
extern CCriticalSection cs_mapKeys;
|
||||
extern CKey keyUser;
|
||||
|
||||
#endif
|
||||
@@ -2,18 +2,19 @@
|
||||
# Distributed under the MIT/X11 software license, see the accompanying
|
||||
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
USE_UPNP:=0
|
||||
|
||||
INCLUDEPATHS= \
|
||||
-I"C:\boost-1.43.0-mgw" \
|
||||
-I"C:\db-4.7.25.NC-mgw\build_unix" \
|
||||
-I"C:\openssl-1.0.0c-mgw\include" \
|
||||
-I"C:\openssl-1.0.0d-mgw\include" \
|
||||
-I"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib\mswud" \
|
||||
-I"C:\wxWidgets-2.9.1-mgw\include"
|
||||
|
||||
LIBPATHS= \
|
||||
-L"C:\boost-1.43.0-mgw\stage\lib" \
|
||||
-L"C:\db-4.7.25.NC-mgw\build_unix" \
|
||||
-L"C:\openssl-1.0.0c-mgw" \
|
||||
-L"C:\openssl-1.0.0d-mgw" \
|
||||
-L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib"
|
||||
|
||||
WXLIBS= \
|
||||
@@ -25,15 +26,24 @@ LIBS= \
|
||||
-l boost_program_options-mgw45-mt-s-1_43 \
|
||||
-l boost_thread-mgw45-mt-s-1_43 \
|
||||
-l db_cxx \
|
||||
-l eay32 \
|
||||
-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
|
||||
-l ssl \
|
||||
-l crypto
|
||||
|
||||
DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH
|
||||
DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
|
||||
DEBUGFLAGS=-g -D__WXDEBUG__
|
||||
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
|
||||
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
|
||||
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
|
||||
|
||||
ifdef USE_UPNP
|
||||
INCLUDEPATHS += -I"C:\upnpc-exe-win32-20110215"
|
||||
LIBPATHS += -L"C:\upnpc-exe-win32-20110215"
|
||||
LIBS += -l miniupnpc -l iphlpapi
|
||||
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
|
||||
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 \
|
||||
@@ -56,7 +66,7 @@ obj/%.o: %.cpp $(HEADERS)
|
||||
cryptopp/obj/%.o: cryptopp/%.cpp
|
||||
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -o $@ $<
|
||||
|
||||
obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
|
||||
obj/ui_res.o: ../share/ui.rc ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
|
||||
windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
|
||||
|
||||
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
|
||||
@@ -16,6 +16,8 @@ LIBPATHS= \
|
||||
|
||||
WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
|
||||
|
||||
USE_UPNP:=0
|
||||
|
||||
LIBS= -dead_strip \
|
||||
$(DEPSDIR)/lib/libdb_cxx-4.8.a \
|
||||
$(DEPSDIR)/lib/libboost_system.a \
|
||||
@@ -44,6 +46,11 @@ OBJS= \
|
||||
obj/init.o \
|
||||
cryptopp/obj/sha.o \
|
||||
cryptopp/obj/cpu.o
|
||||
|
||||
ifdef USE_UPNP
|
||||
LIBS += $(DEPSDIR)/lib/libminiupnpc.a
|
||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
||||
endif
|
||||
|
||||
|
||||
all: bitcoin
|
||||
@@ -2,18 +2,15 @@
|
||||
# Distributed under the MIT/X11 software license, see the accompanying
|
||||
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
CXX=g++
|
||||
|
||||
INCLUDEPATHS= \
|
||||
-I"/usr/local/include/wx-2.9" \
|
||||
-I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
|
||||
WXINCLUDEPATHS=$(shell wx-config --cxxflags)
|
||||
|
||||
# for wxWidgets 2.9.1, add -l Xxf86vm
|
||||
WXLIBS= \
|
||||
-Wl,-Bstatic \
|
||||
-l wx_gtk2ud-2.9 \
|
||||
-Wl,-Bdynamic \
|
||||
-l gtk-x11-2.0 \
|
||||
-l SM
|
||||
WXLIBS=$(shell wx-config --libs)
|
||||
|
||||
USE_UPNP:=0
|
||||
|
||||
DEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
|
||||
|
||||
# for boost 1.37, add -mt to the boost libraries
|
||||
LIBS= \
|
||||
@@ -24,15 +21,23 @@ LIBS= \
|
||||
-l boost_thread \
|
||||
-l db_cxx \
|
||||
-l ssl \
|
||||
-l crypto \
|
||||
-l crypto
|
||||
|
||||
ifdef USE_UPNP
|
||||
LIBS += -l miniupnpc
|
||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
||||
endif
|
||||
|
||||
LIBS+= \
|
||||
-Wl,-Bdynamic \
|
||||
-l gthread-2.0 \
|
||||
-l z \
|
||||
-l dl
|
||||
-l dl \
|
||||
-l pthread
|
||||
|
||||
|
||||
DEFS=-D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL
|
||||
DEBUGFLAGS=-g -D__WXDEBUG__
|
||||
CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
|
||||
CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
|
||||
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
|
||||
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
|
||||
|
||||
@@ -53,23 +58,20 @@ all: bitcoin
|
||||
|
||||
|
||||
obj/%.o: %.cpp $(HEADERS)
|
||||
g++ -c $(CFLAGS) -DGUI -o $@ $<
|
||||
$(CXX) -c $(CXXFLAGS) $(WXINCLUDEPATHS) -DGUI -o $@ $<
|
||||
|
||||
cryptopp/obj/%.o: cryptopp/%.cpp
|
||||
g++ -c $(CFLAGS) -O3 -o $@ $<
|
||||
$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
|
||||
|
||||
obj/sha256.o: sha256.cpp
|
||||
g++ -c $(CFLAGS) -msse2 -O3 -march=amdfam10 -o $@ $<
|
||||
|
||||
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
|
||||
g++ $(CFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
|
||||
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
|
||||
$(CXX) $(CXXFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
|
||||
|
||||
|
||||
obj/nogui/%.o: %.cpp $(HEADERS)
|
||||
g++ -c $(CFLAGS) -o $@ $<
|
||||
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
||||
|
||||
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha256.o
|
||||
g++ $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
bitcoind: $(OBJS:obj/%=obj/nogui/%)
|
||||
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
|
||||
clean:
|
||||
@@ -77,3 +79,5 @@ clean:
|
||||
-rm -f obj/nogui/*.o
|
||||
-rm -f cryptopp/obj/*.o
|
||||
-rm -f headers.h.gch
|
||||
-rm -f bitcoin
|
||||
-rm -f bitcoind
|
||||
@@ -4,11 +4,24 @@
|
||||
|
||||
#include "headers.h"
|
||||
|
||||
#ifdef USE_UPNP
|
||||
#include <miniupnpc/miniwget.h>
|
||||
#include <miniupnpc/miniupnpc.h>
|
||||
#include <miniupnpc/upnpcommands.h>
|
||||
#include <miniupnpc/upnperrors.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
static const int MAX_OUTBOUND_CONNECTIONS = 8;
|
||||
|
||||
void ThreadMessageHandler2(void* parg);
|
||||
void ThreadSocketHandler2(void* parg);
|
||||
void ThreadOpenConnections2(void* parg);
|
||||
#ifdef USE_UPNP
|
||||
void ThreadMapPort2(void* parg);
|
||||
#endif
|
||||
bool OpenNetworkConnection(const CAddress& addrConnect);
|
||||
|
||||
|
||||
@@ -19,8 +32,9 @@ bool OpenNetworkConnection(const CAddress& addrConnect);
|
||||
// Global state variables
|
||||
//
|
||||
bool fClient = false;
|
||||
bool fAllowDNS = false;
|
||||
uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
|
||||
CAddress addrLocalHost(0, 0, nLocalServices);
|
||||
CAddress addrLocalHost("0.0.0.0", 0, false, nLocalServices);
|
||||
CNode* pnodeLocalHost = NULL;
|
||||
uint64 nLocalHostNonce = 0;
|
||||
array<int, 10> vnThreadsRunning;
|
||||
@@ -37,11 +51,16 @@ map<CInv, int64> mapAlreadyAskedFor;
|
||||
|
||||
// Settings
|
||||
int fUseProxy = false;
|
||||
CAddress addrProxy("127.0.0.1:9050");
|
||||
int nConnectTimeout = 5000;
|
||||
CAddress addrProxy("127.0.0.1",9050);
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned short GetListenPort()
|
||||
{
|
||||
return (unsigned short)(GetArg("-port", GetDefaultPort()));
|
||||
}
|
||||
|
||||
void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd)
|
||||
{
|
||||
@@ -58,7 +77,7 @@ void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd)
|
||||
|
||||
|
||||
|
||||
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
|
||||
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout)
|
||||
{
|
||||
hSocketRet = INVALID_SOCKET;
|
||||
|
||||
@@ -70,11 +89,89 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
|
||||
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
|
||||
#endif
|
||||
|
||||
bool fRoutable = !(addrConnect.GetByte(3) == 10 || (addrConnect.GetByte(3) == 192 && addrConnect.GetByte(2) == 168));
|
||||
bool fProxy = (fUseProxy && fRoutable);
|
||||
bool fProxy = (fUseProxy && addrConnect.IsRoutable());
|
||||
struct sockaddr_in sockaddr = (fProxy ? addrProxy.GetSockAddr() : addrConnect.GetSockAddr());
|
||||
|
||||
#ifdef __WXMSW__
|
||||
u_long fNonblock = 1;
|
||||
if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR)
|
||||
#else
|
||||
int fFlags = fcntl(hSocket, F_GETFL, 0);
|
||||
if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == -1)
|
||||
#endif
|
||||
{
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (connect(hSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
// WSAEINVAL is here because some legacy version of winsock uses it
|
||||
if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL)
|
||||
{
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = nTimeout / 1000;
|
||||
timeout.tv_usec = (nTimeout % 1000) * 1000;
|
||||
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(hSocket, &fdset);
|
||||
int nRet = select(hSocket + 1, NULL, &fdset, NULL, &timeout);
|
||||
if (nRet == 0)
|
||||
{
|
||||
printf("connection timeout\n");
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
printf("select() for connection failed: %i\n",WSAGetLastError());
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
socklen_t nRetSize = sizeof(nRet);
|
||||
#ifdef __WXMSW__
|
||||
if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, (char*)(&nRet), &nRetSize) == SOCKET_ERROR)
|
||||
#else
|
||||
if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR)
|
||||
#endif
|
||||
{
|
||||
printf("getsockopt() for connection failed: %i\n",WSAGetLastError());
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
if (nRet != 0)
|
||||
{
|
||||
printf("connect() failed after select(): %i\n",nRet);
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#ifdef __WXMSW__
|
||||
else if (WSAGetLastError() != WSAEISCONN)
|
||||
#else
|
||||
else
|
||||
#endif
|
||||
{
|
||||
printf("connect() failed: %s\n",WSAGetLastError());
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
this isn't even strictly necessary
|
||||
CNode::ConnectNode immediately turns the socket back to non-blocking
|
||||
but we'll turn it back to blocking just in case
|
||||
*/
|
||||
#ifdef __WXMSW__
|
||||
fNonblock = 0;
|
||||
if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR)
|
||||
#else
|
||||
fFlags = fcntl(hSocket, F_GETFL, 0);
|
||||
if (fcntl(hSocket, F_SETFL, fFlags & !O_NONBLOCK) == SOCKET_ERROR)
|
||||
#endif
|
||||
{
|
||||
closesocket(hSocket);
|
||||
return false;
|
||||
@@ -82,7 +179,7 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
|
||||
|
||||
if (fProxy)
|
||||
{
|
||||
printf("proxy connecting %s\n", addrConnect.ToStringLog().c_str());
|
||||
printf("proxy connecting %s\n", addrConnect.ToString().c_str());
|
||||
char pszSocks4IP[] = "\4\1\0\0\0\0\0\0user";
|
||||
memcpy(pszSocks4IP + 2, &addrConnect.port, 2);
|
||||
memcpy(pszSocks4IP + 4, &addrConnect.ip, 4);
|
||||
@@ -108,14 +205,83 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
|
||||
printf("ERROR: Proxy returned error %d\n", pchRet[1]);
|
||||
return false;
|
||||
}
|
||||
printf("proxy connected %s\n", addrConnect.ToStringLog().c_str());
|
||||
printf("proxy connected %s\n", addrConnect.ToString().c_str());
|
||||
}
|
||||
|
||||
hSocketRet = hSocket;
|
||||
return true;
|
||||
}
|
||||
|
||||
// portDefault is in host order
|
||||
bool Lookup(const char *pszName, vector<CAddress>& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup, int portDefault, bool fAllowPort)
|
||||
{
|
||||
vaddr.clear();
|
||||
if (pszName[0] == 0)
|
||||
return false;
|
||||
int port = portDefault;
|
||||
char psz[256];
|
||||
char *pszHost = psz;
|
||||
strlcpy(psz, pszName, sizeof(psz));
|
||||
if (fAllowPort)
|
||||
{
|
||||
char* pszColon = strrchr(psz+1,':');
|
||||
char *pszPortEnd = NULL;
|
||||
int portParsed = pszColon ? strtoul(pszColon+1, &pszPortEnd, 10) : 0;
|
||||
if (pszColon && pszPortEnd && pszPortEnd[0] == 0)
|
||||
{
|
||||
if (psz[0] == '[' && pszColon[-1] == ']')
|
||||
{
|
||||
// Future: enable IPv6 colon-notation inside []
|
||||
pszHost = psz+1;
|
||||
pszColon[-1] = 0;
|
||||
}
|
||||
else
|
||||
pszColon[0] = 0;
|
||||
port = portParsed;
|
||||
if (port < 0 || port > USHRT_MAX)
|
||||
port = USHRT_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int addrIP = inet_addr(pszHost);
|
||||
if (addrIP != INADDR_NONE)
|
||||
{
|
||||
// valid IP address passed
|
||||
vaddr.push_back(CAddress(addrIP, port, nServices));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!fAllowLookup)
|
||||
return false;
|
||||
|
||||
struct hostent* phostent = gethostbyname(pszHost);
|
||||
if (!phostent)
|
||||
return false;
|
||||
|
||||
if (phostent->h_addrtype != AF_INET)
|
||||
return false;
|
||||
|
||||
char** ppAddr = phostent->h_addr_list;
|
||||
while (*ppAddr != NULL && vaddr.size() != nMaxSolutions)
|
||||
{
|
||||
CAddress addr(((struct in_addr*)ppAddr[0])->s_addr, port, nServices);
|
||||
if (addr.IsValid())
|
||||
vaddr.push_back(addr);
|
||||
ppAddr++;
|
||||
}
|
||||
|
||||
return (vaddr.size() > 0);
|
||||
}
|
||||
|
||||
// portDefault is in host order
|
||||
bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup, int portDefault, bool fAllowPort)
|
||||
{
|
||||
vector<CAddress> vaddr;
|
||||
bool fRet = Lookup(pszName, vaddr, nServices, 1, fAllowLookup, portDefault, fAllowPort);
|
||||
if (fRet)
|
||||
addr = vaddr[0];
|
||||
return fRet;
|
||||
}
|
||||
|
||||
bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const char* pszKeyword, unsigned int& ipRet)
|
||||
{
|
||||
@@ -151,7 +317,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
|
||||
strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r"));
|
||||
while (strLine.size() > 0 && isspace(strLine[strLine.size()-1]))
|
||||
strLine.resize(strLine.size()-1);
|
||||
CAddress addr(strLine.c_str());
|
||||
CAddress addr(strLine,0,true);
|
||||
printf("GetMyExternalIP() received [%s] %s\n", strLine.c_str(), addr.ToString().c_str());
|
||||
if (addr.ip == 0 || addr.ip == INADDR_NONE || !addr.IsRoutable())
|
||||
return false;
|
||||
@@ -182,13 +348,13 @@ bool GetMyExternalIP(unsigned int& ipRet)
|
||||
// <?php echo $_SERVER["REMOTE_ADDR"]; ?>
|
||||
if (nHost == 1)
|
||||
{
|
||||
addrConnect = CAddress("91.198.22.70:80"); // checkip.dyndns.org
|
||||
addrConnect = CAddress("91.198.22.70",80); // checkip.dyndns.org
|
||||
|
||||
if (nLookup == 1)
|
||||
{
|
||||
struct hostent* phostent = gethostbyname("checkip.dyndns.org");
|
||||
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
|
||||
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
|
||||
CAddress addrIP("checkip.dyndns.org", 80, true);
|
||||
if (addrIP.IsValid())
|
||||
addrConnect = addrIP;
|
||||
}
|
||||
|
||||
pszGet = "GET / HTTP/1.1\r\n"
|
||||
@@ -201,13 +367,13 @@ bool GetMyExternalIP(unsigned int& ipRet)
|
||||
}
|
||||
else if (nHost == 2)
|
||||
{
|
||||
addrConnect = CAddress("74.208.43.192:80"); // www.showmyip.com
|
||||
addrConnect = CAddress("74.208.43.192", 80); // www.showmyip.com
|
||||
|
||||
if (nLookup == 1)
|
||||
{
|
||||
struct hostent* phostent = gethostbyname("www.showmyip.com");
|
||||
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
|
||||
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
|
||||
CAddress addrIP("www.showmyip.com", 80, true);
|
||||
if (addrIP.IsValid())
|
||||
addrConnect = addrIP;
|
||||
}
|
||||
|
||||
pszGet = "GET /simple/ HTTP/1.1\r\n"
|
||||
@@ -250,7 +416,7 @@ void ThreadGetMyExternalIP(void* parg)
|
||||
CAddress addr(addrLocalHost);
|
||||
addr.nTime = GetAdjustedTime();
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
pnode->PushAddress(addr);
|
||||
}
|
||||
}
|
||||
@@ -273,7 +439,7 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
|
||||
if (it == mapAddresses.end())
|
||||
{
|
||||
// New address
|
||||
printf("AddAddress(%s)\n", addr.ToStringLog().c_str());
|
||||
printf("AddAddress(%s)\n", addr.ToString().c_str());
|
||||
mapAddresses.insert(make_pair(addr.GetKey(), addr));
|
||||
CAddrDB().WriteAddress(addr);
|
||||
return true;
|
||||
@@ -334,7 +500,7 @@ void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1)
|
||||
// call this in the destructor so it doesn't get called after it's deleted.
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
{
|
||||
CRITICAL_BLOCK(pnode->cs_mapRequests)
|
||||
{
|
||||
@@ -371,7 +537,7 @@ bool AnySubscribed(unsigned int nChannel)
|
||||
if (pnodeLocalHost->IsSubscribed(nChannel))
|
||||
return true;
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode->IsSubscribed(nChannel))
|
||||
return true;
|
||||
return false;
|
||||
@@ -393,7 +559,7 @@ void CNode::Subscribe(unsigned int nChannel, unsigned int nHops)
|
||||
{
|
||||
// Relay subscribe
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode != this)
|
||||
pnode->PushMessage("subscribe", nChannel, nHops);
|
||||
}
|
||||
@@ -415,7 +581,7 @@ void CNode::CancelSubscribe(unsigned int nChannel)
|
||||
{
|
||||
// Relay subscription cancel
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode != this)
|
||||
pnode->PushMessage("sub-cancel", nChannel);
|
||||
}
|
||||
@@ -433,7 +599,7 @@ CNode* FindNode(unsigned int ip)
|
||||
{
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode->addr.ip == ip)
|
||||
return (pnode);
|
||||
}
|
||||
@@ -444,7 +610,7 @@ CNode* FindNode(CAddress addr)
|
||||
{
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode->addr == addr)
|
||||
return (pnode);
|
||||
}
|
||||
@@ -469,7 +635,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout)
|
||||
|
||||
/// debug print
|
||||
printf("trying connection %s lastseen=%.1fhrs lasttry=%.1fhrs\n",
|
||||
addrConnect.ToStringLog().c_str(),
|
||||
addrConnect.ToString().c_str(),
|
||||
(double)(addrConnect.nTime - GetAdjustedTime())/3600.0,
|
||||
(double)(addrConnect.nLastTry - GetAdjustedTime())/3600.0);
|
||||
|
||||
@@ -481,7 +647,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout)
|
||||
if (ConnectSocket(addrConnect, hSocket))
|
||||
{
|
||||
/// debug print
|
||||
printf("connected %s\n", addrConnect.ToStringLog().c_str());
|
||||
printf("connected %s\n", addrConnect.ToString().c_str());
|
||||
|
||||
// Set to nonblocking
|
||||
#ifdef __WXMSW__
|
||||
@@ -518,7 +684,7 @@ void CNode::CloseSocketDisconnect()
|
||||
{
|
||||
if (fDebug)
|
||||
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
|
||||
printf("disconnecting node %s\n", addr.ToStringLog().c_str());
|
||||
printf("disconnecting node %s\n", addr.ToString().c_str());
|
||||
closesocket(hSocket);
|
||||
hSocket = INVALID_SOCKET;
|
||||
}
|
||||
@@ -581,7 +747,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
{
|
||||
// Disconnect unused nodes
|
||||
vector<CNode*> vNodesCopy = vNodes;
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
{
|
||||
if (pnode->fDisconnect ||
|
||||
(pnode->GetRefCount() <= 0 && pnode->vRecv.empty() && pnode->vSend.empty()))
|
||||
@@ -603,7 +769,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
|
||||
// Delete disconnected nodes
|
||||
list<CNode*> vNodesDisconnectedCopy = vNodesDisconnected;
|
||||
foreach(CNode* pnode, vNodesDisconnectedCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesDisconnectedCopy)
|
||||
{
|
||||
// wait until threads are done using it
|
||||
if (pnode->GetRefCount() <= 0)
|
||||
@@ -649,7 +815,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
hSocketMax = max(hSocketMax, hListenSocket);
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
{
|
||||
if (pnode->hSocket == INVALID_SOCKET || pnode->hSocket < 0)
|
||||
continue;
|
||||
@@ -670,9 +836,12 @@ void ThreadSocketHandler2(void* parg)
|
||||
if (nSelect == SOCKET_ERROR)
|
||||
{
|
||||
int nErr = WSAGetLastError();
|
||||
printf("socket select error %d\n", nErr);
|
||||
for (int i = 0; i <= hSocketMax; i++)
|
||||
FD_SET(i, &fdsetRecv);
|
||||
if (hSocketMax > -1)
|
||||
{
|
||||
printf("socket select error %d\n", nErr);
|
||||
for (int i = 0; i <= hSocketMax; i++)
|
||||
FD_SET(i, &fdsetRecv);
|
||||
}
|
||||
FD_ZERO(&fdsetSend);
|
||||
FD_ZERO(&fdsetError);
|
||||
Sleep(timeout.tv_usec/1000);
|
||||
@@ -691,7 +860,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
int nInbound = 0;
|
||||
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode->fInbound)
|
||||
nInbound++;
|
||||
if (hSocket == INVALID_SOCKET)
|
||||
@@ -705,7 +874,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("accepted connection %s\n", addr.ToStringLog().c_str());
|
||||
printf("accepted connection %s\n", addr.ToString().c_str());
|
||||
CNode* pnode = new CNode(hSocket, addr, true);
|
||||
pnode->AddRef();
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
@@ -721,10 +890,10 @@ void ThreadSocketHandler2(void* parg)
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
vNodesCopy = vNodes;
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
pnode->AddRef();
|
||||
}
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
{
|
||||
if (fShutdown)
|
||||
return;
|
||||
@@ -741,7 +910,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
CDataStream& vRecv = pnode->vRecv;
|
||||
unsigned int nPos = vRecv.size();
|
||||
|
||||
if (nPos > 1000*GetArg("-maxreceivebuffer", 2*1000)) {
|
||||
if (nPos > 1000*GetArg("-maxreceivebuffer", 10*1000)) {
|
||||
if (!pnode->fDisconnect)
|
||||
printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size());
|
||||
pnode->CloseSocketDisconnect();
|
||||
@@ -806,7 +975,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
pnode->CloseSocketDisconnect();
|
||||
}
|
||||
}
|
||||
if (vSend.size() > 1000*GetArg("-maxsendbuffer", 256)) {
|
||||
if (vSend.size() > 1000*GetArg("-maxsendbuffer", 10*1000)) {
|
||||
if (!pnode->fDisconnect)
|
||||
printf("socket send flood control disconnect (%d bytes)\n", vSend.size());
|
||||
pnode->CloseSocketDisconnect();
|
||||
@@ -841,7 +1010,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
}
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
pnode->Release();
|
||||
}
|
||||
|
||||
@@ -857,7 +1026,140 @@ void ThreadSocketHandler2(void* parg)
|
||||
|
||||
|
||||
|
||||
#ifdef USE_UPNP
|
||||
void ThreadMapPort(void* parg)
|
||||
{
|
||||
IMPLEMENT_RANDOMIZE_STACK(ThreadMapPort(parg));
|
||||
try
|
||||
{
|
||||
vnThreadsRunning[5]++;
|
||||
ThreadMapPort2(parg);
|
||||
vnThreadsRunning[5]--;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
vnThreadsRunning[5]--;
|
||||
PrintException(&e, "ThreadMapPort()");
|
||||
} catch (...) {
|
||||
vnThreadsRunning[5]--;
|
||||
PrintException(NULL, "ThreadMapPort()");
|
||||
}
|
||||
printf("ThreadMapPort exiting\n");
|
||||
}
|
||||
|
||||
void ThreadMapPort2(void* parg)
|
||||
{
|
||||
printf("ThreadMapPort started\n");
|
||||
|
||||
char port[6];
|
||||
sprintf(port, "%d", GetListenPort());
|
||||
|
||||
const char * rootdescurl = 0;
|
||||
const char * multicastif = 0;
|
||||
const char * minissdpdpath = 0;
|
||||
struct UPNPDev * devlist = 0;
|
||||
char lanaddr[64];
|
||||
|
||||
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);
|
||||
|
||||
struct UPNPUrls urls;
|
||||
struct IGDdatas data;
|
||||
int r;
|
||||
|
||||
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
|
||||
if (r == 1)
|
||||
{
|
||||
char intClient[16];
|
||||
char intPort[6];
|
||||
|
||||
#ifndef __WXMSW__
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
|
||||
port, port, lanaddr, 0, "TCP", 0);
|
||||
#else
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
|
||||
port, port, lanaddr, 0, "TCP", 0, "0");
|
||||
#endif
|
||||
if(r!=UPNPCOMMAND_SUCCESS)
|
||||
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
|
||||
port, port, lanaddr, r, strupnperror(r));
|
||||
else
|
||||
printf("UPnP Port Mapping successful.\n");
|
||||
loop {
|
||||
if (fShutdown || !fUseUPnP)
|
||||
{
|
||||
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port, "TCP", 0);
|
||||
printf("UPNP_DeletePortMapping() returned : %d\n", r);
|
||||
freeUPNPDevlist(devlist); devlist = 0;
|
||||
FreeUPNPUrls(&urls);
|
||||
return;
|
||||
}
|
||||
Sleep(2000);
|
||||
}
|
||||
} else {
|
||||
printf("No valid UPnP IGDs found\n");
|
||||
freeUPNPDevlist(devlist); devlist = 0;
|
||||
if (r != 0)
|
||||
FreeUPNPUrls(&urls);
|
||||
loop {
|
||||
if (fShutdown || !fUseUPnP)
|
||||
return;
|
||||
Sleep(2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MapPort(bool fMapPort)
|
||||
{
|
||||
if (fUseUPnP != fMapPort)
|
||||
{
|
||||
fUseUPnP = fMapPort;
|
||||
CWalletDB().WriteSetting("fUseUPnP", fUseUPnP);
|
||||
}
|
||||
if (fUseUPnP && vnThreadsRunning[5] < 1)
|
||||
{
|
||||
if (!CreateThread(ThreadMapPort, NULL))
|
||||
printf("Error: ThreadMapPort(ThreadMapPort) failed\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static const char *strDNSSeed[] = {
|
||||
"bitseed.xf2.org",
|
||||
"bitseed.bitcoin.org.uk",
|
||||
};
|
||||
|
||||
void DNSAddressSeed()
|
||||
{
|
||||
int found = 0;
|
||||
|
||||
printf("Loading addresses from DNS seeds (could take a while)\n");
|
||||
|
||||
for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
|
||||
vector<CAddress> vaddr;
|
||||
if (Lookup(strDNSSeed[seed_idx], vaddr, NODE_NETWORK, -1, true))
|
||||
{
|
||||
BOOST_FOREACH (CAddress& addr, vaddr)
|
||||
{
|
||||
if (addr.GetByte(3) != 127)
|
||||
{
|
||||
addr.nTime = 0;
|
||||
AddAddress(addr);
|
||||
found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("%d addresses found from DNS seeds\n", found);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -935,9 +1237,9 @@ void ThreadOpenConnections2(void* parg)
|
||||
{
|
||||
for (int64 nLoop = 0;; nLoop++)
|
||||
{
|
||||
foreach(string strAddr, mapMultiArgs["-connect"])
|
||||
BOOST_FOREACH(string strAddr, mapMultiArgs["-connect"])
|
||||
{
|
||||
CAddress addr(strAddr, NODE_NETWORK);
|
||||
CAddress addr(strAddr, fAllowDNS);
|
||||
if (addr.IsValid())
|
||||
OpenNetworkConnection(addr);
|
||||
for (int i = 0; i < 10 && i < nLoop; i++)
|
||||
@@ -953,9 +1255,9 @@ void ThreadOpenConnections2(void* parg)
|
||||
// Connect to manually added nodes first
|
||||
if (mapArgs.count("-addnode"))
|
||||
{
|
||||
foreach(string strAddr, mapMultiArgs["-addnode"])
|
||||
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
|
||||
{
|
||||
CAddress addr(strAddr, NODE_NETWORK);
|
||||
CAddress addr(strAddr, fAllowDNS);
|
||||
if (addr.IsValid())
|
||||
{
|
||||
OpenNetworkConnection(addr);
|
||||
@@ -977,7 +1279,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
{
|
||||
int nOutbound = 0;
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (!pnode->fInbound)
|
||||
nOutbound++;
|
||||
int nMaxOutboundConnections = MAX_OUTBOUND_CONNECTIONS;
|
||||
@@ -1020,7 +1322,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
{
|
||||
nSeedDisconnected = GetTime();
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (setSeed.count(pnode->addr.ip))
|
||||
pnode->fDisconnect = true;
|
||||
}
|
||||
@@ -1028,7 +1330,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
// Keep setting timestamps to 0 so they won't reconnect
|
||||
if (GetTime() - nSeedDisconnected < 60 * 60)
|
||||
{
|
||||
foreach(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
|
||||
BOOST_FOREACH(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
|
||||
{
|
||||
if (setSeed.count(item.second.ip) && item.second.nTime != 0)
|
||||
{
|
||||
@@ -1051,12 +1353,12 @@ void ThreadOpenConnections2(void* parg)
|
||||
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.
|
||||
set<unsigned int> setConnected;
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
setConnected.insert(pnode->addr.ip & 0x0000ffff);
|
||||
|
||||
CRITICAL_BLOCK(cs_mapAddresses)
|
||||
{
|
||||
foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
|
||||
BOOST_FOREACH(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
|
||||
{
|
||||
const CAddress& addr = item.second;
|
||||
if (!addr.IsIPv4() || !addr.IsValid() || setConnected.count(addr.ip & 0x0000ffff))
|
||||
@@ -1066,7 +1368,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
|
||||
// Randomize the order in a deterministic way, putting the standard port first
|
||||
int64 nRandomizer = (uint64)(nStart * 4951 + addr.nLastTry * 9567851 + addr.ip * 7789) % (2 * 60 * 60);
|
||||
if (addr.port != GetDefaultPort())
|
||||
if (addr.port != htons(GetDefaultPort()))
|
||||
nRandomizer += 2 * 60 * 60;
|
||||
|
||||
// Last seen Base retry frequency
|
||||
@@ -1172,7 +1474,7 @@ void ThreadMessageHandler2(void* parg)
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
vNodesCopy = vNodes;
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
pnode->AddRef();
|
||||
}
|
||||
|
||||
@@ -1180,7 +1482,7 @@ void ThreadMessageHandler2(void* parg)
|
||||
CNode* pnodeTrickle = NULL;
|
||||
if (!vNodesCopy.empty())
|
||||
pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())];
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
{
|
||||
// Receive messages
|
||||
TRY_CRITICAL_BLOCK(pnode->cs_vRecv)
|
||||
@@ -1197,7 +1499,7 @@ void ThreadMessageHandler2(void* parg)
|
||||
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
{
|
||||
foreach(CNode* pnode, vNodesCopy)
|
||||
BOOST_FOREACH(CNode* pnode, vNodesCopy)
|
||||
pnode->Release();
|
||||
}
|
||||
|
||||
@@ -1219,14 +1521,11 @@ void ThreadMessageHandler2(void* parg)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool BindListenPort(string& strError)
|
||||
{
|
||||
strError = "";
|
||||
int nOne = 1;
|
||||
addrLocalHost.port = GetDefaultPort();
|
||||
addrLocalHost.port = htons(GetListenPort());
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Initialize Windows Sockets
|
||||
@@ -1278,7 +1577,7 @@ bool BindListenPort(string& strError)
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
sockaddr.sin_family = AF_INET;
|
||||
sockaddr.sin_addr.s_addr = INADDR_ANY; // bind to all IPs on this computer
|
||||
sockaddr.sin_port = GetDefaultPort();
|
||||
sockaddr.sin_port = htons(GetListenPort());
|
||||
if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
int nErr = WSAGetLastError();
|
||||
@@ -1305,29 +1604,21 @@ bool BindListenPort(string& strError)
|
||||
void StartNode(void* parg)
|
||||
{
|
||||
if (pnodeLocalHost == NULL)
|
||||
pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", nLocalServices));
|
||||
pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", 0, false, nLocalServices));
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Get local host ip
|
||||
char pszHostName[1000] = "";
|
||||
if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)
|
||||
{
|
||||
struct hostent* phostent = gethostbyname(pszHostName);
|
||||
if (phostent)
|
||||
{
|
||||
// Take the first IP that isn't loopback 127.x.x.x
|
||||
for (int i = 0; phostent->h_addr_list[i] != NULL; i++)
|
||||
printf("host ip %d: %s\n", i, CAddress(*(unsigned int*)phostent->h_addr_list[i]).ToStringIP().c_str());
|
||||
for (int i = 0; phostent->h_addr_list[i] != NULL; i++)
|
||||
{
|
||||
CAddress addr(*(unsigned int*)phostent->h_addr_list[i], GetDefaultPort(), nLocalServices);
|
||||
if (addr.IsValid() && addr.GetByte(3) != 127)
|
||||
vector<CAddress> vaddr;
|
||||
if (Lookup(pszHostName, vaddr, nLocalServices, -1, true))
|
||||
BOOST_FOREACH (const CAddress &addr, vaddr)
|
||||
if (addr.GetByte(3) != 127)
|
||||
{
|
||||
addrLocalHost = addr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Get local host ip
|
||||
@@ -1348,7 +1639,7 @@ void StartNode(void* parg)
|
||||
printf("ipv4 %s: %s\n", ifa->ifa_name, pszIP);
|
||||
|
||||
// Take the first IP that isn't loopback 127.x.x.x
|
||||
CAddress addr(*(unsigned int*)&s4->sin_addr, GetDefaultPort(), nLocalServices);
|
||||
CAddress addr(*(unsigned int*)&s4->sin_addr, GetListenPort(), nLocalServices);
|
||||
if (addr.IsValid() && addr.GetByte(3) != 127)
|
||||
{
|
||||
addrLocalHost = addr;
|
||||
@@ -1382,6 +1673,10 @@ void StartNode(void* parg)
|
||||
// Start threads
|
||||
//
|
||||
|
||||
// Map ports with UPnP
|
||||
if (fHaveUPnP)
|
||||
MapPort(fUseUPnP);
|
||||
|
||||
// Get addresses from IRC and advertise ours
|
||||
if (!CreateThread(ThreadIRCSeed, NULL))
|
||||
printf("Error: CreateThread(ThreadIRCSeed) failed\n");
|
||||
@@ -1407,7 +1702,11 @@ bool StopNode()
|
||||
fShutdown = true;
|
||||
nTransactionsUpdated++;
|
||||
int64 nStart = GetTime();
|
||||
while (vnThreadsRunning[0] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0)
|
||||
while (vnThreadsRunning[0] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0
|
||||
#ifdef USE_UPNP
|
||||
|| vnThreadsRunning[5] > 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (GetTime() - nStart > 20)
|
||||
break;
|
||||
@@ -1418,6 +1717,7 @@ bool StopNode()
|
||||
if (vnThreadsRunning[2] > 0) printf("ThreadMessageHandler still running\n");
|
||||
if (vnThreadsRunning[3] > 0) printf("ThreadBitcoinMiner still running\n");
|
||||
if (vnThreadsRunning[4] > 0) printf("ThreadRPCServer still running\n");
|
||||
if (fHaveUPnP && vnThreadsRunning[5] > 0) printf("ThreadMapPort still running\n");
|
||||
while (vnThreadsRunning[2] > 0 || vnThreadsRunning[4] > 0)
|
||||
Sleep(20);
|
||||
Sleep(50);
|
||||
@@ -1434,7 +1734,7 @@ public:
|
||||
~CNetCleanup()
|
||||
{
|
||||
// Close sockets
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode->hSocket != INVALID_SOCKET)
|
||||
closesocket(pnode->hSocket);
|
||||
if (hListenSocket != INVALID_SOCKET)
|
||||
@@ -1,6 +1,16 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_NET_H
|
||||
#define BITCOIN_NET_H
|
||||
|
||||
#include <deque>
|
||||
#include <boost/array.hpp>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#ifndef __WXMSW__
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
class CMessageHeader;
|
||||
class CAddress;
|
||||
@@ -9,10 +19,11 @@ class CRequestTracker;
|
||||
class CNode;
|
||||
class CBlockIndex;
|
||||
extern int nBestHeight;
|
||||
extern int nConnectTimeout;
|
||||
|
||||
|
||||
|
||||
inline unsigned short GetDefaultPort() { return fTestNet ? htons(18333) : htons(8333); }
|
||||
inline unsigned short GetDefaultPort() { return fTestNet ? 18333 : 8333; }
|
||||
static const unsigned int PUBLISH_HOPS = 5;
|
||||
enum
|
||||
{
|
||||
@@ -22,7 +33,9 @@ enum
|
||||
|
||||
|
||||
|
||||
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet);
|
||||
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout=nConnectTimeout);
|
||||
bool Lookup(const char *pszName, std::vector<CAddress>& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
|
||||
bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
|
||||
bool GetMyExternalIP(unsigned int& ipRet);
|
||||
bool AddAddress(CAddress addr, int64 nTimePenalty=0);
|
||||
void AddressCurrentlyConnected(const CAddress& addr);
|
||||
@@ -30,7 +43,9 @@ CNode* FindNode(unsigned int ip);
|
||||
CNode* ConnectNode(CAddress addrConnect, int64 nTimeout=0);
|
||||
void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1);
|
||||
bool AnySubscribed(unsigned int nChannel);
|
||||
bool BindListenPort(string& strError=REF(string()));
|
||||
void MapPort(bool fMapPort);
|
||||
void DNSAddressSeed();
|
||||
bool BindListenPort(std::string& strError=REF(std::string()));
|
||||
void StartNode(void* parg);
|
||||
bool StopNode();
|
||||
|
||||
@@ -85,12 +100,12 @@ public:
|
||||
READWRITE(nChecksum);
|
||||
)
|
||||
|
||||
string GetCommand()
|
||||
std::string GetCommand()
|
||||
{
|
||||
if (pchCommand[COMMAND_SIZE-1] == 0)
|
||||
return string(pchCommand, pchCommand + strlen(pchCommand));
|
||||
return std::string(pchCommand, pchCommand + strlen(pchCommand));
|
||||
else
|
||||
return string(pchCommand, pchCommand + COMMAND_SIZE);
|
||||
return std::string(pchCommand, pchCommand + COMMAND_SIZE);
|
||||
}
|
||||
|
||||
bool IsValid()
|
||||
@@ -154,7 +169,7 @@ public:
|
||||
{
|
||||
Init();
|
||||
ip = ipIn;
|
||||
port = (portIn == 0 ? GetDefaultPort() : portIn);
|
||||
port = htons(portIn == 0 ? GetDefaultPort() : portIn);
|
||||
nServices = nServicesIn;
|
||||
}
|
||||
|
||||
@@ -166,18 +181,28 @@ public:
|
||||
nServices = nServicesIn;
|
||||
}
|
||||
|
||||
explicit CAddress(const char* pszIn, uint64 nServicesIn=NODE_NETWORK)
|
||||
explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
|
||||
{
|
||||
Init();
|
||||
SetAddress(pszIn);
|
||||
nServices = nServicesIn;
|
||||
Lookup(pszIn, *this, nServicesIn, fNameLookup, portIn);
|
||||
}
|
||||
|
||||
explicit CAddress(string strIn, uint64 nServicesIn=NODE_NETWORK)
|
||||
explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)
|
||||
{
|
||||
Init();
|
||||
SetAddress(strIn.c_str());
|
||||
nServices = nServicesIn;
|
||||
Lookup(pszIn, *this, nServicesIn, fNameLookup, 0, true);
|
||||
}
|
||||
|
||||
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()
|
||||
@@ -185,37 +210,11 @@ public:
|
||||
nServices = NODE_NETWORK;
|
||||
memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
|
||||
ip = INADDR_NONE;
|
||||
port = GetDefaultPort();
|
||||
port = htons(GetDefaultPort());
|
||||
nTime = 100000000;
|
||||
nLastTry = 0;
|
||||
}
|
||||
|
||||
bool SetAddress(const char* pszIn)
|
||||
{
|
||||
ip = INADDR_NONE;
|
||||
port = GetDefaultPort();
|
||||
char psz[100];
|
||||
strlcpy(psz, pszIn, sizeof(psz));
|
||||
unsigned int a=0, b=0, c=0, d=0, e=0;
|
||||
if (sscanf(psz, "%u.%u.%u.%u:%u", &a, &b, &c, &d, &e) < 4)
|
||||
return false;
|
||||
char* pszPort = strchr(psz, ':');
|
||||
if (pszPort)
|
||||
{
|
||||
*pszPort++ = '\0';
|
||||
port = htons(atoi(pszPort));
|
||||
if (atoi(pszPort) < 0 || atoi(pszPort) > USHRT_MAX)
|
||||
port = htons(USHRT_MAX);
|
||||
}
|
||||
ip = inet_addr(psz);
|
||||
return IsValid();
|
||||
}
|
||||
|
||||
bool SetAddress(string strIn)
|
||||
{
|
||||
return SetAddress(strIn.c_str());
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE
|
||||
(
|
||||
if (fRead)
|
||||
@@ -257,16 +256,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
vector<unsigned char> GetKey() const
|
||||
std::vector<unsigned char> GetKey() const
|
||||
{
|
||||
CDataStream ss;
|
||||
ss.reserve(18);
|
||||
ss << FLATDATA(pchReserved) << ip << port;
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1300
|
||||
return vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
|
||||
return std::vector<unsigned char>((unsigned char*)&ss.begin()[0], (unsigned char*)&ss.end()[0]);
|
||||
#else
|
||||
return vector<unsigned char>(ss.begin(), ss.end());
|
||||
return std::vector<unsigned char>(ss.begin(), ss.end());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -285,13 +284,29 @@ public:
|
||||
return (memcmp(pchReserved, pchIPv4, sizeof(pchIPv4)) == 0);
|
||||
}
|
||||
|
||||
bool IsRFC1918() const
|
||||
{
|
||||
return IsIPv4() && (GetByte(3) == 10 ||
|
||||
(GetByte(3) == 192 && GetByte(2) == 168) ||
|
||||
(GetByte(3) == 172 &&
|
||||
(GetByte(2) >= 16 && GetByte(2) <= 31)));
|
||||
}
|
||||
|
||||
bool IsRFC3927() const
|
||||
{
|
||||
return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254);
|
||||
}
|
||||
|
||||
bool IsLocal() const
|
||||
{
|
||||
return IsIPv4() && (GetByte(3) == 127 ||
|
||||
GetByte(3) == 0);
|
||||
}
|
||||
|
||||
bool IsRoutable() const
|
||||
{
|
||||
return IsValid() &&
|
||||
!(GetByte(3) == 10 ||
|
||||
(GetByte(3) == 192 && GetByte(2) == 168) ||
|
||||
GetByte(3) == 127 ||
|
||||
GetByte(3) == 0);
|
||||
!(IsRFC1918() || IsRFC3927() || IsLocal());
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
@@ -313,27 +328,22 @@ public:
|
||||
return ((unsigned char*)&ip)[3-n];
|
||||
}
|
||||
|
||||
string ToStringIPPort() const
|
||||
std::string ToStringIPPort() const
|
||||
{
|
||||
return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
|
||||
}
|
||||
|
||||
string ToStringIP() const
|
||||
std::string ToStringIP() const
|
||||
{
|
||||
return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0));
|
||||
}
|
||||
|
||||
string ToStringPort() const
|
||||
std::string ToStringPort() const
|
||||
{
|
||||
return strprintf("%u", ntohs(port));
|
||||
}
|
||||
|
||||
string ToStringLog() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port));
|
||||
}
|
||||
@@ -381,7 +391,7 @@ public:
|
||||
hash = hashIn;
|
||||
}
|
||||
|
||||
CInv(const string& strType, const uint256& hashIn)
|
||||
CInv(const std::string& strType, const uint256& hashIn)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < ARRAYLEN(ppszTypeName); i++)
|
||||
@@ -420,7 +430,7 @@ public:
|
||||
return ppszTypeName[type];
|
||||
}
|
||||
|
||||
string ToString() const
|
||||
std::string ToString() const
|
||||
{
|
||||
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
|
||||
}
|
||||
@@ -458,21 +468,22 @@ public:
|
||||
|
||||
|
||||
extern bool fClient;
|
||||
extern bool fAllowDNS;
|
||||
extern uint64 nLocalServices;
|
||||
extern CAddress addrLocalHost;
|
||||
extern CNode* pnodeLocalHost;
|
||||
extern uint64 nLocalHostNonce;
|
||||
extern array<int, 10> vnThreadsRunning;
|
||||
extern boost::array<int, 10> vnThreadsRunning;
|
||||
extern SOCKET hListenSocket;
|
||||
|
||||
extern vector<CNode*> vNodes;
|
||||
extern std::vector<CNode*> vNodes;
|
||||
extern CCriticalSection cs_vNodes;
|
||||
extern map<vector<unsigned char>, CAddress> mapAddresses;
|
||||
extern std::map<std::vector<unsigned char>, CAddress> mapAddresses;
|
||||
extern CCriticalSection cs_mapAddresses;
|
||||
extern map<CInv, CDataStream> mapRelay;
|
||||
extern deque<pair<int64, CInv> > vRelayExpiration;
|
||||
extern std::map<CInv, CDataStream> mapRelay;
|
||||
extern std::deque<std::pair<int64, CInv> > vRelayExpiration;
|
||||
extern CCriticalSection cs_mapRelay;
|
||||
extern map<CInv, int64> mapAlreadyAskedFor;
|
||||
extern std::map<CInv, int64> mapAlreadyAskedFor;
|
||||
|
||||
// Settings
|
||||
extern int fUseProxy;
|
||||
@@ -501,7 +512,7 @@ public:
|
||||
unsigned int nMessageStart;
|
||||
CAddress addr;
|
||||
int nVersion;
|
||||
string strSubVer;
|
||||
std::string strSubVer;
|
||||
bool fClient;
|
||||
bool fInbound;
|
||||
bool fNetworkNode;
|
||||
@@ -511,7 +522,7 @@ protected:
|
||||
int nRefCount;
|
||||
public:
|
||||
int64 nReleaseTime;
|
||||
map<uint256, CRequestTracker> mapRequests;
|
||||
std::map<uint256, CRequestTracker> mapRequests;
|
||||
CCriticalSection cs_mapRequests;
|
||||
uint256 hashContinue;
|
||||
CBlockIndex* pindexLastGetBlocksBegin;
|
||||
@@ -519,19 +530,19 @@ public:
|
||||
int nStartingHeight;
|
||||
|
||||
// flood relay
|
||||
vector<CAddress> vAddrToSend;
|
||||
set<CAddress> setAddrKnown;
|
||||
std::vector<CAddress> vAddrToSend;
|
||||
std::set<CAddress> setAddrKnown;
|
||||
bool fGetAddr;
|
||||
set<uint256> setKnown;
|
||||
std::set<uint256> setKnown;
|
||||
|
||||
// inventory based relay
|
||||
set<CInv> setInventoryKnown;
|
||||
vector<CInv> vInventoryToSend;
|
||||
std::set<CInv> setInventoryKnown;
|
||||
std::vector<CInv> vInventoryToSend;
|
||||
CCriticalSection cs_inventory;
|
||||
multimap<int64, CInv> mapAskFor;
|
||||
std::multimap<int64, CInv> mapAskFor;
|
||||
|
||||
// publish and subscription
|
||||
vector<char> vfSubscribe;
|
||||
std::vector<char> vfSubscribe;
|
||||
|
||||
|
||||
CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false)
|
||||
@@ -571,14 +582,9 @@ public:
|
||||
fGetAddr = false;
|
||||
vfSubscribe.assign(256, false);
|
||||
|
||||
// Push a version message
|
||||
/// when NTP implemented, change to just nTime = GetAdjustedTime()
|
||||
int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
|
||||
CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
|
||||
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
|
||||
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
|
||||
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
|
||||
nLocalHostNonce, string(pszSubVer), nBestHeight);
|
||||
// Be shy and don't send version until we hear
|
||||
if (!fInbound)
|
||||
PushVersion();
|
||||
}
|
||||
|
||||
~CNode()
|
||||
@@ -598,13 +604,13 @@ public:
|
||||
|
||||
int GetRefCount()
|
||||
{
|
||||
return max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
|
||||
return std::max(nRefCount, 0) + (GetTime() < nReleaseTime ? 1 : 0);
|
||||
}
|
||||
|
||||
CNode* AddRef(int64 nTimeout=0)
|
||||
{
|
||||
if (nTimeout != 0)
|
||||
nReleaseTime = max(nReleaseTime, GetTime() + nTimeout);
|
||||
nReleaseTime = std::max(nReleaseTime, GetTime() + nTimeout);
|
||||
else
|
||||
nRefCount++;
|
||||
return this;
|
||||
@@ -655,11 +661,11 @@ public:
|
||||
// Make sure not to reuse time indexes to keep things in the same order
|
||||
int64 nNow = (GetTime() - 1) * 1000000;
|
||||
static int64 nLastTime;
|
||||
nLastTime = nNow = max(nNow, ++nLastTime);
|
||||
nLastTime = nNow = std::max(nNow, ++nLastTime);
|
||||
|
||||
// Each retry is 2 minutes after the last
|
||||
nRequestTime = max(nRequestTime + 2 * 60 * 1000000, nNow);
|
||||
mapAskFor.insert(make_pair(nRequestTime, inv));
|
||||
nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);
|
||||
mapAskFor.insert(std::make_pair(nRequestTime, inv));
|
||||
}
|
||||
|
||||
|
||||
@@ -735,6 +741,19 @@ public:
|
||||
|
||||
|
||||
|
||||
void PushVersion()
|
||||
{
|
||||
/// when NTP implemented, change to just nTime = GetAdjustedTime()
|
||||
int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
|
||||
CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
|
||||
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
|
||||
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
|
||||
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
|
||||
nLocalHostNonce, std::string(pszSubVer), nBestHeight);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void PushMessage(const char* pszCommand)
|
||||
{
|
||||
@@ -956,7 +975,7 @@ inline void RelayInventory(const CInv& inv)
|
||||
{
|
||||
// Put on lists to offer to the other nodes
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
pnode->PushInventory(inv);
|
||||
}
|
||||
|
||||
@@ -983,7 +1002,7 @@ inline void RelayMessage<>(const CInv& inv, const CDataStream& ss)
|
||||
|
||||
// Save original serialized message so newer versions are preserved
|
||||
mapRelay[inv] = ss;
|
||||
vRelayExpiration.push_back(make_pair(GetTime() + 15 * 60, inv));
|
||||
vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv));
|
||||
}
|
||||
|
||||
RelayInventory(inv);
|
||||
@@ -1015,7 +1034,7 @@ void AdvertStartPublish(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
|
||||
|
||||
// Relay
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode != pfrom && (nHops < PUBLISH_HOPS || pnode->IsSubscribed(nChannel)))
|
||||
pnode->PushMessage("publish", nChannel, nHops, obj);
|
||||
}
|
||||
@@ -1026,7 +1045,7 @@ void AdvertStopPublish(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
|
||||
uint256 hash = obj.GetHash();
|
||||
|
||||
CRITICAL_BLOCK(cs_vNodes)
|
||||
foreach(CNode* pnode, vNodes)
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if (pnode != pfrom && (nHops < PUBLISH_HOPS || pnode->IsSubscribed(nChannel)))
|
||||
pnode->PushMessage("pub-cancel", nChannel, nHops, hash);
|
||||
|
||||
@@ -1043,3 +1062,5 @@ void AdvertRemoveSource(CNode* pfrom, unsigned int nChannel, unsigned int nHops,
|
||||
if (obj.setSources.empty())
|
||||
AdvertStopPublish(pfrom, nChannel, nHops, obj);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,10 @@
|
||||
// Copyright (c) 2010 Satoshi Nakamoto
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_NOUI_H
|
||||
#define BITCOIN_NOUI_H
|
||||
|
||||
#include <string>
|
||||
|
||||
typedef void wxWindow;
|
||||
#define wxYES 0x00000002
|
||||
@@ -31,7 +34,7 @@ typedef void wxWindow;
|
||||
#define wxMORE 0x00010000
|
||||
#define wxSETUP 0x00020000
|
||||
|
||||
inline int MyMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
|
||||
inline int MyMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
|
||||
{
|
||||
printf("%s: %s\n", caption.c_str(), message.c_str());
|
||||
fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str());
|
||||
@@ -39,17 +42,17 @@ inline int MyMessageBox(const string& message, const string& caption="Message",
|
||||
}
|
||||
#define wxMessageBox MyMessageBox
|
||||
|
||||
inline int ThreadSafeMessageBox(const string& message, const string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
|
||||
inline int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
|
||||
{
|
||||
return MyMessageBox(message, caption, style, parent, x, y);
|
||||
}
|
||||
|
||||
inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
|
||||
inline bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void CalledSetStatusBar(const string& strText, int nField)
|
||||
inline void CalledSetStatusBar(const std::string& strText, int nField)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,3 +63,5 @@ inline void UIThreadCall(boost::function0<void> fn)
|
||||
inline void MainFrameRepaint()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||