Author

Topic: Insert the genesis block transaction into the transaction database (Read 466 times)

hero member
Activity: 780
Merit: 501
I've read through http://www.reddit.com/r/Bitcoin/comments/1nc13r/the_first_50btc_block_reward_cant_be_spend_why/cchdhrm and https://bitcointalksearch.org/topic/how-to-make-coinbase-transaction-of-the-bitcoin-genesis-block-spendable-1080200.  I think I understand the technicalities behind it.  

Some altcoins based on older Bitcoin source code manually insert the genesis block transaction upon startup, as seen here:

https://github.com/suncoin/suncoin/blob/master/src/init.cpp#L811

This specific altcoin duplicates what is already in https://github.com/suncoin/suncoin/blob/master/src/main.cpp#L2096 in order to be successful.  However, there is another example, here https://github.com/planktonbuddy/krillcoin/blob/689eb1d3b0663b5f39a402a127d4fa16b4f6dbfe/src/main.cpp#L2527

It looks like it's doing the same thing but without the duplication in code, am I correct?

According to the comments made in https://bitcointalksearch.org/topic/m.11534787, newer version of the Bitcoin source code have checks in place that prevent the Genesis block outputs from being spent.  Does this mean that I would need to comment out those pieces of code if I were updating an altcoin to the latest Bitcoin source?

Additionally, what happens if I don't include the code that inserts the genesis transaction into the transaction DB?  Will it cause a fork?

Finally, what is the best (or recommended) way to insert the genesis transaction into the transaction database?  Do I do it in init.cpp?  Or can I do it in chainparams.cpp?
Jump to: