Merge pull request #948 from sipa/unstuck

Prevent stuck block download in large reorganisations
Merge pull request #947 from ali1234/master

When disconnecting a node, the receive buffer should be cleared
replace call to PrintConsole with call to error()

As these are equivalent functions, this cleans up the source a bit.
Also remove PrintConsole() as this was the only use.
Remove -bip16 and -paytoscripthashtime command-line arguments
Fix warning about deprecated unescaped backslash
Add -checklevel and improve -checkblocks

-checkblocks now takes a numeric argument: the number of blocks that must
be verified at the end of the chain. Default is 2500, and 0 means all
blocks.

-checklevel specifies how thorough the verification must be:
0: only check whether the block exists on disk
1: verify block validity (default)
2: verify transaction index validity
3: check transaction hashes
4: check whether spent txouts were spent within the main chain
5: check whether all prevouts are marked spent
6: check whether spent txouts were spent by a valid transaction that consumes them
Check minversion before loading the rest of the wallet

When a 0.6 wallet with compressed pubkeys is created, it writes a
minversion record to prevent older clients from reading it. If the 0.5
loading it sees a key record before seeing the minversion record however,
it will fail with DB_CORRUPT instead of DB_TOO_NEW.
Merge pull request #969 from laanwj/2012_03_printconsole_error

replace call to PrintConsole with call to error()
Merge branch 'master' of github.com:bitcoin/bitcoin
Merge pull request #964 from sipa/fastblocks

Speed up block downloading
Merge branch 'addrman' of https://github.com/sipa/bitcoin
Merge pull request #975 from sipa/versioncheck

Check minversion before loading the rest of the wallet
Merge branch 'checklevel' of https://github.com/sipa/bitcoin
Move QMAKE_LIBS_QT_ENTRY adjustment to bitcoin side of build

It could just as well be on either part of the gitian build, but to safely put it on the Qt side would require bumping the filename, and every gitian user rebuilding it.
v0.5.3.1 put it on the Bitcoin side, and this is easier to work with and keep safe, so I'm moving it.

Use `qmake MINGW_THREAD_BUGFIX=0` to disable
Merge pull request #946 from luke-jr/bugfix_rm_mingw

Move QMAKE_LIBS_QT_ENTRY adjustment to bitcoin side of build
Introduce explicit -walletupgrade option

Do not automatically change the wallet format unless the user takes an
explicit action that implies an upgrade (encrypting, for now), or uses
-walletupgrade.

-walletupgrade optionally takes an integer argument: the client version
up to which upgrading is allowed. Without an argument, it is upgraded
to latest supported version. If an argument to -walletupgrade is
provided at the time the wallet is created, the new wallet will initially
not use features beyond that version.

Third, the current wallet version number is reported in getinfo.
Add Luke-Jr's PGP key to gitian-downloader
remove unused functions from util.h/util.cpp
Give DNS seeds a random age between 3 and 7 days old

This speeds up initial connections with an old/large addr.dat a lot.
Fix URI link to bitcoin-qt.exe instead of bitcoin.exe