1
0

rename crypto.Hash to sha256d

This commit is contained in:
SomberNight
2018-10-25 22:28:24 +02:00
parent a88a2dea82
commit 082a83dd85
11 changed files with 40 additions and 42 deletions

View File

@@ -27,7 +27,7 @@ from typing import Sequence, Optional, TYPE_CHECKING
import aiorpcx
from .util import bh2u, VerifiedTxInfo, NetworkJobOnDefaultServer
from .crypto import Hash
from .crypto import sha256d
from .bitcoin import hash_decode, hash_encode
from .transaction import Transaction
from .blockchain import hash_header
@@ -140,7 +140,7 @@ class SPV(NetworkJobOnDefaultServer):
raise MerkleVerificationFailure(e)
for i, item in enumerate(merkle_branch_bytes):
h = Hash(item + h) if ((leaf_pos_in_tree >> i) & 1) else Hash(h + item)
h = sha256d(item + h) if ((leaf_pos_in_tree >> i) & 1) else sha256d(h + item)
cls._raise_if_valid_tx(bh2u(h))
return hash_encode(h)