Update serialize comments to be doxygen compatible
The first thing that SelectParams does is call SelectBaseParams. Therefore, we do not need to call SelectBaseParams immediately prior to calling SelectParams.
Make comments in /src/script doxygen compatible
travis: attempt to fix unlikely build issue

This is a long chain of errors, and there are likely other changes that could
be made to cope in other places along that chain.

If depends don't build successfully, don't bother trying again for the sake of
better logging. That's likely to hurt more than help. In this case, qt build
failed, and on the second attempt, it appeared to be successful. However, due
to a bad object from an internal gcc error on the first build, the resulting
lib was unusable. This caused bitcoin-qt to not be built, and tests and
packaging which expected bitcoin-qt to be there failed.

The root cause:
Mingw is especially crashy when using -jX, likely compounded by low-memory
environments. I've seen multiple problems with this combo in Gitian as well.

In this case:
i686-w64-mingw32-g++: internal compiler error: Killed (program cc1plus)
...
make[3]: *** [.obj/release/qdrawhelper.o] Error 4

The workaround:
Bump Travis down to using -j2 by default. Additionaly, enable --with-gui for
the windows builds. This will cause configure to fail if qt is not working
while also testing the config flag.

Other failures which may be worth revisiting separately:
- If a depends package fails, maybe remove the workdir so that it doesn't taint
  subsequent runs
- See if there's anything repeatable about the ICE when building qt
depends: cleanup better after qt and force a bump

qt needs to be rebuilt for travis. The previous commit should help ensure that
this won't need to be done again.
travis: temporarily disable the forknotify test

It appears to be breaking randomly on Windows
Merge pull request #5268

c8b115e travis: temporarily disable the forknotify test (Cory Fields)
1877390 depends: cleanup better after qt and force a bump (Cory Fields)
560e996 travis: attempt to fix unlikely build issue (Cory Fields)
Merge pull request #5203

0d91ae3 The first thing that SelectParams does is call SelectBaseParams. Therefore, we do not need to call SelectBaseParams immediately prior to calling SelectParams. (mruddy)
Merge pull request #5252

b9a36b1 Make comments in /src/script doxygen compatible (Michael Ford)
Merge pull request #5198

1c0aa91 Update serialize comments to be doxygen compatible (Michael Ford)
Improve chainstate/blockindex disk writing policy

There are 3 pieces of data that are maintained on disk. The actual block
and undo data, the block index (which can refer to positions on disk),
and the chainstate (which refers to the best block hash).

Earlier, there was no guarantee that blocks were written to disk before
block index entries referring to them were written. This commit introduces
dirty flags for block index data, and delays writing entries until the actual
block data is flushed.

With this stricter ordering in writes, it is now safe to not always flush
after every block, so there is no need for the IsInitialBlockDownload()
check there - instead we just write whenever enough time has passed or
the cache size grows too large. Also updating the wallet's best known block
is delayed until this is done, otherwise the wallet may end up referring to an
unknown block.

In addition, only do a write inside the block processing loop if necessary
(because of cache size exceeded). Otherwise, move the writing to a point
after processing is done, after relaying.
Introduce separate flushing modes