File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,28 @@ def dumpprivkey(self, addr):
296
296
297
297
return CBitcoinSecret (r )
298
298
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
+
299
321
def getaccountaddress (self , account = None ):
300
322
"""Return the current Bitcoin address for receiving payments to this
301
323
account."""
You can’t perform that action at this time.
0 commit comments