Why does bitcoind say "error: couldn't connect to server" for the first few minutes of boot-up? After starting bitcoin from the command line, with:

./bitcoind -daemon


I immediately run the followup command:

./bitcoind getinfo


which gives me the following error:


  error: couldn't connect to server


This error lasts from a few seconds to a few minutes depending on the machine.

Two questions:


What is Bitcoin doing during this time, that causes this error (i.e. prevents the client from returning the results of getinfo)?
Are there any steps I can take that will minimize this start-up time?
The first thing Bitcoin-QT does is verify that the data stored on the disk is valid. Among other checks this includes verifying the last 288 blocks (the past two days in expectation). This task involves a large number of signature checks and will take some time to complete. Only after the startup checks have successfully completed will the connections to the Bitcoin Network be established and only then the client will start listening for incoming JSON-RPC requests.