Bitcoin Forum
October 02, 2025, 08:45:07 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / How important is GetMedianTimePast in UpdateTime ? on: August 19, 2015, 05:15:29 AM
Trying to learn more about the code, and producing some altcoins with modifications to test.  I've got one with Devcoin merged mining patches applied, trying to merge mine it with Bitcoin.  During merged mining, but not single coin mining, it produces rejected blocks which have timestamps either years in the past, or decades in the future (usually the latter).  I tracked it down to UpdateTime, and GetMedianTimePast.  UpdateTime returns the max of GetMedianTimePast, and GetAdjustedTime.  Sometimes, GetMedianTimePast returns wildly high positive numbers, though usually it produces wildly low negative numbers.  If they're positive, they're the max(), and become the new timestamp.  So I've cut GetMedianTimePast out of UpdateTime:

Code:
//    block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
    block.nTime = GetAdjustedTime();

Are there any major consequences to doing this?

Alternatively, if you have any ideas why GetMedianTimePast is producing numbers like -6969792509024063232 and 441414620544770536, that would also be super helpful.
2  Alternate cryptocurrencies / Altcoin Discussion / Re: Genesis Block, failed to find valid nonce, tried all possibilities in 4 bytes on: November 25, 2014, 04:38:26 AM
I've confirmed that reducing the nTime by 1, to 1416512905, does successfully hash with nonce 1668111843.  It still seems that the original params are just an unlucky combination.
3  Alternate cryptocurrencies / Altcoin Discussion / Re: Genesis Block, failed to find valid nonce, tried all possibilities in 4 bytes on: November 25, 2014, 01:52:40 AM
@Quantum_Mechanics That's alright, thanks for offering help.

@iGotSpots  They generate addresses from a random seed?  Sorry, I don't follow.  The error I'm getting is:
struct.error: 'I' format requires 0 <= number <= 4294967295

Which means that it has tried all 4294967295 possible nonces and failed to find a valid hash. 
4  Alternate cryptocurrencies / Altcoin Discussion / Re: Genesis Block, failed to find valid nonce, tried all possibilities in 4 bytes on: November 24, 2014, 10:10:37 PM
Thanks, I'm working on an automatic coin generator, so I need to automate the genesis mining process.  Compiling the source code and running it more than once is much more difficult than using a separate tool like GenesisH0.  GenesisH0 has produced multiple valid genesis hashes in my tests.  My question is, Is it more likely that GenesisH0 has a weird bug in this case, or that this specific timestamp simply has no valid hash?  Also, I can't find the string
Code:
if (false  && (block.GetHash() != hashGenesisBlock)) {
in the file main.cpp https://github.com/bitcoin/bitcoin/blob/1ee685f984bdeaac7468019c6e2cd4b7d3496aef/src/main.cpp
5  Alternate cryptocurrencies / Altcoin Discussion / Genesis Block, failed to find valid nonce, tried all possibilities in 4 bytes on: November 24, 2014, 04:32:29 PM
Has this ever happened to anyone else, or am I doing something wrong?  I have this details:

Timestamp: This is a test of the emergency broadcast system.
Unix time: 1416512906
Pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f

I'm using GenesisH0, https://github.com/lhartikk/GenesisH0

It's trying all the nonces up to 4294967295 (the max of a 4 byte unsigned integer) and doesn't find a single one that produces a valid hash.
6  Alternate cryptocurrencies / Altcoin Discussion / Help creating SHA256 altcoin with merged mining on: November 05, 2014, 04:20:23 PM
I'm trying to produce a SHA256 altcoin which is merge mined with Bitcoin.  I'd like to use some recent code, rather than base in on a 0.8.* or earlier codebase.  I've found this source:
https://github.com/sidhujag/bitcoin-0.9.2-Merge-Mining-fork

However, it's based on Devcoin, so it sends some of the mining proceeds to other parties.  I'm finding it very difficult to extract this feature, while keeping the merged mining.  For instance, in the miner.cpp file I've modified the CreateNewBlock function to remove the "Prepare to pay beneficiaries" section, but when I do so the compiled code segfaults.

Thanks to anyone who can help with this.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!