From 6a5ebdf918b94c949f4bc48276a7f29bed7c517f Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Sat, 13 May 2017 21:25:59 -0700 Subject: [PATCH] Set fee for sweeping coinbase txs --- pyZcash/rpc/ZDaemon.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyZcash/rpc/ZDaemon.py b/pyZcash/rpc/ZDaemon.py index c26cd1c..62d4280 100644 --- a/pyZcash/rpc/ZDaemon.py +++ b/pyZcash/rpc/ZDaemon.py @@ -108,8 +108,9 @@ class ZDaemon(object): if 'generated' in tx and tx['generated'] == True: cb.append(utxo) for coin in cb: - amount = coin['amount'] - 0.0001 - opid = self.z_sendmany(coin['address'], zaddr, amount) + fee = 0.0005 + amount = coin['amount'] + opid = self.z_sendmany(coin['address'], zaddr, amount, '', fee) print "OPID of z_sendmany: ", opid status = self.z_getoperationstatus(opid) print "Status: ", status[0]['status'] @@ -134,7 +135,7 @@ class ZDaemon(object): return self._call('z_getoperationresult', ["{0}".format(opid)]) # With addition of encrypted memo field - def z_sendmany(self, sender, receiver, amount=0.0001, memo=''): + def z_sendmany(self, sender, receiver, amount=0.0001, memo='', fee=0.0001): amts_array = [] if memo == '': amounts = {"address": receiver, "amount": amount} @@ -142,4 +143,4 @@ class ZDaemon(object): memo = memo.encode('hex') amounts = {"address": receiver, "amount": amount, "memo": memo} amts_array.append(amounts) - return self._call('z_sendmany', sender, amts_array) + return self._call('z_sendmany', sender, amts_array, 1, fee)