3
0
As per my understanding of bitcoin codebase, the following events happen after we solve a proof of work.
- In
miner.cpp, once the miner thread solves a new Proof-of-work (PoW),ProcessBlockFoundbasically notifies others via a signalBlockFound. BlockFoundsignal callsResetRequestCountwhich basically resets thempRequestCountinwallet.hvia thevalidationInterface.h.- (Missing Logic)
- A new
NetMsgType::INVis issued frommain.cppinSendMessages/ProcessMessagesto all peers. - These messages are eventually dispatched to all peers via network socket logic
net.cpp
I am missing the main piece of code logic between step2 and step4. Can any expert help me understand what background story is happening after step2?
I think you got my question wrong.
ProcessNewBlockbasically sanity checks the block, stores to disk and activates the best chain again. My question is where is the logic which actually sends the Hash out to other nodes? The mining logic is inminer.cppsending logic is inmain.cpp. Somewhere I miss where it picks the information of new block mined and sends out 'Hey! I have a new one' or INV message – Prem Anand – 2016-01-27T02:59:07.840