Fix semantic typo in state.CorruptionPossible check

state.Invalid() is always false, check should be IsInvalid()

Broken since 942b33a
Can't log to debug log before chain params initialized

Add a function `AreBaseParamsConfigured` and use this to check
before writing to the debug log. This avoids assertions when the
application happens to log too early, which happens in the GUI.

Messages logged before the base parameters are configured can be
shown using `-printtoconsole`.
ui: Replace some LogPrintfs with qDebug()

These are relatively unimportant messages, so don't need to be logged
without -debug=ui.
qt: Start core thread only when needed

Start the core thread only when needed for initialization
or shutdown.

Avoids a bit of overhead, and also avoids spamming two
log messages before logging is properly initialized.
Break up CAddrMan's IMPLEMENT_SERIALIZE
Make sure CAutoFile for fees estimate goes out of scope
Merge pull request #4546

09c744c Make sure CAutoFile for fees estimate goes out of scope (Pieter Wuille)
Merge pull request #4534

33357b2 qt: Start core thread only when needed (Wladimir J. van der Laan)
c715ff5 ui: Replace some LogPrintfs with qDebug() (Wladimir J. van der Laan)
96ff9d6 Can't log to debug log before chain params initialized (Wladimir J. van der Laan)
Merge pull request #4533

43005cf Fix semantic typo in state.CorruptionPossible check (kazcw)
fix help message for RPC getpeerinfo
Merge pull request #4549

7de3f1c fix help message for RPC getpeerinfo (Philip Kaufmann)
Convert closesocket 'compat wrapper' to function in netbase

Simpler alternative to #4348.

The current setup with closesocket() is strange. It poses
as a compatibility wrapper but adds functionality.

Rename it and make it a documented utility function in netbase.

Code movement only, zero effect on the functionality.
Merge pull request #4508

b069750 Break up CAddrMan's IMPLEMENT_SERIALIZE (Pieter Wuille)
Merge pull request #4504

43f510d Convert closesocket 'compat wrapper' to function in netbase (Wladimir J. van der Laan)
[Qt] Prevent balloon-spam after rescan
build: silence false errors during make clean
Merge pull request #4530

acd432b [Qt] Prevent balloon-spam after rescan (Cozz Lovan)
Merge pull request #4553

1e72d5c build: silence false errors during make clean (Cory Fields)
Implement "getchains" RPC command to monitor blockchain forks.

Port over https://github.com/chronokings/huntercoin/pull/19 from
Huntercoin:  This implements a new RPC command "getchains" that can be
used to find all currently active chain heads.  This is similar to the
-printblocktree startup option, but it can be used without restarting
just via the RPC interface on a running daemon.
Rename proposed RPC call to "getchaintips".

Rename the proposed RPC call "getchains" to "getchaintips", as suggested
in the Github pull-request discussion.