MCPcopy
hub / github.com/petertodd/python-bitcoinlib / gettxout

Method gettxout

bitcoin/rpc.py:637–654  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 6

b2lxFunction · 0.90
CTxOutClass · 0.90
CScriptClass · 0.90
lxFunction · 0.90
unhexlify_strFunction · 0.85
_callMethod · 0.45

Tested by

no test coverage detected