Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
1e9abhi1e10 committed Apr 8, 2024
1 parent 73d5d63 commit 031bc26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def detect_dust_and_double_spending(transactions):
valid_transactions = []

for tx in transactions:
if tx['value'] < DUST_THRESHOLD:
# Check if the 'value' key exists in the transaction
if 'value' in tx and tx['value'] < DUST_THRESHOLD:
continue

is_double_spent = False
Expand Down Expand Up @@ -84,6 +85,9 @@ def validate_redeem_script(transaction):
return True

def extract_and_verify_signatures(transaction):
if 'txid' not in transaction:
return False

for vin in transaction['vin']:
if 'scriptSig' in vin:
scriptSig = vin['scriptSig']
Expand Down

0 comments on commit 031bc26

Please sign in to comment.