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

Method fundrawtransaction

bitcoin/rpc.py:385–405  ·  view source on GitHub ↗

Add inputs to a transaction until it has enough in value to meet its out value. include_watching - Also select inputs which are watch only Returns dict: {'tx': Resulting tx, 'fee': Fee the resulting transaction pays, 'changepos': Position of

(self, tx, include_watching=False)

Source from the content-addressed store, hash-verified

383 return CBitcoinSecret(r)
384
385 def fundrawtransaction(self, tx, include_watching=False):
386 """Add inputs to a transaction until it has enough in value to meet its out value.
387
388 include_watching - Also select inputs which are watch only
389
390 Returns dict:
391
392 {'tx': Resulting tx,
393 'fee': Fee the resulting transaction pays,
394 'changepos': Position of added change output, or -1,
395 }
396 """
397 hextx = hexlify_str(tx.serialize())
398 r = self._call('fundrawtransaction', hextx, include_watching)
399
400 r['tx'] = CTransaction.deserialize(unhexlify_str(r['hex']))
401 del r['hex']
402
403 r['fee'] = int(r['fee'] * COIN)
404
405 return r
406
407 def generate(self, numblocks):
408 """

Callers

nothing calls this directly

Calls 5

hexlify_strFunction · 0.85
unhexlify_strFunction · 0.85
serializeMethod · 0.45
_callMethod · 0.45
deserializeMethod · 0.45

Tested by

no test coverage detected