Do not flush the cache after every block outside of IBD
Set -discover=0 in regtest framework

The regtest framework is local, so often there is no need to
discover our external IP.  Setting -discover=0 in util.py works
around shutdown hang caused by GetExternalIP waiting in recv().
Fixed error in 'getbalance' when using watchonly addresses.
Merge pull request #4525

d512534 Fixed error in 'getbalance' when using watchonly addresses. (JaSK)
Add option to disable 077 umask (create new files with system default umask)

The option is only effective for either wallet-less builds or if
-disablewallet is specified as well.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 34d5fc0 4e1a196 bd4307b d53a33b 7e09b36
Github-Pull: #4286
Use unordered_map for CCoinsViewCache with salted hash
Fix semantic typo in state.CorruptionPossible check

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

Broken since 942b33a
Merge pull request #4494

bc42503 Use unordered_map for CCoinsViewCache with salted hash (Pieter Wuille)
Merge pull request #4505

d4d3fbd Do not flush the cache after every block outside of IBD (Pieter Wuille)
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.
Add peerid to getpeerinfo to allow correlation with the logs.

This seems to have been missed in 3764.
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.
Merge pull request #4522 from dgenr8/set_discover_0

Set -discover=0 in regtest framework
Merge pull request #4535

c4a321f Add peerid to getpeerinfo to allow correlation with the logs. (Gregory Maxwell)
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