bitcoin/bitcoin — pull request #1429 by TheBlueMatt (2012-06-06 23:57:07+00:00)
Title: Cblockstore class

This is based on #1408 and gives a preview of the goal of the rebase as a whole. It provides a CBlockStore class to store the block chain and allows CHub to call it and returns data to CHub. If it gets merged, CTxMemPool will be adapted to call CBlockStore functions to get info on previous transactions, and a CAlertStorage class will be added.

I would prefer to not do callbacks from CBlockStore, but I found that cleaner than returning a list of blocks committed (as each call to EmitBlock can commit any number of blocks) through many of the block acceptance functions and back to CHub::EmitBlock, buf if that design is preferred, its not hard to do that.

In general, though CBlockStore effectively turns several CHub functions into NOOPs, I prefer using a CHub as a convenience class so that CWallet/P2P client don't have to know something about CBlockStore and CTxMemPool and CAlertStore, but only needs to know one API. It also removes the need to duplicate much of the code to deal with callback threads in the storage classes.