Check for coinbase in find_taddr_with_unspent
This commit is contained in:
parent
b8a1964e5a
commit
ad6cc8ebdb
|
@ -89,11 +89,14 @@ class ZDaemon(object):
|
||||||
return self._call('listunspent')
|
return self._call('listunspent')
|
||||||
|
|
||||||
# Custom method to find a taddr with spendable utxos for z_sendmany
|
# Custom method to find a taddr with spendable utxos for z_sendmany
|
||||||
def findTaddrWithUnspent(self):
|
def find_taddr_with_unspent(self):
|
||||||
unspent = self._call('listunspent')
|
unspent = self._call('listunspent')
|
||||||
for tx in unspent:
|
for utxo in unspent:
|
||||||
if tx['spendable'] == True and tx['amount'] > 0.1:
|
if utxo['spendable'] == True and utxo['amount'] > 0.1:
|
||||||
return tx['address']
|
# Check that it's not a coinbase tx
|
||||||
|
tx = zd.gettransaction(utxo['txid'])
|
||||||
|
if 'generated' not in tx:
|
||||||
|
return tx['address']
|
||||||
|
|
||||||
# zaddr methods
|
# zaddr methods
|
||||||
def z_getnewaddress(self):
|
def z_getnewaddress(self):
|
||||||
|
|
Loading…
Reference in New Issue