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 sending coins generated through mining to the wallet is located.
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
Each new block starts with a "coinbase" transaction, which specifies the generated coins for the block.
The code at the top of CreateNewBlock in main.cpp adds the coinbase tx to the new block, and later on calls GetBlockValue to determine the number of generated coins.
The coinbase transaction uses the scriptPubKey parameter of CreateNewBlock to specify the recipient of the generated coins.