Prune provably-unspendable outputs
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.
JSON Spirit updated to v4.06
Switch to using raw_utf8
Reject non-canonically-encoded sizes

The length of vectors, maps, sets, etc are serialized using
Write/ReadCompactSize -- which, unfortunately, do not use a
unique encoding.

So deserializing and then re-serializing a transaction (for example)
can give you different bits than you started with. That doesn't
cause any problems that we are aware of, but it is exactly the type
of subtle mismatch that can lead to exploits.

With this pull, reading a non-canonical CompactSize throws an
exception, which means nodes will ignore 'tx' or 'block' or
other messages that are not properly encoded.

Please check my logic... but this change is safe with respect to
causing a network split. Old clients that receive
non-canonically-encoded transactions or blocks deserialize
them into CTransaction/CBlock structures in memory, and then
re-serialize them before relaying them to peers.

And please check my logic with respect to causing a blockchain
split: there are no CompactSize fields in the block header, so
the block hash is always canonical. The merkle root in the block
header is computed on a vector<CTransaction>, so
any non-canonical encoding of the transactions in 'tx' or 'block'
messages is erased as they are read into memory by old clients,
and does not affect the block hash. And, as noted above, old
clients re-serialize (with canonical encoding) 'tx' and 'block'
messages before relaying to peers.
Merge src/leveldb changes for LevelDB 1.13
Squashed 'src/leveldb/' changes from be1b0ff..936b461

936b461 Merge upstream LevelDB 1.13.
748539c LevelDB 1.13

git-subtree-dir: src/leveldb
git-subtree-split: 936b4613ea4551992e6096b1e05eeefc09a20e3b
[wallet] Consider generated coins mature at COINBASE_MATURITY+1

We're not seeing large reorgs that would justify waiting a large
 amount past the rule required maturity, and the extra three
 hours is just a nuisance. Take one more block to at least give
 the 100th block time to propagate.
[raw] reject insanely high fees by default in sendrawtransaction

There have been several incidents where mainnet experimentation with
 raw transactions  resulted in insane fees.  This is hard to prevent
 in the raw transaction api because the inputs may not be known.
 Since sending doesn't work if the inputs aren't known, we can catch
 it there.

This rejects fees > than 10000 * nMinRelayTxFee or 1 BTC with the
 defaults and can be overridden with a bool at the rpc.
improve wallet load time by removing duplicated calls to EC_KEY_check_key and adding a hash for vchPubKey/vchPrivKey entries in wallet.dat

backwards compatible with previous wallet.dat format
verify vchPubKey matches calculated public key unless fSkipCheck is set
Silence useless warning in src/json/json_spirit_writer_template.h to make important warnings easier to see.

warning: typedef ‘Char_type’ locally defined but not used [-Wunused-local-typedefs]
Rename -tor to -onion to better reflect what it does.

I've seen users confused multiple times thinking they
 should be using -tor to set their tor proxy and then
 finding in horror that they were still connecting to
 the IPv4 internet.

Even Jeff guesses wrong about what the knob does, so
 I think we should rename it. This leaves the old
 knob working, we can pull it out completely in a
 later release.
Bitcoin-Qt: BitcoinGUI::message() updates/fixes

- ensure message boxes are shown in center of our main window, not
  centered on the users desktop
- always prefer user supplied titles for message boxes over the functions
  defaults (fixes a bug, where transaction info messages did not contain
  information, if it was incoming or outgoing)
More fixes for blockchain corruption on OSX.

As we'd previously learned, OSX's fsync is a data eating lie.

Since 0.8.4 we're still getting some reports of disk corruption on
 OSX but now all of it looks like the block files have gotten out of
 sync with the database. It turns out that we were still using fsync()
 on the block files, so this isn't surprising.
autotools: fix a parallel build race condition spotted by the pull-tester

libleveldb.a and libmemenv.a should be able to build in parallel, but in
practice calling the leveldb makefile ends up rewriting build_config.mk. If
one target tries to build while the other is halfway through writing the
.mk, the make ends up in an undefined state.

Fix that by making one depend on the other. This also reorders the variables
to be passed by param rather than via the environment, and combines the targets
into a single rule to avoid needless duplication.
Merge pull request #3001 from theuni/fix-make-race

autotools: fix a parallel build race condition spotted by the pull-tester
Merge pull request #3000 from gmaxwell/more_osx_fsync

More fixes for blockchain corruption on OSX.
included-tests: update gitian descriptors for hexdump dependency