harden pipeline against dropped connections; publish fee-aware sharps

- get_json: catch OSError + http.client.HTTPException (RemoteDisconnected/
  IncompleteRead escaped the retry loop and killed last night's validate_timing
  run on a single dropped keep-alive).
- validate_timing: per-wallet retry+exclude guard so one bad wallet can't take
  out the whole selection; regenerated watch_sharps.json — the first fee-aware,
  resolved-only sharp list (10 copy-positive holders of 254).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jaxperro
2026-07-02 09:15:42 -04:00
parent 0f6d308eec
commit 29a4bcca9e
3 changed files with 205 additions and 183 deletions
+6 -1
View File
@@ -9,6 +9,7 @@ Run a terminal scan: python3 smart_money.py --scan
"""
import argparse
import http.client
import json
import ssl
import sys
@@ -70,7 +71,11 @@ def get_json(path, params=None, retries=2):
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=15, context=SSL_CTX) as r:
return json.loads(r.read().decode())
except (urllib.error.URLError, TimeoutError, json.JSONDecodeError):
except (OSError, http.client.HTTPException, json.JSONDecodeError):
# OSError covers URLError/timeouts/connection-resets; HTTPException
# covers RemoteDisconnected/IncompleteRead — the latter used to escape
# the retry loop and crash whole pipeline runs (validate_timing died
# mid-scan on one dropped keep-alive connection).
if attempt == retries:
return None
time.sleep(1 + attempt)