File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,6 +296,28 @@ def dumpprivkey(self, addr):
296296
297297 return CBitcoinSecret (r )
298298
299+ def fundrawtransaction (self , tx , include_watching = False ):
300+ """Add inputs to a transaction until it has enough in value to meet its out value.
301+
302+ include_watching - Also select inputs which are watch only
303+
304+ Returns dict:
305+
306+ {'tx': Resulting tx,
307+ 'fee': Fee the resulting transaction pays,
308+ 'changepos': Position of added change output, or -1,
309+ }
310+ """
311+ hextx = hexlify (tx .serialize ())
312+ r = self ._call ('fundrawtransaction' , hextx , include_watching )
313+
314+ r ['tx' ] = CTransaction .deserialize (unhexlify (r ['hex' ]))
315+ del r ['hex' ]
316+
317+ r ['fee' ] = int (r ['fee' ] * COIN )
318+
319+ return r
320+
299321 def getaccountaddress (self , account = None ):
300322 """Return the current Bitcoin address for receiving payments to this
301323 account."""
You can’t perform that action at this time.
0 commit comments