Skip to content

Commit 8081b84

Browse files
committed
[Bug] Fix ParseTxOutput: add addresses only for P2PKH, P2PK
1 parent 32d8cd8 commit 8081b84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pivx_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def ParseTxOutput(p, isTestnet=False):
7272
vout["scriptPubKey"]["addresses"] = []
7373
try:
7474
locking_script = bytes.fromhex(vout["scriptPubKey"]["hex"])
75-
if len(locking_script) > 0:
75+
# add addresses only if P2PKH or P2PK
76+
if len(locking_script) in [25, 35]:
7677
add_bytes = extract_pkh_from_locking_script(locking_script)
7778
address = pubkeyhash_to_address(add_bytes, isTestnet)
7879
vout["scriptPubKey"]["addresses"].append(address)

0 commit comments

Comments
 (0)