updating tip verification

master
lza_menace 2 years ago
parent a993eed760
commit 1481958712

@ -7,6 +7,7 @@ from os import path, makedirs
from urllib.request import urlopen from urllib.request import urlopen
from monero.exceptions import TransactionNotFound from monero.exceptions import TransactionNotFound
from monero.numbers import from_atomic
from nerochan.helpers import make_wallet_rpc, get_daemon from nerochan.helpers import make_wallet_rpc, get_daemon
from nerochan.models import User, Artwork, Transaction from nerochan.models import User, Artwork, Transaction
@ -59,7 +60,7 @@ def cli(app):
} }
try: try:
res = make_wallet_rpc('check_tx_key', data) res = make_wallet_rpc('check_tx_key', data)
print(res) print(f'Found tx data from wallet for tx {tx.tx_id}: {res}')
if res['received'] == 0: if res['received'] == 0:
click.echo(f'[tx-{tx.id}] Key and tx are correct, but found XMR amount of 0. User must have selected the wrong post.') click.echo(f'[tx-{tx.id}] Key and tx are correct, but found XMR amount of 0. User must have selected the wrong post.')
continue continue
@ -70,7 +71,7 @@ def cli(app):
tx.tx_date = d tx.tx_date = d
tx.verified = True tx.verified = True
tx.save() tx.save()
click.echo(f'[+] Found valid tip {tx.tx_id}') click.echo(f'[+] Saved valid tip {tx.tx_id} ({from_atomic(tx.atomic_xmr)} XMR)')
except TransactionNotFound as e: except TransactionNotFound as e:
print(f'Transaction not found for tx #{tx.id}: {tx.tx_id}') print(f'Transaction not found for tx #{tx.id}: {tx.tx_id}')
except Exception as e: except Exception as e:

Loading…
Cancel
Save