Return None from addresses.encodeBase58() for negative number

This commit is contained in:
Dmitri Bogomolov 2021-11-04 15:33:54 +02:00
parent 93c7cfbf63
commit b3577a09e5
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -20,6 +20,8 @@ def encodeBase58(num, alphabet=ALPHABET):
num: The number to encode
alphabet: The alphabet to use for encoding
"""
if num < 0:
return None
if num == 0:
return alphabet[0]
arr = []