1
0

Merge pull request #2872 from SomberNight/p2pk_output_1

fix: p2pk output serialisation
This commit is contained in:
ThomasV
2017-09-15 11:54:53 +02:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -624,10 +624,9 @@ class Transaction:
elif output_type == TYPE_ADDRESS:
return bitcoin.address_to_script(addr)
elif output_type == TYPE_PUBKEY:
return addr
return bitcoin.public_key_to_p2pk_script(addr)
else:
raise TypeError('Unknown output type')
return script
@classmethod
def get_siglist(self, txin, estimate_size=False):
@@ -714,6 +713,9 @@ class Transaction:
pubkey = txin['pubkeys'][0]
pkh = bh2u(bitcoin.hash_160(bfh(pubkey)))
return '76a9' + push_script(pkh) + '88ac'
elif txin['type'] == 'p2pk':
pubkey = txin['pubkeys'][0]
return bitcoin.public_key_to_p2pk_script(pubkey)
else:
raise TypeError('Unknown txin type', txin['type'])