bitcoincore growth – What do the lessons ChainstateManager, CChainState, CChain and BlockManager do in Bitcoin Core?

0
31


What do the lessons ChainstateManager, CChainState, CChain and BlockManager do?

A graphic from Doxygen exhibiting how the lessons work together:

ChainstateManager: Offers an interface for creating and interacting with one or two chainstates

CChainState: Shops and offers an API to replace our native data of the present greatest chain.

CChain: An in-memory listed chain of blocks.

BlockManager: Maintains a tree of blocks (saved in m_block_index) which is consulted to find out the place the most-work tip is.

Why do CChainState and CChain have a number one ‘C’, however ChainstateManager and BlockManager do not?

C stands for sophistication utilizing Hungarian type naming.

The present type in Bitcoin Core is to not use Hungarian notation. We use m_ to symbolize member variables, g_ to symbolize globals, and no prefix to symbolize native variables/parameters. CChainState and CChain had been named prior to those type tips being applied in Bitcoin Core.

These had been answered by John Newbery and different members of the Could twelfth 2021 Bitcoin Core PR overview membership.



Supply hyperlink

Leave a reply