1
0

show UTXOs in address tab

This commit is contained in:
ThomasV
2016-05-23 11:52:38 +02:00
parent 85aa633269
commit 18a2498b76
2 changed files with 38 additions and 27 deletions

View File

@@ -612,7 +612,20 @@ class Abstract_Wallet(PrintError):
coins, spent = self.get_addr_io(address)
for txi in spent:
coins.pop(txi)
return coins
out = []
for txo, v in coins.items():
tx_height, value, is_cb = v
prevout_hash, prevout_n = txo.split(':')
x = {
'address':address,
'value':value,
'prevout_n':int(prevout_n),
'prevout_hash':prevout_hash,
'height':tx_height,
'coinbase':is_cb
}
out.append(x)
return out
# return the total amount ever received by an address
def get_addr_received(self, address):
@@ -645,21 +658,11 @@ class Abstract_Wallet(PrintError):
if exclude_frozen:
domain = set(domain) - self.frozen_addresses
for addr in domain:
c = self.get_addr_utxo(addr)
for txo, v in c.items():
tx_height, value, is_cb = v
if is_cb and tx_height + COINBASE_MATURITY > self.get_local_height():
utxos = self.get_addr_utxo(addr)
for x in utxos:
if x['coinbase'] and x['tx_height'] + COINBASE_MATURITY > self.get_local_height():
continue
prevout_hash, prevout_n = txo.split(':')
output = {
'address':addr,
'value':value,
'prevout_n':int(prevout_n),
'prevout_hash':prevout_hash,
'height':tx_height,
'coinbase':is_cb
}
coins.append(output)
coins.append(x)
continue
return coins