+ txo.pubkey_hash property

This commit is contained in:
Lex Berezhny 2019-03-29 17:59:18 -04:00
parent aa93b94b61
commit 169ef00b9e

View file

@ -218,10 +218,12 @@ class BaseOutput(InputOutput):
def id(self): def id(self):
return self.ref.id return self.ref.id
@property
def pubkey_hash(self):
return self.script.values['pubkey_hash']
def get_address(self, ledger): def get_address(self, ledger):
return ledger.hash160_to_address( return ledger.hash160_to_address(self.pubkey_hash)
self.script.values['pubkey_hash']
)
def get_estimator(self, ledger): def get_estimator(self, ledger):
return self.estimator_class(ledger, self) return self.estimator_class(ledger, self)