mirror of
https://github.com/LORDBABUINO/stealth.git
synced 2026-07-02 23:08:55 -07:00
feat: auto-expand descriptor to both /0/* and /1/* variants
When a descriptor is passed directly, strip its checksum, derive the missing external/internal counterpart, and normalize both through getdescriptorinfo before importing — matching the full address set that --wallet produces.
This commit is contained in:
@@ -77,13 +77,25 @@ def resolve_descriptors(args):
|
|||||||
"range_end": d.get("range", [0, 999])[1] if isinstance(d.get("range"), list) else d.get("range", 999),
|
"range_end": d.get("range", [0, 999])[1] if isinstance(d.get("range"), list) else d.get("range", 999),
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
for d in args.descriptors:
|
for raw in args.descriptors:
|
||||||
descs.append({
|
base = raw.split("#")[0]
|
||||||
"desc": d,
|
if "/0/*" in base:
|
||||||
"internal": "/1/*" in d,
|
candidates = [(base, False), (base.replace("/0/*", "/1/*"), True)]
|
||||||
"active": True,
|
elif "/1/*" in base:
|
||||||
"range_end": 999,
|
candidates = [(base.replace("/1/*", "/0/*"), False), (base, True)]
|
||||||
})
|
else:
|
||||||
|
candidates = [(base, False)]
|
||||||
|
for desc, internal in candidates:
|
||||||
|
try:
|
||||||
|
normalized = cli("getdescriptorinfo", desc)["descriptor"]
|
||||||
|
except Exception:
|
||||||
|
normalized = desc
|
||||||
|
descs.append({
|
||||||
|
"desc": normalized,
|
||||||
|
"internal": internal,
|
||||||
|
"active": True,
|
||||||
|
"range_end": 999,
|
||||||
|
})
|
||||||
return descs
|
return descs
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user