Looking for the part of the code responsible for doling out coinbase to the miner who solves the puzzle. I'm guessing it's somewhere in src/rpc/mining.cpp, but it's tough to figure out from the code where the payout is happening. Can anyone clear this up?
You're really asking about two separate but related pieces of code. One piece of code claims the mining reward, and the other piece of code says that it is okay for miners to claim a mining reward.