I've been looking for months for the real mining code in the Bitcoin Core source code for the function/s that implement the incrementing of the nonce and hashing blocks for mining and never found anything useful. Can anyone Help me find it?
1 Answer
Most of the mining code was removed from Bitcoin Core as CPU mining gave way to GPU, FPGA and ASIC mining. The minimal amount of code that's left is intended for testing purposes, i.e. creating blocks on regtest. This code is in src/rpc/mining.cpp, and the function that handles incrementing the nonce is GenerateBlock.