Bitcoin Forum
June 28, 2024, 08:10:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Creating hashMerkleRoot and hashGenesisBlock  (Read 2371 times)
cudjex (OP)
Sr. Member
****
Offline Offline

Activity: 507
Merit: 252


View Profile
January 29, 2014, 09:59:08 PM
 #1

Hello

I'm trying to create a testcoin using litecoin. To create genesis block I changed some lines to :

Code:
const char* pszTimestamp = "This will be start of COIN.";
Code:
block.nTime = 1391032298; // current time
Code:
uint256 hashGenesisBlock("0x"); //I dont now it's true or false,  I left it like that
Code:
uint256 hash = block.GetHash();
        printf("%s\n", hash.ToString().c_str());
        printf("%s\n", hashGenesisBlock.ToString().c_str());
        printf("%s\n", block.hashMerkleRoot.ToString().c_str());
        assert(block.hashMerkleRoot == uint256("0x")); //I dont now it's true or false, I left it like that
        block.print();
        assert(hash == hashGenesisBlock);

When I build daemon and launch it, I'm getting this error:

Quote
litecoind: main.cpp:2788: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.
Aborted

When I check the ./litecoin debug.log file, I'm seeing the previous hashMerkleRoot and hashGenesisBlock that litecoin uses now. I can't create new hashes..

Where I'm doing mistake ?

Thanks.
MijntjeGoud
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
March 06, 2014, 09:47:08 AM
 #2

well it says if (false && block.GetHash()! = Hashgenesisblock)

this has to be: if (true && block.GetHash()! = Hashgenesisblock)

bd9142
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
April 08, 2014, 03:06:47 PM
 #3

i changed it but i have still this problem. it says this:

: main.cpp:2048: bool LoadBlockIndex(bool): Assertion `block.hashMerkleRoot == uint256("0xa50faf35e1dddf4a076a907fbcef6d9d1595390cdb1c818a35dae53b67ad0aa8")' failed.

Why?
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
April 08, 2014, 03:10:04 PM
 #4

https://bitcointalk.org/index.php?topic=391983.msg4223449#msg4223449
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!