Move checkpoint based heuristic checks to AcceptBlockHeader
rpc: Ignore and log errors during cancel

Cancelling the RPC acceptors can sometimes result in an error about
a bad file descriptor.

As this is the shutdown sequence we need to continue nevertheless,
ignore these errors, log a warning and proceed.

Fixes #4352.
rpc: Add acceptors only when listening succeeded
Merge pull request #4358

6afa493 rpc: Add acceptors only when listening succeeded (Wladimir J. van der Laan)
33e5b42 rpc: Ignore and log errors during cancel (Wladimir J. van der Laan)
Merge pull request #4310

7a9e0b6 Move checkpoint based heuristic checks to AcceptBlockHeader (Pieter Wuille)
AvailableCoins: acquire cs_main mutex

It's required when called from WalletModel
Merge pull request #4371

ea3acaf AvailableCoins: acquire cs_main mutex (Pavel Vasin)
small cleanup in src/compat .h and .cpp

- add license header
- fix include guards
- fix indentation
Add nLocalServices info to RPC getinfo

Also show full 64 bits of services. Previously service bits >32 that
were advertised just didn't show up at all.
Add comment regarding experimental-use service bits

As per mailing list discussion.
Merge pull request #4380

38405ac Add comment regarding experimental-use service bits (Peter Todd)
99ddc6c Add nLocalServices info to RPC getinfo (Peter Todd)
Add a built-in SHA256/SHA512 implementation.

This also moves the HMAC-SHA512 implementation to sha2.cpp.
Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.
Remove getwork() RPC call
Switch miner.cpp to use sha2 instead of OpenSSL.
Add built-in SHA-1 implementation.
Move crypto implementations to src/crypto/
Add built-in RIPEMD-160 implementation
Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible
Extend and move all crypto tests to crypto_tests.cpp