Skip to content

Commit

Permalink
merge bitcoin master near 0.3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
vinced committed May 11, 2011
2 parents cf0e68f + 2fb1124 commit 0fa7d43
Show file tree
Hide file tree
Showing 43 changed files with 984 additions and 1,195 deletions.
25 changes: 19 additions & 6 deletions build-msw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.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/
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
Berkeley DB 4.7.25.NC
Boost 1.43.0
miniupnpc 1.5-20110215


Notes
Expand Down Expand Up @@ -90,6 +94,15 @@ 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:
Expand Down
54 changes: 49 additions & 5 deletions build-osx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
-----------

Expand Down
23 changes: 21 additions & 2 deletions build-unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,17 +37,26 @@ 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
OpenSSL 0.9.8g
wxWidgets 2.9.0
Berkeley DB 4.7.25.NC
Boost 1.37
miniupnpc 1.5


Notes
Expand All @@ -66,13 +76,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
Expand Down
15 changes: 12 additions & 3 deletions contrib/gitian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,29 @@ remotes:
"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 ../bitcoin
cd ..
#
cd bitcoin
mkdir -p $OUTDIR/src
cp -a . $OUTDIR/src
rm -rf $OUTDIR/src/.git
mv $OUTDIR/src/locale $OUTDIR
cp $OUTDIR/src/license.txt $OUTDIR
make -f makefile.unix $MAKEOPTS WXLIBS="-Wl,-Bstatic -l wx_gtk2u-2.9 -Wl,-Bdynamic -l gtk-x11-2.0 -l SM -l Xxf86vm" INCLUDEPATHS="`$INSTDIR/bin/wx-config --cflags`" bitcoin bitcoind
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
cp bitcoin bitcoind $OUTDIR/bin/$GBUILD_BITS
install -s bitcoin bitcoind $OUTDIR/bin/$GBUILD_BITS
12 changes: 7 additions & 5 deletions db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,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();
Expand Down Expand Up @@ -779,18 +779,18 @@ 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 == "fLimitProcessors") ssValue >> fLimitProcessors;
if (strKey == "nLimitProcessors") ssValue >> nLimitProcessors;
if (strKey == "fMinimizeToTray") ssValue >> fMinimizeToTray;
if (strKey == "fMinimizeOnClose") ssValue >> fMinimizeOnClose;
if (strKey == "fUseProxy") ssValue >> fUseProxy;
if (strKey == "addrProxy") ssValue >> addrProxy;

if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
}
}
pcursor->close();
Expand All @@ -806,6 +806,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
Expand Down
12 changes: 12 additions & 0 deletions db.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CAddress;
class CWalletTx;
class CAccount;
class CAccountingEntry;
class CBlockLocator;

extern map<string, string> mapAddressBook;
extern CCriticalSection cs_mapAddressBook;
Expand Down Expand Up @@ -405,6 +406,17 @@ class CWalletDB : public CDB
return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
}

bool WriteBestBlock(const CBlockLocator& locator)
{
nWalletDBUpdated++;
return Write(string("bestblock"), locator);
}

bool ReadBestBlock(CBlockLocator& locator)
{
return Read(string("bestblock"), locator);
}

bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
{
vchPubKey.clear();
Expand Down
30 changes: 30 additions & 0 deletions doc/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Bitcoin 0.3.21 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 changes: 34 additions & 0 deletions doc/README_windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Bitcoin 0.3.21 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.
5 changes: 3 additions & 2 deletions hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int CStandardHooks::LockinHeight()
if (fTestNet)
return 0;

return 105000;
return 118000;
}

bool CStandardHooks::Lockin(int nHeight, uint256 hash)
Expand All @@ -64,7 +64,8 @@ bool CStandardHooks::Lockin(int nHeight, uint256 hash)
(nHeight == 68555 && hash != uint256("0x00000000001e1b4903550a0b96e9a9405c8a95f387162e4944e8d9fbe501cd6a")) ||
(nHeight == 70567 && hash != uint256("0x00000000006a49b14bcf27462068f1264c961f11fa2e0eddd2be0791e1d4124a")) ||
(nHeight == 74000 && hash != uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) ||
(nHeight == 105000 && hash != uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")))
(nHeight == 105000 && hash != uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) ||
(nHeight == 118000 && hash != uint256("0x000000000000774a7f8a7a12dc906ddb9e17e75d684f15e00f8767f9e8f36553")))
return false;
return true;
}
Expand Down
Loading

0 comments on commit 0fa7d43

Please sign in to comment.