+ convert float to decimal for wallet_send

This commit is contained in:
Lex Berezhny 2018-08-09 19:14:56 -04:00
parent d4a7dbf805
commit 1098ca0494

View file

@ -2416,6 +2416,12 @@ class Daemon(AuthJSONRPCServer):
raise Exception("Given both an address and a claim id") raise Exception("Given both an address and a claim id")
elif not address and not claim_id: elif not address and not claim_id:
raise Exception("Not given an address or a claim id") raise Exception("Not given an address or a claim id")
try:
amount = Decimal(str(amount))
except InvalidOperation:
raise TypeError("Amount does not represent a valid decimal.")
if amount < 0: if amount < 0:
raise NegativeFundsError() raise NegativeFundsError()
elif not amount: elif not amount: