bitcoin/bitcoin — pull request #771 by TheBlueMatt (2012-01-19 22:59:59+00:00)
Title: CBlockstore

From the commitmsg:
"Change Bitcoin's flow to use a CBlockStore class
which net/wallets send/recieve blocks to/from.

This commit is designed to not change any bitcoin functionality or operation.

Largest changes:
* ProcessMessage(s)/SendMessages moved to protocol.cpp
* Many globals removed from main.h and abstracted to CBlockStore
* Calls to CWallet::AddToWalletIfInvolvingMe no longer block Block verification,
resulting in a small, but measureable block verification speed increase.

There is still a lot of abstraction to go, but this is a step in the right direction."

This commit is not intended to be merged for 0.6, maybe 0.7. I just wanted to post it to start getting eyeballs on it as early as possible. In addition, there is a nasty performance bug somewhere that is causing an almost 25% slowdown in block download when downloading a lot of blocks (but it is often quicker for smaller sets, say < 5000 blocks). Ive looked at it in valgrind and gprofile and tried changing some possible culprits and havent had any luck tracking it down. If anyone tracks it down, Ill owe you big time.
Additionally, please mind the removal of cs_main around stuff thats not in main.cpp and tell me Im wrong to do that.