From 7ea7e7cec979f0c8869243656127eb7a03ad1a1a Mon Sep 17 00:00:00 2001 From: krzysobo Date: Fri, 26 Mar 2021 21:54:26 +0100 Subject: [PATCH] bitcoin.address_to_scripthash: add net param (#7143) closes #7141 --- electrum/bitcoin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/bitcoin.py b/electrum/bitcoin.py index bd107a7b5..64682dd4a 100644 --- a/electrum/bitcoin.py +++ b/electrum/bitcoin.py @@ -506,10 +506,11 @@ def address_to_hash(addr: str, *, net=None) -> Tuple[OnchainOutputType, bytes]: raise BitcoinException(f"unknown address type: {addrtype}") -def address_to_scripthash(addr: str) -> str: - script = address_to_script(addr) +def address_to_scripthash(addr: str, *, net=None) -> str: + script = address_to_script(addr, net=net) return script_to_scripthash(script) + def script_to_scripthash(script: str) -> str: h = sha256(bfh(script))[0:32] return bh2u(bytes(reversed(h)))