remove duplicate bitdb.Open() code from init

- remove code from step 7, which we already have in step 5 of init
Try moving database/ away in case of failure
Remove database/ after clean shutdown
Allow the default key to be unavailable

This solves the issue where no default key can be added after -salvagewallet.
Improve gettxoutsetinfo command

* Bugfix: output the correct best block hash (during IBD, it can
  differ from the actual current best block)
* Add height to output
* Add hash_serialized, which is a hash of the entire UTXO state.
  Can be useful to compare two nodes.
* Add total_amount, the sum of all UTXOs' values.
Bugfix: if no bestblock record is present, do a -rescan

It is possible to have a wallet.dat file without any bestblock
record at all (if created offline, for example), which - when
loaded into a client with a up-to-date chain - does no rescan and
shows no transactions.

Also make sure to write the current best block after a rescan, so
it isn't necessary twice.
Do not kill connections on recv buffer overflow

Instead of killing a connection when the receive buffer overflows,
just temporarily halt receiving before that happens. Also, no
matter what, always allow at least one full message in the receive
buffer (otherwise blocks larger than the configured buffer size
would pause indefinitely).
Do not write to wallet during LoadWallet

When debugging another issue, I found a hang-during-startup race condition due to
LoadWallet calling SetMinVersion (via LoadCryptedKey).

Writing to the file that you're in the process of reading is a bad idea.
clear path cache after getting a proper config file (fixes #2605)

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Remove implementation of disabled opcodes

So we stop getting pull requests (like #2604) fixing problems with disabled Script opcodes.
A hard fork would be required to re-enable these, and if we ever did that we'd require extensive review and testing.
Merge pull request #2608 from jonasschnelli/pathCacheFix

clear path cache after getting a proper config file (fixes #2605)
osx: show testnet icon in dock as early as possible

A green testnet splashscreen with a normal, orange dock icon looks strange and can confuse users.

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Remove flaky util thread unit tests
small init.cpp changes (strings / Winsock init)

- add a check that requested Winsock version is available
- update some strings
- remove -gen=0 from help-message as this is default
Merge pull request #2598 from Diapolo/init

small init.cpp changes (strings / Winsock init)
Merge pull request #2602 from sipa/utxostate

Improve gettxoutsetinfo command
Merge pull request #2603 from sipa/nobestblock

Bugfix: if no bestblock record is present, do a -rescan
Merge pull request #2607 from gavinandresen/loadwalletfix

Do not write to wallet during LoadWallet
Merge pull request #2566 from sipa/nodef

Allow the default key to be unavailable
Merge pull request #2610 from gavinandresen/scriptcleanup

Remove implementation of disabled opcodes