Bitcoin Forum
May 03, 2024, 04:31:19 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Insert the genesis block transaction into the transaction database  (Read 446 times)
tuaris (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 500



View Profile WWW
July 28, 2015, 10:28:24 PM
Last edit: July 28, 2015, 10:48:34 PM by tuaris
 #1

I've read through http://www.reddit.com/r/Bitcoin/comments/1nc13r/the_first_50btc_block_reward_cant_be_spend_why/cchdhrm and https://bitcointalk.org/index.php?topic=1080200.0.  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://bitcointalk.org/index.php?topic=1080200.msg11534787#msg11534787, 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?

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!