def assembleBlock(blkhdr, txlist, wantGenTxNonce=None): payload = blkhdr payload += varlenEncode(len(txlist)) gentxdata = txlist[0].data assert gentxdata[4:6] != b'\0\1' if wantGenTxNonce: gentxdata = gentxdata[:4] + b'\0\1' + gentxdata[4:-4] + b'\x01\x20' + wantGenTxNonce + gentxdata[-4:] payload += gentxdata for tx in txlist[1:]: payload += tx.data return payload
def assembleBlock(blkhdr, txlist): payload = blkhdr payload += varlenEncode(len(txlist)) for tx in txlist: payload += tx.data return payload