mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Balances now belong to accounts, and identities map to an account
This commit is contained in:
parent
333c90d46a
commit
b07bb7ba6b
8 changed files with 107 additions and 50 deletions
|
@ -111,8 +111,11 @@ def UpdateCoin(data):
|
|||
recipient = GetIdentityFromPaymentID(payment_id)
|
||||
if not recipient:
|
||||
raise RuntimeError('Payment ID %s not found' % payment_id)
|
||||
account = redis_hget('accounts',recipient)
|
||||
if accounts == None:
|
||||
raise RuntimeError('No account found for %s' % recipient)
|
||||
log_info('UpdateCoin: Found payment %s to %s for %s' % (tx_hash,recipient, AmountToString(amount)))
|
||||
cp.hincrby('confirming_payments',recipient,amount)
|
||||
cp.hincrby('confirming_payments',account,amount)
|
||||
except Exception,e:
|
||||
log_error('UpdateCoin: No identity found for payment id %s, tx hash %s, amount %s: %s' % (payment_id, tx_hash, amount, str(e)))
|
||||
payments=new_payments
|
||||
|
@ -135,8 +138,10 @@ def UpdateCoin(data):
|
|||
recipient = GetIdentityFromPaymentID(payment_id)
|
||||
if not recipient:
|
||||
raise RuntimeError('Payment ID %s not found' % payment_id)
|
||||
if accounts == None:
|
||||
raise RuntimeError('No account found for %s' % recipient)
|
||||
log_info('UpdateCoin: Found payment %s to %s for %s' % (tx_hash,recipient, AmountToString(amount)))
|
||||
pipe.hincrby("balances",recipient,amount)
|
||||
pipe.hincrby("balances",account,amount)
|
||||
pipe.sadd("processed_txs",tx_hash)
|
||||
except Exception,e:
|
||||
log_error('UpdateCoin: No identity found for payment id %s, tx hash %s, amount %s: %s' % (payment_id, tx_hash, amount, str(e)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue