def get_balance(self, addr): bc = BlockChain() balance = 0 utxo = UTXOSet() utxo.reindex(bc) utxos = utxo.find_utxo(addr) print(utxos) for fout in utxos: balance += fout.txoutput.value print('%s balance is %d' % (addr, balance)) return balance
def _find_unspent_transactions(self, address): """ Find all unspent transactions """ uxto_set = UTXOSet() uxto_set.find_utxo(address)