Where is the code that sends generated Bitcoins from mining to the wallet?

5

3

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.

Thanks.

Cheese

Posted 2014-03-22T12:06:04.323

Reputation: 61

Answers

2

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.

hsmiths

Posted 2014-03-22T12:06:04.323

Reputation: 741