GBT: Correct block header in proposals RPC test
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user