mirror of
https://git.wownero.com/lza_menace/suchwow.git
synced 2024-08-15 01:03:19 +00:00
change how tips are processed - per user
This commit is contained in:
parent
faebd00fd5
commit
159504f703
1 changed files with 7 additions and 6 deletions
|
@ -55,18 +55,19 @@ def generate_data():
|
||||||
@bp.cli.command('process_tips')
|
@bp.cli.command('process_tips')
|
||||||
def process_tips():
|
def process_tips():
|
||||||
w = wownero.Wallet()
|
w = wownero.Wallet()
|
||||||
for post in Post.select().order_by(Post.timestamp.desc()):
|
for user in User.select().order_by(User.id.desc()):
|
||||||
print(f'Checking new tips for post {post.id}')
|
user_posts = Post.select().where(Post.user == user)
|
||||||
txes = w.transfers(config.WALLET_ACCOUNT, [post.address_index])
|
if user_posts.count() == 0:
|
||||||
addr = w.get_address(config.WALLET_ACCOUNT, [post.address_index])
|
|
||||||
if post.address != addr['addresses'][0]['address']:
|
|
||||||
print(f'addresses dont match. skipping.')
|
|
||||||
continue
|
continue
|
||||||
|
addresses = [i.address_index for i in user_posts]
|
||||||
|
txes = w.transfers(config.WALLET_ACCOUNT, addresses)
|
||||||
if txes:
|
if txes:
|
||||||
for tx in txes['in']:
|
for tx in txes['in']:
|
||||||
if tx['unlock_time'] > 0:
|
if tx['unlock_time'] > 0:
|
||||||
print('someone added a lock time to this tx. skipping for now.')
|
print('someone added a lock time to this tx. skipping for now.')
|
||||||
continue
|
continue
|
||||||
|
if tx['confirmations'] < 5:
|
||||||
|
continue
|
||||||
_tx = TipReceived.select().where(TipReceived.txid == tx['txid']).first()
|
_tx = TipReceived.select().where(TipReceived.txid == tx['txid']).first()
|
||||||
if not _tx:
|
if not _tx:
|
||||||
post = Post.select().where(Post.address == tx['address']).first()
|
post = Post.select().where(Post.address == tx['address']).first()
|
||||||
|
|
Loading…
Reference in a new issue