summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/certtools.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 0ce8885..cbb4ff7 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -264,8 +264,11 @@ def next_merkle_layer(layer):
return [internal_hash(pair) for pair in chunks(layer, 2)]
def build_merkle_tree(layer0):
+ if len(layer0) == 0:
+ return [[hashlib.sha256().digest()]]
layers = []
current_layer = layer0
+ layers.append(current_layer)
while len(current_layer) > 1:
current_layer = next_merkle_layer(current_layer)
layers.append(current_layer)