Bitcoin Forum
December 11, 2017, 10:20:29 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Creating the 100 Miner Test Blocks.  (Read 740 times)
MatthewLM
Legendary
*
Offline Offline

Activity: 1092



View Profile WWW
October 17, 2012, 06:01:20 PM
 #1

Hello. I'm trying to generate the mining test blocks from here: https://github.com/bitcoin/bitcoin/blob/master/src/test/miner_tests.cpp

I assume they work on top of the genesis block and so I tried creating them but the first fails with a bad hash. The first block data I have is this:

Code:
0x1, 0x0, 0x0, 0x0, // Version 1
0x6f, 0xe2, 0x8c, 0xa, 0xb6, 0xf1, 0xb3, 0x72, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f, 0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x8, 0x9c, 0x68, 0xd6, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, // Genesis Prev Hash
0x42, 0xa, 0x9e, 0xc3, 0xf4, 0xa4, 0x97, 0x26, 0x7d, 0xb5, 0xe0, 0x7d, 0xdd, 0x2e, 0xea, 0x53, 0xa5, 0x37, 0x68, 0xbc, 0x49, 0xd7, 0x89, 0xb9, 0x9c, 0x8a, 0x7a, 0x5a, 0x98, 0x92, 0x9b,
0xba, // Merkle Root
0x2a, 0xab, 0x5f, 0x49, // TimeStamp
0xff, 0xff, 0x0, 0x1d, // Target
0x23, 0xe2, 0xa3, 0xa4, // Nonce
0x1, // Transaction number
0x1, 0x0, 0x0, 0x0, // Transaction version
0x1, // Input number
0x0 <repeats 32 times>, // Coinbase output reference hash
0xff, 0xff, 0xff, 0xff, // Coinbase output reference index
0x5, // Input script length
0x4, // Extra nonce
0x0, 0x0, 0x0, 0x0, // Height
0xff, 0xff, 0xff, 0xff, // Sequence
0x1, // Output number
0x0, 0xf2, 0x5, 0x2a, 0x1, 0x0, 0x0, 0x0, // Output value
0x0, // Output script length. Assuming nothing comes after with zero length???
0x0, 0x0, 0x0, 0x0 // Locktime

What am I doing wrong, does anyone know?

I need to do this to do some block validation tests.

Bitcoin Extra Wallet | Peercoin Android Wallet
BTC: 1D5A1q5d192j5gYuWiP3CSE5fcaaZxe6E9  PPC: PH7fVn1Xs7nkUFmdwCX2ZRYfLPCSwGxAq9
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
1513030829
Hero Member
*
Offline Offline

Posts: 1513030829

View Profile Personal Message (Offline)

Ignore
1513030829
Reply with quote  #2

1513030829
Report to moderator
MatthewLM
Legendary
*
Offline Offline

Activity: 1092



View Profile WWW
October 17, 2012, 06:56:43 PM
 #2

Okay the issue was with the input script length. Mine was 5 bytes but it should have only been 2 bytes. One byte each for the two numbers. All sorted now.

Bitcoin Extra Wallet | Peercoin Android Wallet
BTC: 1D5A1q5d192j5gYuWiP3CSE5fcaaZxe6E9  PPC: PH7fVn1Xs7nkUFmdwCX2ZRYfLPCSwGxAq9
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!