GBT: Correct block header in proposals RPC test

This commit is contained in:
Jack Grigg 2016-10-01 17:26:59 +13:00
parent 89aa746ca1
commit 1628efedaf
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with 4 additions and 2 deletions

View File

@ -71,9 +71,11 @@ def genmrklroot(leaflist):
def template_to_bytes(tmpl, txlist):
blkver = pack('<L', tmpl['version'])
mrklroot = genmrklroot(list(dblsha(a) for a in txlist))
reserved = b'\0'*32
timestamp = pack('<L', tmpl['curtime'])
nonce = b'\0\0\0\0'
blk = blkver + a2b_hex(tmpl['previousblockhash'])[::-1] + mrklroot + timestamp + a2b_hex(tmpl['bits'])[::-1] + nonce
nonce = b'\0'*32
soln = b'\0'
blk = blkver + a2b_hex(tmpl['previousblockhash'])[::-1] + mrklroot + reserved + timestamp + a2b_hex(tmpl['bits'])[::-1] + nonce + soln
blk += varlenEncode(len(txlist))
for tx in txlist:
blk += tx