fix: offline signing
This commit is contained in:
@@ -432,10 +432,12 @@ class Transaction:
|
|||||||
pubkeys = txin['pubkeys']
|
pubkeys = txin['pubkeys']
|
||||||
if not txin.get('redeemScript'):
|
if not txin.get('redeemScript'):
|
||||||
pubkey = pubkeys[0]
|
pubkey = pubkeys[0]
|
||||||
sig = signatures[0]
|
script = ''
|
||||||
sig = sig + '01' # hashtype
|
if signatures:
|
||||||
script = op_push(len(sig)/2)
|
sig = signatures[0]
|
||||||
script += sig
|
sig = sig + '01' # hashtype
|
||||||
|
script += op_push(len(sig)/2)
|
||||||
|
script += sig
|
||||||
script += op_push(len(pubkey)/2)
|
script += op_push(len(pubkey)/2)
|
||||||
script += pubkey
|
script += pubkey
|
||||||
else:
|
else:
|
||||||
@@ -720,6 +722,7 @@ class Transaction:
|
|||||||
for i, txin in enumerate(self.inputs):
|
for i, txin in enumerate(self.inputs):
|
||||||
item = input_info[i]
|
item = input_info[i]
|
||||||
txin['address'] = item['address']
|
txin['address'] = item['address']
|
||||||
|
txin['signatures'] = item['signatures']
|
||||||
txin['scriptPubKey'] = item['scriptPubKey']
|
txin['scriptPubKey'] = item['scriptPubKey']
|
||||||
txin['redeemScript'] = item.get('redeemScript')
|
txin['redeemScript'] = item.get('redeemScript')
|
||||||
txin['redeemPubkey'] = item.get('redeemPubkey')
|
txin['redeemPubkey'] = item.get('redeemPubkey')
|
||||||
|
|||||||
Reference in New Issue
Block a user