Skip to content

Commit

Permalink
Fix typo in requirements.txt file name and bug on get_utxo.
Browse files Browse the repository at this point in the history
  • Loading branch information
sr-gi committed Nov 21, 2017
1 parent 86912e3 commit 326d113
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ parse_ldb(f_utxos)
# Parses transactions and utxos from the dumped data.
utxo_dump(f_utxos, f_parsed_utxos)

# Data is stored in f_utxos and f_parsed_utxos files respectivaly
# Data is stored in f_utxos and f_parsed_utxos files respectively
```


Expand Down
7 changes: 4 additions & 3 deletions bitcoin_tools/analysis/status/data_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,20 @@ def transaction_dump(fin_name, fout_name, version=0.15):
if utxo.get('tx_id') == tx.get('tx_id'):
tx['num_utxos'] += 1
tx['total_value'] += utxo.get('outs')[0].get('amount')
tx['total_len'] += (len(data["key"]) + 2 + len(data["value"])) / 2
tx['total_len'] += (len(data["key"]) + len(data["value"])) / 2

# Otherwise, we save the transaction data to the output file and start aggregating the next transaction data
else:
# Save previous transaction data
if len(tx) is not 0:
if tx:
fout.write(ujson.dumps(tx) + '\n')

# Create the new transaction
tx['tx_id'] = utxo.get('tx_id')
tx['num_utxos'] = 1
tx['total_value'] = utxo.get('outs')[0].get('amount')
tx['total_len'] = (len(data["key"]) + 2 + len(data["value"])) / 2
# ToDo: Add +2 for prefix?
tx['total_len'] = (len(data["key"]) + len(data["value"])) / 2
tx['height'] = utxo["height"]
tx['coinbase'] = utxo["coinbase"]
tx['version'] = None
Expand Down
4 changes: 2 additions & 2 deletions bitcoin_tools/analysis/status/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,13 @@ def get_utxo(tx_id, index, fin_name='chainstate', version=0.15):
coin = db.get(outpoint)

if coin is not None and o_key is not None:
coin = deobfuscate_value(o_key, coin)
coin = deobfuscate_value(o_key, hexlify(coin))

db.close()

# ToDO: Add code to return a single output for 0.8 - 0.14

return hexlify(outpoint), coin
return coin


def deobfuscate_value(obfuscation_key, value):
Expand Down
File renamed without changes.

0 comments on commit 326d113

Please sign in to comment.