tUse existing utility function in merkle_branch. - obelisk - Electrum server using libbitcoin as its backend
HTML git clone https://git.parazyd.org/obelisk
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 30bc9d97db280a915f0e0c659451b519421a4f40
DIR parent 5e0b35e36786438d6a6c6165aa7df887bd211a02
HTML Author: parazyd <parazyd@dyne.org>
Date: Fri, 16 Apr 2021 01:44:03 +0200
Use existing utility function in merkle_branch.
Diffstat:
M obelisk/merkle.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
DIR diff --git a/obelisk/merkle.py b/obelisk/merkle.py
t@@ -17,7 +17,7 @@
"""Module for calculating merkle branches"""
from math import ceil, log
-from obelisk.util import double_sha256
+from obelisk.util import double_sha256, hash_to_hex_str
def branch_length(hash_count):
t@@ -64,5 +64,4 @@ def merkle_branch_and_root(hashes, index, length=None):
def merkle_branch(tx_hashes, tx_pos):
"""Return a merkle branch given hashes and the tx position"""
branch, _ = merkle_branch_and_root(tx_hashes, tx_pos)
- branch = [bytes(reversed(h)).hex() for h in branch]
- return branch
+ return [hash_to_hex_str(h) for h in branch]