3

I was reading this article about bitcoin-core. It is an explanation of bitcoin-core source code version 0.3, and it described a file named main.cpp. In the recent versions this file does not exist (or at least I couldn't find it). And based on the explanations this file managed the main process of the program:

main.h declares some key global variables (mapBlockIndex, chainActive, mempool, etc), constants, and functions. main.cpp is the program's longest source file (5,237 lines). main.cpp has most of the key functions for managing the blockchain, such as connecting, disconnecting, validating and storing blocks; identifying a certain block as the tip of the longest chain; and so forth. The "entry point" for most of the code is ProcessMessages (which listens for a signal from the message-handling thread.). Some of the code is run during initialization, called directly from init.cpp. Key dependencies: net.h

For the purpose of studying the source code I want to know where this file is moved, and if the name is changed what's the new name of the file?

I've searched for ProcessMessages in the whole source code and found that it was defined in the net_processing.cpp, does this file is the newer version of main.cpp?

I'm using version 23.0

1 Answer 1

4

main.cpp was primarily split into net_processing.cpp and validation.cpp. However, over the years, parts of main.cpp were moved out of it and into many other files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.