<p>It just contains an apparently random collection of functions used by the program. It also declares some global structures such as the main lock, the transaction pool, orphan block tracking, and so on. It contains high-level block and transaction functions. Ironically, it does <em>not</em> contain the actual <code>main</code> function -- that's in <code>init.cpp</code>.</p>

CC BY-SA 3.0
2012-12-14T02:08:15.170Z
2012-12-14T02:08:15.170Z
David Schwartz
<p>What does the main.cpp source-code file do? I know what main.cpp files are for in general, but specifically in the case of bitcoin?</p>

CC BY-SA 3.0
2012-12-13T20:07:59.057Z
I think this is a very, very wide question best answered perhaps by an issue filed on the Bitcoin issue tracker asking for inline documentation on the functions and methods in this file. It's not a very good question to be answered in this forum.
Colin Dean
CC BY-SA 3.0
2012-12-14T19:04:22.680Z
It's totally **NOT** a "wide question", it's very specific instead. Either we accept [tag:source-code] questions, or we don't; if we do, then this question is perfectly valid.
o0'.
<client><bitcoin-core><c++>
What is main.cpp for in bitcoind?
Kinnard Hockenhull
# What is main.cpp for in bitcoind?

(Asked by: username_0 on 2012-12-13)

What does the main.cpp source-code file do? I know what main.cpp files are for in general, but specifically in the case of bitcoin?

**Tags:** client, bitcoin-core, c++

> **Comments:**
> **username_1**: I think this is a very, very wide question best answered perhaps by an issue filed on the Bitcoin issue tracker asking for inline documentation on the functions and methods in this file. It's not a very good question to be answered in this forum.  
> **username_2**: It's totally **NOT** a "wide question", it's very specific instead. Either we accept [tag:source-code] questions, or we don't; if we do, then this question is perfectly valid.  

---

## 1 answers

### Answer by username_3 on 2012-12-14. Score: 5 | Accepted answer

It just contains an apparently random collection of functions used by the program. It also declares some global structures such as the main lock, the transaction pool, orphan block tracking, and so on. It contains high-level block and transaction functions. Ironically, it does *not* contain the actual `main` function -- that's in `init.cpp`.


---

