Fixed Daemon.block bug for height=0 (#93)

If you called daemon.block(height=0) then the expression:

    if not height and not bhash:

Is `True` because 0 is falsey. I changed that line to a slightly more wordy, but more accurate:

    if height is None and bhash is None:
0.8.x
Jeffrey Ryan 3 years ago committed by GitHub
parent aa8bf90561
commit e4c35569ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -74,7 +74,7 @@ class Daemon(object):
:rtype: :class:`Block <monero.block.Block>`
"""
if not height and not bhash:
if height is None and bhash is None:
raise ValueError("Height or hash must be specified")
return self._backend.block(bhash=bhash, height=height)

Loading…
Cancel
Save