Merge pull request #3162 from sipa/saninsert

Remove redundant insert method in serialize
Merge pull request #3115 from sipa/walletmain

Interaction cleanups between main and wallet
Merge pull request #3173 from gavinandresen/fuzzmessages

-fuzzmessagestest=N : randomly corrupt 1-of-N sent messages
Merge pull request #3176 from Diapolo/key

fix wrong memcmp() usage in CKey::operator==
re-work -debug switch handling

- re-work -debug help message text
- make -debug log every debugging information again (even all categories)
- remove unneeded fDebug checks in front of LogPrint()/qDebug(), as that
  check is done in LogPrintf() when category is != NULL (true for all
  LogPrint() calls
- remove fDebug ONLY in code which is NOT performance-critical
- harmonize addrman category name
- deprecate -debugnet usage, should be used via -debug=net and remove the
  corresponding global
Merge pull request #3160 from Diapolo/walletview

[Qt] walletview: make backupWallet() use GUIUtil::getSaveFileName()
transactionview: add message() signal

- allow to use message() in transactionview by connecting to the
  message() signal in WalletView
transactionview: make exportClicked() use message()

- use message() for displaying success or failure of export
- rework the strings to be more detailed / informative
- additional small cleanups
[Qt] sendcoinsdialog: convert QMessageBox usage to message()

- add new processSendCoinsReturn() function, which parses the
  status of WalletModel::SendCoinsReturn and generates a pair consisting
  of a message and message flags
- result is we only need one emit message() call
- this change ensures that the GUI is shown for warnings/errors in
  sendcoinsdialog, because of message() taking care of that for modal
  messages
- changes 2 warning message into error messages and removed "Error:"
  in front of the actual error message string
Merge pull request #3067 from Diapolo/debug-switch

re-work -debug switch handling
Merge pull request #3189

71ba467 [Qt] sendcoinsdialog: convert QMessageBox usage to message() (Philip Kaufmann)
Merge pull request #3159

9eb4ab6 transactionview: make exportClicked() use message() (Philip Kaufmann)
868d3ee transactionview: add message() signal (Philip Kaufmann)
[Qt] Rework of payment request UI (mainly for insecure pr)

- this shows insecure (unsecured) payment requests in a new yellowish
  colored UI (based on the secure payment request UI) instead of our
  normal payment UI
- allows us to receive paymentACK messages for insecure payment requests
- allows us to handle expirations for insecure payment request
- changed walletmodel, so that all types of payment requests don't touch
  the addressbook
payment-request UI: use SendCoinsRecipient.message for memo
make processPaymentRequest() use a single SendCoinsRecipient

- as one this pulls main purpose is to change a payment request to
  be displayed as a single sendcoins entry
rework an ugly hack in processPaymentRequest()

- use a QStringList to store valid addresses and format them for GUI and
  debug.log usage via .join()
Do not use the redundant BestInvalidWork record in the block database.

As block index entries have a flag for marking invalid blocks, the
'best invalid work' information can be derived from there. In addition,
remove the global from main.h
Make some globals in main non-public.

This means they are declared static, and their extern definition in
main.h is removed. Also moved CBlockIndexWorkComparator to the .cpp
file.
Merge pull request #3114

a616206 Give peer time-adjustment data an own lock (Pieter Wuille)
Merge pull request #3128

0056095 Show short scriptPubKeys correctly (Peter Todd)
22de68d Relay OP_RETURN TxOut as standard transaction type (Peter Todd)

Signed-off-by: Gavin Andresen <gavinandresen@gmail.com>