Bitcoin Forum
November 08, 2024, 05:13:42 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]  (Read 11776 times)
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
February 20, 2018, 04:46:43 PM
 #41


Well, if you want to learn this stuff, you need to know some C++ and then
it won't be that hard to figure out. Especially since there are lots of threads like
this on bitcointalk, just search.
 
If you just want to launch your own cryptocurrency, these days you can do that
very easily on Ethereum or some other smart contract platform.

“God does not play dice"
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
February 20, 2018, 08:45:39 PM
 #42

Code:
if (false  && (block.GetHash() != hashGenesisBlock))
       {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
      if (block.nNonce % 10000 == 0) {
  printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
      }
           }
}

Hi.
This code does not work on new source.
What variables should be changed to what?

I found only, 'block' should be 'genesis', but about others, I don't know. And CBigNum() does not exist in new source.

And when try to 'make', errors.

---------------
chainparams.cpp: In constructor ‘CMainParams::CMainParams()’:
chainparams.cpp:130:41: error: ‘CBigNum’ was not declared in this scope
            uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256(
                                         ^
chainparams.cpp:131:37: error: no match for ‘operator>’ (operand types are ‘uint256’ and ‘uint256’)
            while (genesis.GetHash() > hashTarget)
                                     ^
--------------


Wich source do you use ?

wsxdrfv
Jr. Member
*
Offline Offline

Activity: 413
Merit: 5


View Profile WWW
February 20, 2018, 09:30:14 PM
 #43

Code:
if (false  && (block.GetHash() != hashGenesisBlock))
       {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
      if (block.nNonce % 10000 == 0) {
  printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
      }
           }
}

Hi.
This code does not work on new source.
What variables should be changed to what?

I found only, 'block' should be 'genesis', but about others, I don't know. And CBigNum() does not exist in new source.

And when try to 'make', errors.

---------------
chainparams.cpp: In constructor ‘CMainParams::CMainParams()’:
chainparams.cpp:130:41: error: ‘CBigNum’ was not declared in this scope
            uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256(
                                         ^
chainparams.cpp:131:37: error: no match for ‘operator>’ (operand types are ‘uint256’ and ‘uint256’)
            while (genesis.GetHash() > hashTarget)
                                     ^
--------------


Wich source do you use ?

Litecoin's newest source.
Pages: « 1 2 [3]  All
  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!