Get the ScriptPubKey by looking up the tx hash Returns a Script object
(self, testnet=False)
| 459 | return tx.tx_outs[self.prev_index].amount |
| 460 | |
| 461 | def script_pubkey(self, testnet=False): |
| 462 | '''Get the ScriptPubKey by looking up the tx hash |
| 463 | Returns a Script object |
| 464 | ''' |
| 465 | # use self.fetch_tx to get the transaction |
| 466 | tx = self.fetch_tx(testnet=testnet) |
| 467 | # get the output at self.prev_index |
| 468 | # return the script_pubkey property |
| 469 | return tx.tx_outs[self.prev_index].script_pubkey |
| 470 | |
| 471 | |
| 472 | class TxOut: |