mirror of
https://github.com/Steffo99/greed.git
synced 2025-03-13 12:17:27 +00:00
remove unneccesary satoshi
This commit is contained in:
parent
f5867405af
commit
1bcb243337
2 changed files with 2 additions and 5 deletions
2
core.py
2
core.py
|
@ -159,7 +159,7 @@ def callback():
|
|||
# Convert satoshi to fiat
|
||||
satoshi = float(flask.request.args.get("value"))
|
||||
received_btc = satoshi/1.0e8
|
||||
received_value = received_btc*transaction.price
|
||||
received_value = round(received_btc*transaction.price, 2)
|
||||
print ("Recieved "+str(received_value)+" "+configloader.config["Payments"]["currency"]+" on address "+address)
|
||||
# Add the credit to the user account
|
||||
user = dbsession.query(db.User).filter(db.User.user_id == transaction.user_id).one_or_none()
|
||||
|
|
|
@ -281,13 +281,12 @@ class ChatWorker(threading.Thread):
|
|||
if status >= 0:
|
||||
# Convert satoshi to fiat
|
||||
received_btc = value/1.0e8
|
||||
received_value = received_btc*transaction.price
|
||||
received_value = round(received_btc*transaction.price, 2)
|
||||
|
||||
# Add the credit to the user account
|
||||
user = self.session.query(db.User).filter(db.User.user_id == transaction.user_id).one_or_none()
|
||||
user.credit += received_value
|
||||
# Update the value + status + timestamp for transaction in DB
|
||||
transaction.satoshi = value
|
||||
transaction.value += received_value
|
||||
transaction.status = 2
|
||||
# Add a transaction to list
|
||||
|
@ -836,7 +835,6 @@ class ChatWorker(threading.Thread):
|
|||
btc_address = transaction.address
|
||||
# Update btc_price, satoshi, currency, timestamp
|
||||
transaction.btc_price = btc_price
|
||||
transaction.satoshi = satoshi_amount
|
||||
transaction.currency = configloader.config["Payments"]["currency"]
|
||||
transaction.timestamp = datetime.datetime.now()
|
||||
else:
|
||||
|
@ -845,7 +843,6 @@ class ChatWorker(threading.Thread):
|
|||
new_transaction = db.BtcTransaction(user=self.user,
|
||||
price = btc_price,
|
||||
value=0,
|
||||
satoshi = satoshi_amount,
|
||||
currency = configloader.config["Payments"]["currency"],
|
||||
status = -1,
|
||||
timestamp = datetime.datetime.now(),
|
||||
|
|
Loading…
Add table
Reference in a new issue