<p>Look in <code>main.cpp</code> at the <code>ProcessBlock</code> function. The meat is in the <code>AcceptBlock</code> function in the same file.</p>

CC BY-SA 3.0
2014-03-23T08:14:35.927Z
2014-03-23T08:14:35.927Z
David Schwartz
<p>I was just looking through the Bitcoin code but since I am relatively new to C++ I was wondering, if anybody could tell me where the code responsible for receiving blocks that have just been mined by someone else is located.</p>

<p>My understanding is that when a miner successfully solves a block, it is broadcasted to the entire system. What I am looking for is the code responsible for how that broadcast is intercepted by other nodes if that makes more sense.</p>

<p>Thanks.</p>

<client><block><bitcoin-core-development><relay>
Where is the code that receives blocks that miners have just solved
Cheese
# Where is the code that receives blocks that miners have just solved

(Asked by: username_0 on 2014-03-23)

I was just looking through the Bitcoin code but since I am relatively new to C++ I was wondering, if anybody could tell me where the code responsible for receiving blocks that have just been mined by someone else is located.

My understanding is that when a miner successfully solves a block, it is broadcasted to the entire system. What I am looking for is the code responsible for how that broadcast is intercepted by other nodes if that makes more sense.

Thanks.

**Tags:** client, block, bitcoin-core-development, relay


---

## 1 answers

### Answer by username_1 on 2014-03-23. Score: 2

Look in `main.cpp` at the `ProcessBlock` function. The meat is in the `AcceptBlock` function in the same file.


---

