GBT: Correct block header in proposals RPC test
This commit is contained in:
parent
89aa746ca1
commit
1628efedaf
|
@ -71,9 +71,11 @@ def genmrklroot(leaflist):
|
||||||
def template_to_bytes(tmpl, txlist):
|
def template_to_bytes(tmpl, txlist):
|
||||||
blkver = pack('<L', tmpl['version'])
|
blkver = pack('<L', tmpl['version'])
|
||||||
mrklroot = genmrklroot(list(dblsha(a) for a in txlist))
|
mrklroot = genmrklroot(list(dblsha(a) for a in txlist))
|
||||||
|
reserved = b'\0'*32
|
||||||
timestamp = pack('<L', tmpl['curtime'])
|
timestamp = pack('<L', tmpl['curtime'])
|
||||||
nonce = b'\0\0\0\0'
|
nonce = b'\0'*32
|
||||||
blk = blkver + a2b_hex(tmpl['previousblockhash'])[::-1] + mrklroot + timestamp + a2b_hex(tmpl['bits'])[::-1] + nonce
|
soln = b'\0'
|
||||||
|
blk = blkver + a2b_hex(tmpl['previousblockhash'])[::-1] + mrklroot + reserved + timestamp + a2b_hex(tmpl['bits'])[::-1] + nonce + soln
|
||||||
blk += varlenEncode(len(txlist))
|
blk += varlenEncode(len(txlist))
|
||||||
for tx in txlist:
|
for tx in txlist:
|
||||||
blk += tx
|
blk += tx
|
||||||
|
|
Loading…
Reference in New Issue