Bugfix: getwork: NULL pindexPrev across CreateNewBlock, in case it fails
Merge branch 'bugfix_CNBerr_daggy' into bugfix_CNBerr

Conflicts:
	rpc.cpp
Bugfix: getmemorypool: NULL pindexPrev across CreateNewBlock, in case it fails
Make CNetAddr::GetHash() return an unsigned val.

This prevents an undefined operation in main.cpp, when shifting the hash value
left by 32 bits.
Shifting a signed int left into the sign bit is undefined in C++11.
Don't overflow signed ints in CBigNum::setint64().

CBigNum::setint64() does 'n <<= 8', where n is of type "long long".

This leads to shifting onto and past the sign bit, which is undefined
behavior in C++11 and can cause problems in the future.
Add test case for CBigNum::setint64().

One of the test cases currently aborts when using gcc's flag -ftrapv, due to
negating an INT64_MIN int64 variable, which is an undefined operation.

This will be fixed in a subsequent commit.
Fix signed subtraction overflow in CBigNum::setint64().

As noticed by sipa (Pieter Wuille), this can happen when CBigNum::setint64() is
called with an integer value of INT64_MIN (-2^63).

When compiled with -ftrapv, the program would crash. Otherwise, it would
execute an undefined operation (although in practice, usually the correct one).
Should only be mapped when the getdata is done.

Without this change, mappings will be created even after AlreadyHave equals true, and will never be erased.
Use asynchronous I/O to handle RPC requests

This allows more flexibility in the RPC code, e.g. making it easier to
handle multiple simultaneous connections later on.

Currently asynchronous I/O is only used to listen for and accept
incoming connections.  Asynchronous reading/writing is more involved.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Add dual IPv4/IPv6 stack support to the RPC server

The RPC server now listens for, and handles, incoming connections on
both IPv4 as well as IPv6.

If available (and usable) it uses a dual IPv4/IPv6 socket on systems
that support it (e.g. Linux and BSDs) and falls back to separate
IPv4/IPv6 sockets on systems that don't (e.g. Windows).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Allow clients on the IPv6 loopback as well

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Generalise RPC connection handling code to allow more listening sockets

Using this modification it should be relatively easy to, at a later
time, listen on multiple addresses (even Unix domain sockets should be
possible).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Allow all addresses on the loopback subnet (127.0.0.0/8) not just 127.0.0.1

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Use the QueueShutdown signal to stop accepting new RPC connections

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Added 'immature balance' for miners. Only displayed if the balance is greater than zero.

This adds a field labelled 'Immature' in the overview section under the 'unconfirmed' field, which shows mined
income that has not yet matured (which is currently not displayed anywhere, even though the transactions
exist in the transaction list). To do that I added a 'GetImmatureBalance' method to the wallet, and connected
that through to the GUI as per the 'GetBalance' and 'GetUnconfirmedBalance' methods. I did a small 'no-op'
change to make the code in adjacent functions a little more readable (imo); it was a change I had made in my
repo earlier...but I thought it wouldn't hurt so left it in. Immature balance comes from mined income that is
at least two blocks deep in the chain (same logic as displayed transactions).

My reasoning is:
- as a miner, it's a critical stat I want to see
- as a miner, and taking into account the label 'immature', the uncertainty is pretty clearly implied
- those numbers are already displayed in the transaction list
- this makes the overview numbers add up to what's in the transaction list
- it's not displayed if the immature balance is 0, so won't bother non-miners

I also 'cleaned' the overview UI a little, moving code to the XML and removing HTML.
CreateNewBlock: Check that the produced CBlock is acceptable (except for proof-of-work and merkletree, since those need to be provided later)

This throws an exception from CreateNewBlock otherwise, which is not safe without #1245!
Show the timestamp for the block.

wrap lines
Update bitcoinstrings.cpp
sync english translation master file with current master branch
Merge pull request #1403 from Diapolo/translation_master_file

Translation: sync english translation master file with current master branch (2012-05-31)