Fix approximations in bid during publish

This commit is contained in:
hackrush 2018-06-18 10:39:47 -04:00
parent db15169ca6
commit 371b27b116
2 changed files with 7 additions and 11 deletions

View file

@ -17,6 +17,7 @@ at anytime.
* fixed a race condition when inserting a blob into the database (https://github.com/lbryio/lbry/issues/1129)
* reflector server incorrectly responding as if it has all the blobs for a stream that was only partially uploaded to it
* `publish` raising a database error when updating a claim that we don't have a file for (https://github.com/lbryio/lbry/issues/1165)
* approximations of bid when cast from float to Decimal during publish
### Deprecated
*

View file

@ -2038,15 +2038,10 @@ class Daemon(AuthJSONRPCServer):
except (TypeError, URIParseError):
raise Exception("Invalid name given to publish")
if isinstance(bid, (float, int)):
bid = Decimal(bid)
elif isinstance(bid, six.string_types):
try:
bid = Decimal(bid)
bid = Decimal(str(bid))
except InvalidOperation:
raise TypeError("Bid does not represent a valid decimal.")
else:
raise TypeError("Bid must be a decimal number represented by a string.")
if bid <= 0.0:
raise ValueError("Bid value must be greater than 0.0")