2

I have created a altcoin using the reference of LTC and already 170k blocks were formed. Now i want to change the conformation time as well as i want the difficulty to start from base difficulty.Basically i want to Hard fork the coin, & for that i recompiled the the code with new parameters and started the daemon.

And now i dont think the approach i took is leading me to proper direction as:

1)I am not at all able to bring the difficulty down to base difficulty. (according my new code,difficulty shoud get adjusted after each block) &

2) some of the new node could not even get the copy of ledger even after they are connected to pre existing healthy nodes.

debug.log says:

2018-06-12 09:14:49   nActualTimespan = 0  before bounds  
2018-06-12 09:14:49 GetNextWorkRequired RETARGET  
2018-06-12 09:14:49 nTargetTimespan = 15    nActualTimespan = 3 
2018-06-12 09:14:49 Before: 1e0ffff0  00000ffff0000000000000000000000000000000000000000000000000000000  
2018-06-12 09:14:49 After:  1e033330  0000033330000000000000000000000000000000000000000000000000000000  
2018-06-12 09:14:49 ERROR: AcceptBlock() : incorrect proof of work  
2018-06-12 09:14:49 ERROR: ProcessBlock() : AcceptBlock FAILED    

Can someone tell me is there other way by which i can Hardfork a altcoin. Or can someone suggest me what my next step could be

closed as too broad by renlord, Raghav Sood, Andrew Chow Jun 13 '18 at 0:03

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • If you recalculate the difficulty after each block, have you been able to solve a block at the previous difficulty? I would be surprised because the hash rate on LTC is so high. – JBaczuk Jun 12 '18 at 13:46
  • Actually it was not forked from LTC, the source code i used was that of LTC but blockchain was started from genesis block so starting difficulty was 0.00024414 – cryptoKTM Jun 12 '18 at 14:06
  • I'm confused, why do you call it a hard fork? – JBaczuk Jun 12 '18 at 14:14
  • I am sorry that was my mistake to call this altcoin as fork of LTC. But what i want to implement after block no 170k in my altcoin is Hardfork – cryptoKTM Jun 12 '18 at 14:24
  • Got, it thanks for the clarification. It appears the validity checks are still failing, can you check AcceptBlock() for where it is failing. Could be this, for example: bool fHasMoreOrSameWork = (chainActive.Tip() ? pindex->nChainWork >= chainActive.Tip()->nChainWork : true); – JBaczuk Jun 12 '18 at 14:40