Avoid core dump if rpc port is in use.

The cleanup code needs to check for NULL rpcworkers thread group.
Update michagogo's gitian pgp key, adding UIDs
Bugfix: Avoid trying to parse outputs that aren't relevant to CWalletTx::GetAmounts

This fixes a warning when an output we aren't concerned with can't be parsed.
Bugfix: Supress "address" key in transaction details, when the destination isn't recognized

Previously, it would pass corrupt/random through base58.
RPC: prevent crash with walletpassphrase

- fix crash with walletpassphrase by checking if RPC server is running and
  give a friendly error message how to fix this (fixes #3100)
- add 3 new RPCErrorCodes RPC_SERVER_NOT_STARTED
- use the new code where needed / missing

Upstream: 4315ec1a722a290ba2bb2b86080a787f6174e2a2

Conflicts:
	src/rpcnet.cpp
	src/rpcwallet.cpp
bitcoingui: show main window (if hidden) on modal messages

Conflicts:
	src/qt/bitcoingui.cpp
Generalize the remove-outputs check for fully-prunable transactions.

Instead of explicitly testing for the presence of any output, and
dealing with this case specially, just interpret it as an empty
CCoins.

The case previously caught using the HaveCoins check, is now handled
by the generic outs != outsBlock test.

Conflicts:
	src/core.h
Bug fix: CDataStream::GetAndClear() when nReadPos > 0

Changed CDataStream::GetAndClear() to use the most obvious
get get and clear instead of a tricky swap().

Added a unit test for CDataStream insert/erase/GetAndClear.

Note: GetAndClear() is not performance critical, it is used only
by the send-a-message-to-the-network code. Bug was not noticed
before now because the send-a-message code never erased from the
stream.
Merge commit 'b56b102' into 0.8.x
Show short scriptPubKeys correctly

Previously bitcoin-qt's -debug transaction info was showing CTxOut([error])

It is valid for a scriptPubKey to be any size, for example simply
OP_RETURN is valid and can be used to destroy a TXOUT to mining fees.

Conflicts:
	src/core.cpp
Merge commit '5d37b9d' into 0.8.x

Conflicts:
	main.h
qt: add license header to source files

Closes #839

Conflicts:
	src/qt/addressbookpage.cpp
	src/qt/guiutil.cpp
	src/qt/intro.cpp
	src/qt/intro.h
	src/qt/macnotificationhandler.h
	src/qt/optionsdialog.cpp
	src/qt/optionsmodel.cpp
	src/qt/paymentrequestplus.cpp
	src/qt/paymentrequestplus.h
	src/qt/paymentserver.cpp
	src/qt/receivecoinsdialog.cpp
	src/qt/receivecoinsdialog.h
	src/qt/receiverequestdialog.cpp
	src/qt/receiverequestdialog.h
	src/qt/trafficgraphwidget.cpp
	src/qt/trafficgraphwidget.h
	src/qt/walletmodeltransaction.cpp
	src/qt/walletmodeltransaction.h
doc: replace DOS with MSYS shell to be more consistent

A plain DOS window doesn't have the right path settings, whereas
the MSYS shell window does.

Conflicts:
	doc/build-msw.md
Merge commit '51e3e09' into 0.8.x

Conflicts:
	build-msw.txt
Add additional data update to release-process.md

This adds https://github.com/bitcoin/bitcoin.org/pull/270 to the to-do
list for each release, avoiding future situations like
https://bitcointalk.org/index.php?topic=336042.0.
Partial: Sanitize assert usage and refuse to compile with NDEBUG.

There were quite a few places where assert() was used with side effects,
 making operation with NDEBUG non-functional.  This commit fixes all the
 cases I know about, but also adds an  #error on NDEBUG because the code
 is untested without assertions and may still have vulnerabilities if
 used without assert.

Conflicts:
	src/key.cpp
	src/main.cpp
	src/wallet.cpp
Change release-process.md to sign release tags

Conflicts:
	doc/release-process.md
Update build-osx.md
Explicitly ensure that wallet is unlocked in `importprivkey`

This makes for a more useful error reply (fixes #957).
Added new DNS seed from bitcoinstats.com.

Conflicts:
	src/chainparams.cpp