fix hash in make_offered_htlc
This commit is contained in:
@@ -198,16 +198,18 @@ def sha256d(x: Union[bytes, str]) -> bytes:
|
||||
|
||||
|
||||
def hash_160(x: bytes) -> bytes:
|
||||
return ripemd(sha256(public_key))
|
||||
|
||||
def ripemd(x):
|
||||
try:
|
||||
md = hashlib.new('ripemd160')
|
||||
md.update(sha256(x))
|
||||
md.update(x)
|
||||
return md.digest()
|
||||
except BaseException:
|
||||
from . import ripemd
|
||||
md = ripemd.new(sha256(x))
|
||||
md = ripemd.new(x)
|
||||
return md.digest()
|
||||
|
||||
|
||||
def hmac_oneshot(key: bytes, msg: bytes, digest) -> bytes:
|
||||
if hasattr(hmac, 'digest'):
|
||||
# requires python 3.7+; faster
|
||||
|
||||
Reference in New Issue
Block a user