transaction fix
This commit is contained in:
parent
f2074251e5
commit
97f919e435
@ -24,28 +24,38 @@ def transaction(self):
|
||||
|
||||
try:
|
||||
amount = float(amount)
|
||||
amount = round(amount, 2)
|
||||
except:
|
||||
print("Wrong input, try again")
|
||||
return False
|
||||
|
||||
if amount <= 0:
|
||||
utilityHelper.clearScreen()
|
||||
print(f"{utilityHelper.warningMessage('Transaction value needs to be above zero')}")
|
||||
return False
|
||||
fee = input("Enter fee:")
|
||||
if fee == "":
|
||||
return False
|
||||
|
||||
try:
|
||||
fee = float(fee)
|
||||
fee = round(fee, 2)
|
||||
except:
|
||||
print("Wrong input, try again")
|
||||
return False
|
||||
|
||||
utilityHelper.clearScreen()
|
||||
if fee < 0:
|
||||
utilityHelper.clearScreen()
|
||||
print(f"{utilityHelper.warningMessage('Transaction fee needs to be above zero or above')}")
|
||||
return False
|
||||
|
||||
print(f"Processing transaction of {amount + fee} coins, {receiver} will receive {amount} coins")
|
||||
utilityHelper.clearScreen()
|
||||
|
||||
if amount + fee > taskHelper.getBalanceWithOutgoingPool(self, taskHelper.getBalance(self)):
|
||||
print("You dont have enough money")
|
||||
return False
|
||||
|
||||
print(f"Processing transaction of {amount + fee} coins, {receiver} will receive {amount} coins")
|
||||
|
||||
new_tx = Tx()
|
||||
new_tx.createTransaction(self.user.public_ser, self.user.private_ser, amount, fee, receiver_data[1])
|
||||
return new_tx
|
||||
|
Loading…
x
Reference in New Issue
Block a user