Get the ScriptPubKey by looking up the tx hash Returns a Script object
(self, testnet=False)
| 306 | return tx.tx_outs[self.prev_index].amount |
| 307 | |
| 308 | def script_pubkey(self, testnet=False): |
| 309 | '''Get the ScriptPubKey by looking up the tx hash |
| 310 | Returns a Script object |
| 311 | ''' |
| 312 | # use self.fetch_tx to get the transaction |
| 313 | tx = self.fetch_tx(testnet=testnet) |
| 314 | # get the output at self.prev_index |
| 315 | # return the script_pubkey property |
| 316 | return tx.tx_outs[self.prev_index].script_pubkey |
| 317 | |
| 318 | |
| 319 | class TxOut: |