Return details about an unspent transaction output. Raises IndexError if outpoint is not found or was spent. includemempool - Include mempool txouts
(self, outpoint, includemempool=True)
| 635 | return r |
| 636 | |
| 637 | def gettxout(self, outpoint, includemempool=True): |
| 638 | """Return details about an unspent transaction output. |
| 639 | |
| 640 | Raises IndexError if outpoint is not found or was spent. |
| 641 | |
| 642 | includemempool - Include mempool txouts |
| 643 | """ |
| 644 | r = self._call('gettxout', b2lx(outpoint.hash), outpoint.n, includemempool) |
| 645 | |
| 646 | if r is None: |
| 647 | raise IndexError('%s.gettxout(): unspent txout %r not found' % (self.__class__.__name__, outpoint)) |
| 648 | |
| 649 | r['txout'] = CTxOut(int(r['value'] * COIN), |
| 650 | CScript(unhexlify_str(r['scriptPubKey']['hex']))) |
| 651 | del r['value'] |
| 652 | del r['scriptPubKey'] |
| 653 | r['bestblock'] = lx(r['bestblock']) |
| 654 | return r |
| 655 | |
| 656 | def importaddress(self, addr, label='', rescan=True): |
| 657 | """Adds an address or pubkey to wallet without the associated privkey.""" |