Fix formatting
remove unused CNode::Cleanup()
add missing vhListenSocket.clear(); to CNetCleanup()
remove unneded class CNodeCombinedStats; from rpcconsole.cpp

- also 2 small style fixes
Merge pull request #4391

b612bde remove unneded class CNodeCombinedStats; from rpcconsole.cpp (Philip Kaufmann)
Merge pull request #4385

040c2d3 Fix formatting (Drak)
Merge pull request #4388

3dc1464 add missing vhListenSocket.clear(); to CNetCleanup() (Philip Kaufmann)
2831a03 remove unused CNode::Cleanup() (Philip Kaufmann)
Avoid undefined behavior using CFlatData in CScript serialization

`&vch[vch.size()]` and even `&vch[0]` on vectors can cause assertion
errors with VC in debug mode. This is the problem mentioned in #4239.
The deeper problem with this is that we rely on undefined behavior.

- Add `begin_ptr` and `end_ptr` functions that get the beginning and end
  pointer of vector in a reliable way that copes with empty vectors and
  doesn't reference outside the vector
(see https://stackoverflow.com/questions/1339470/how-to-get-the-address-of-the-stdvector-buffer-start-most-elegantly/1339767#1339767).
- Add a convenience constructor to CFlatData that wraps a vector.

I added `begin_ptr` and `end_ptr` as separate functions as I imagine
they will be useful in more places.
Merge pull request #4293

fa126ef Avoid undefined behavior using CFlatData in CScript serialization (Wladimir J. van der Laan)
Add support for watch-only addresses

Changes:
* Add Add/Have WatchOnly methods to CKeyStore, and implementations
  in CBasicKeyStore.
* Add similar methods to CWallet, and support entries for it in
  CWalletDB.
* Make IsMine in script/wallet return a new enum 'isminetype',
  rather than a boolean. This allows distinguishing between
  spendable and unspendable coins.
* Add a field fSpendable to COutput (GetAvailableCoins' return type).
* Mark watchonly coins in listunspent as 'watchonly': true.
* Add 'watchonly' to validateaddress, suppressing script/pubkey/...
  in this case.

Based on a patch by Eric Lombrozo.

Conflicts:
	src/qt/walletmodel.cpp
	src/rpcserver.cpp
	src/wallet.cpp
qt: Hide unspendable outputs in coin control
Watchonly balances are shown separately in gui.
Watchonly transactions are marked in transaction history
Added argument to getbalance to include watchonly addresses and fixed errors in balance calculation.
Added argument to listaccounts to include watchonly addresses
Showing 'involvesWatchonly' property for transactions returned by 'listtransactions' and 'listsinceblock'.
It is only appended when the transaction involves a watchonly address.
Added argument to listtransactions and listsinceblock to include watchonly addresses
fixed tiny glitch and improved readability like laanwj suggested
added includeWatchonly argument to 'gettransaction' because it affects balance calculation
added includedWatchonly argument to listreceivedbyaddress/...account