forked from LBRYCommunity/lbry-sdk
support for old public key addresses
This commit is contained in:
parent
4e6bdb64a8
commit
62a3022a3d
1 changed files with 8 additions and 2 deletions
|
@ -273,11 +273,17 @@ class Output(InputOutput):
|
|||
|
||||
@property
|
||||
def pubkey_hash(self):
|
||||
return self.script.values['pubkey_hash']
|
||||
pubkey_hash = self.script.values.get('pubkey_hash')
|
||||
if pubkey_hash:
|
||||
return pubkey_hash
|
||||
return hash160(self.script.values['pubkey'])
|
||||
|
||||
@property
|
||||
def has_address(self):
|
||||
return 'pubkey_hash' in self.script.values
|
||||
return (
|
||||
'pubkey_hash' in self.script.values or
|
||||
'pubkey' in self.script.values
|
||||
)
|
||||
|
||||
def get_address(self, ledger):
|
||||
return ledger.hash160_to_address(self.pubkey_hash)
|
||||
|
|
Loading…
Reference in a new issue