Avoid a bunch of copying/conversion in script/sign
doc: Correct several typos in bootstrap.md

- Also remove references to the blockchain size
Merge pull request #5225

369be58 doc: Correct several typos in bootstrap.md (sandakersmann)
Make sure that GetRandomBytes never fails

We're using GetRandomBytes in several contexts where it's either
unwieldy to return an error, or an error would mean a fatal exception
anyhow.

@gmaxwell checked OpenSSL a while ago and discovered that it never
actually fails, but it can't hurt to be a bit paranoid here.
Merge pull request #5210

1f84793 Avoid a bunch of copying/conversion in script/sign (Pieter Wuille)
Adding license.
Adding const.
Merge pull request #5249

38c62ae Adding const. (sinetek)
Merge pull request #5239

65e3a1e Make sure that GetRandomBytes never fails (Wladimir J. van der Laan)
Merge pull request #5246

a8a5e01 Adding license. (sinetek)
Don't show wallet options in the preferences menu when running with -disablewallet
Merge pull request #5245

d52f072 Don't show wallet options in the preferences menu when running with -disablewallet (sinetek)
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.