upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/build-explorer.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-explorer.py')
-rwxr-xr-xscripts/build-explorer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build-explorer.py b/scripts/build-explorer.py
index 0d86b3c..97a7f4e 100755
--- a/scripts/build-explorer.py
+++ b/scripts/build-explorer.py
@@ -35,7 +35,10 @@ def hash160(b):
35 35
36 36
37def spk_info(script_hex): 37def spk_info(script_hex):
38 spk = bytes.fromhex(script_hex) 38 try:
39 spk = bytes.fromhex(script_hex)
40 except ValueError:
41 return {"type": "malformed", "hex": script_hex[:80]}
39 if ( 42 if (
40 len(spk) == 25 and spk[0] == 0x76 and spk[1] == 0xA9 43 len(spk) == 25 and spk[0] == 0x76 and spk[1] == 0xA9
41 and spk[2] == 0x14 and spk[23] == 0x88 and spk[24] == 0xAC 44 and spk[2] == 0x14 and spk[23] == 0x88 and spk[24] == 0xAC