From b3577a09e5d72170a0a9092e0bfe92bed2f10ba8 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 4 Nov 2021 15:33:54 +0200 Subject: [PATCH] Return None from addresses.encodeBase58() for negative number --- src/addresses.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/addresses.py b/src/addresses.py index 560849df..abeeeb49 100644 --- a/src/addresses.py +++ b/src/addresses.py @@ -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 = []