bitcoin/bitcoin — pull request #1369 by sipa (2012-05-21 15:17:07+00:00)
Title: Reorder AppInit2

This reorders AppInit2 into 10 sections:
1) basic setup (OS stuff, signal handlers)
2) parameter interactions (softset)
3) interpreting options without side effects (just setting internal variables)
4) application initialization (datadir lock, daemonize, pidfile, log file)
5) network initialization (network params, proxy, binding)
6) load blockchain
7) load wallet
8) import blocks (-loadblock=)
9) load peers
10) start node/rpc threads
11) finished

This means invalid configurations will be detected as soon as possible (in particular, before loading the block chain).