mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
follow up previous commit
This commit is contained in:
parent
6e9b2a4459
commit
23f36ea080
1 changed files with 3 additions and 3 deletions
|
@ -335,8 +335,8 @@ def script_to_p2wsh(script):
|
||||||
|
|
||||||
|
|
||||||
def address_to_script(addr):
|
def address_to_script(addr):
|
||||||
if is_segwit_address(addr):
|
witver, witprog = segwit_addr.decode(SEGWIT_HRP, addr)
|
||||||
witver, witprog = segwit_addr.decode(SEGWIT_HRP, addr)
|
if witprog is not None:
|
||||||
assert (0 <= witver <= 16)
|
assert (0 <= witver <= 16)
|
||||||
OP_n = witver + 0x50 if witver > 0 else 0
|
OP_n = witver + 0x50 if witver > 0 else 0
|
||||||
script = bytes([OP_n]).hex()
|
script = bytes([OP_n]).hex()
|
||||||
|
@ -506,7 +506,7 @@ def address_from_private_key(sec):
|
||||||
|
|
||||||
def is_segwit_address(addr):
|
def is_segwit_address(addr):
|
||||||
witver, witprog = segwit_addr.decode(SEGWIT_HRP, addr)
|
witver, witprog = segwit_addr.decode(SEGWIT_HRP, addr)
|
||||||
return witver == 0
|
return witprog is not None and witver == 0
|
||||||
|
|
||||||
def is_b58_address(addr):
|
def is_b58_address(addr):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue