return dict in get_addr_utxo
This commit is contained in:
parent
9aa3f2d9e2
commit
332c5d41e6
|
@ -489,7 +489,7 @@ class Abstract_Wallet(PrintError):
|
||||||
coins, spent = self.get_addr_io(address)
|
coins, spent = self.get_addr_io(address)
|
||||||
for txi in spent:
|
for txi in spent:
|
||||||
coins.pop(txi)
|
coins.pop(txi)
|
||||||
out = []
|
out = {}
|
||||||
for txo, v in coins.items():
|
for txo, v in coins.items():
|
||||||
tx_height, value, is_cb = v
|
tx_height, value, is_cb = v
|
||||||
prevout_hash, prevout_n = txo.split(':')
|
prevout_hash, prevout_n = txo.split(':')
|
||||||
|
@ -501,7 +501,7 @@ class Abstract_Wallet(PrintError):
|
||||||
'height':tx_height,
|
'height':tx_height,
|
||||||
'coinbase':is_cb
|
'coinbase':is_cb
|
||||||
}
|
}
|
||||||
out.append(x)
|
out[txo] = x
|
||||||
return out
|
return out
|
||||||
|
|
||||||
# return the total amount ever received by an address
|
# return the total amount ever received by an address
|
||||||
|
@ -539,7 +539,7 @@ class Abstract_Wallet(PrintError):
|
||||||
domain = set(domain) - self.frozen_addresses
|
domain = set(domain) - self.frozen_addresses
|
||||||
for addr in domain:
|
for addr in domain:
|
||||||
utxos = self.get_addr_utxo(addr)
|
utxos = self.get_addr_utxo(addr)
|
||||||
for x in utxos:
|
for x in utxos.values():
|
||||||
if confirmed_only and x['height'] <= 0:
|
if confirmed_only and x['height'] <= 0:
|
||||||
continue
|
continue
|
||||||
if mature and x['coinbase'] and x['height'] + COINBASE_MATURITY > self.get_local_height():
|
if mature and x['coinbase'] and x['height'] + COINBASE_MATURITY > self.get_local_height():
|
||||||
|
@ -1061,10 +1061,8 @@ class Abstract_Wallet(PrintError):
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
coins = self.get_addr_utxo(address)
|
coins = self.get_addr_utxo(address)
|
||||||
for item in coins:
|
item = coins.get(txid+':%d'%i)
|
||||||
if item['prevout_hash'] == txid and item['prevout_n'] == i:
|
if not item:
|
||||||
break
|
|
||||||
else:
|
|
||||||
return
|
return
|
||||||
self.add_input_info(item)
|
self.add_input_info(item)
|
||||||
inputs = [item]
|
inputs = [item]
|
||||||
|
|
Loading…
Reference in New Issue