Bitcoin Forum
June 17, 2024, 04:28:56 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why coind program spit out Assertion error?  (Read 112 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 06, 2018, 04:35:40 AM
 #1

I made clone coin,

launched -qt wallet at 2 other VPS, after they sync, start mine from 1, it works well.

Block height become 100~,

so I copy coind file to 3rd VPS, run it like ./coind, (or ./coind -daemon -reindex -txindex)

then suddenly it take 100% cpu, then it spit out this error,

root@q353-2841:~/mycoin# mycoind : main.cpp:2857: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.

Why this happen? How to fix?
achow101
Staff
Legendary
*
Offline Offline

Activity: 3430
Merit: 6705


Just writing some code


View Profile WWW
April 06, 2018, 04:59:23 AM
 #2

The hash of your genesis block does not match what your software says the genesis block hash should be.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 06, 2018, 05:29:08 AM
 #3

The hash of your genesis block does not match what your software says the genesis block hash should be.
How that could be... first 2 VPS I launched run well and each sync with other, and now running well, mining well.

And also I git download from source, and made -qt, run it, it says 8 hours behind, there stops sync.
achow101
Staff
Legendary
*
Offline Offline

Activity: 3430
Merit: 6705


Just writing some code


View Profile WWW
April 06, 2018, 06:11:00 AM
 #4

How that could be... first 2 VPS I launched run well and each sync with other, and now running well, mining well.
Reindexing calls different code than a normal start or first start up. It is breaking in the InitBlockIndex function, so go to that function and make sure it is correct. Particularly make sure that that function is creating the correct genesis block (in 0.8 which is what you seem to have forked from, it creates the genesis block independently of the chain params too).

And also I git download from source, and made -qt, run it, it says 8 hours behind, there stops sync.
Qt may also have different code paths than what you thought. Or it just isn't connected to your nodes.



As an aside, you need to stop asking simple debugging questions like these in this forum. We are not your personal support for everything software engineering and Bitcoin cloning related. You should know how to debug simple bugs like this - the source code file and line number where the error occurred are given to you!! You should learn simple software engineering skills and debugging skills before even thinking about making your own altcoin. And even then, you should understand how Bitcoin works before doing so. It is extremely clear that you have no experience with software engineering or debugging software and that you have no knowledge of how Bitcoin works. I ask that you stop asking questions for every single problem you have and instead read documentation and tutorials for working in C++, use some common sense, and do your own research (note research does not mean ask everyone else about problems you are having) first.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 06, 2018, 06:50:54 AM
 #5

Thanks, I will keep in mind.
But this phenomenon is I firstly see and can't understand reason, how to fix this.
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!