Release 1.3.1.0
Use boost::asio::deadline_timer for walletpassphrase timeout

New method in bitcoinrpc:  RunLater, that uses a map of deadline
timers to run a function later.

Behavior of walletpassphrase is changed; before, calling
walletpassphrase again before the lock timeout passed
would result in: Error: Wallet is already unlocked.

You would have to call lockwallet before walletpassphrase.

Now: the last walletpassphrase with correct password
wins, and overrides any previous timeout.

Fixes issue# 1961 which was caused by spawning too many threads.

Test plan:

Start with encrypted wallet, password 'foo'
NOTE:
 python -c 'import time; print("%d"%time.time())'
... will tell you current unix timestamp.

Try:

walletpassphrase foo 600
getinfo
EXPECT: unlocked_until is about 10 minutes in the future

walletpassphrase foo 1
sleep 2
sendtoaddress mun74Bvba3B1PF2YkrF4NsgcJwHXXh12LF 11
EXPECT: Error: Please enter the wallet passphrase with walletpassphrase first.

walletpassphrase foo 600
walletpassphrase foo 0
getinfo
EXPECT: wallet is locked (unlocked_until is 0)

walletpassphrase foo 10
walletpassphrase foo 600
getinfo
EXPECT: wallet is unlocked until 10 minutes in future

walletpassphrase foo 60
walletpassphrase bar 600
EXPECT: Error, incorrect passphrase
getinfo
EXPECT: wallet still scheduled to lock 60 seconds from first (successful) walletpassphrase

Conflicts:
	src/rpcwallet.cpp
Make FindBlockByHeight constant-time.

Remove the pnext pointer in CBlockIndex, and replace it with a
vBlockIndexByHeight vector (no effect on memory usage). pnext can
now be replaced by vBlockIndexByHeight[nHeight+1], but
FindBlockByHeight becomes constant-time.

This also means the entire mapBlockIndex structure and the block
index entries in it become purely blocktree-related data, and
independent from the currently active chain, potentially allowing
them to be protected by separate mutexes in the future.

Conflicts:
	src/main.cpp
It's after 2013-05-15 forever now, so remove the code for the May 15 fork.

Conflicts:
	src/main.cpp
Replace repeated GetBoolArg() calls with Checkpoint::fEnabled variable
set once at init time.

Conflicts:
	src/checkpoints.cpp
	src/init.cpp
Updated check level
remove GetBoolArg() fDefault parameter defaulting to false

- explicitly set the default of all GetBoolArg() calls
- rework getarg_test.cpp and util_tests.cpp to cover this change
- some indentation fixes
- move macdockiconhandler.h include in bitcoin.cpp to the "our headers"
  section

Conflicts:
	src/init.cpp
	src/qt/bitcoin.cpp
	src/rpcmining.cpp
Too many bitcoins allowed in amount. (#2401)

Using magic number doesn't seem right. Could we factor this out, together with https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.cpp#L96 ?
And what about BitcoinUnits::parse() as well ?
Adapted a35e268da44a1606af2fc18169f715e7eda8fb7c to RDD
Bitcoin-Qt: setup testnet GUI directly

- this directly sets up all GUI elements that have testnet special-casing
  without first setting up main net stuff and changing afterwards (titles,
  icons etc.)
- also fixes 2 wrong icons shown during testnet usage on our toolbar

Conflicts:
	src/qt/bitcoingui.cpp
Add new data-driven test-case.
Add Linux script to limit outgoing bandwidth used by Reddcoin

This commit adds a Linux script that uses tc and iptables to
limit outgoing bandwidth to Reddcoin nodes. All tcp connections with
a source or destination port of 45444 are limited to the chosen rate.
It does not alter the incoming bandwidth. Additionally, outgoing
bandwidth to a host on a local LAN (defined by the LOCALNET variable)
is not limited.
Bitcoin-Qt: harmonize 2 setClientModel() functions

- harmonize BitcoinGUI::setClientModel() and RPCConsole::setClientModel()
- now RPCConsole::setClientModel() also includes a direct call to
  setNumBlocks()
Work update
build: prepare to move DetectShutdownThread
build: split the non-gui startup routines into a new file

This will allow each to have its own main(), meaning that we can build a common
base client and simply link in the correct startup object to create the
appropriate binary.

Conflicts:
	src/init.cpp
	src/makefile.linux-mingw
	src/makefile.mingw
	src/makefile.osx
	src/makefile.unix
build: add global var for whether or not the gui is enabled
build: cosmetic: split usage string for easier formatting

Conflicts:
	src/init.cpp
build: use runtime setting for displaying the help message rather than QT_GUI define

Conflicts:
	src/init.cpp
build: use runtime setting for wallet rather than QT_GUI define