Skip to content

Commit d352c60

Browse files
arcbtctalvasconcelos
authored andcommitted
make
1 parent 5edc6de commit d352c60

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

views_api.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,16 @@ async def _get_watchonly_status(wallet) -> dict[str, Any]:
145145

146146
try:
147147
config = await fetch_watchonly_config(wallet.inkey)
148-
network = config.get("network")
148+
network_value = config.get("network")
149+
if not isinstance(network_value, str) or not network_value:
150+
raise HTTPException(
151+
status_code=HTTPStatus.BAD_REQUEST,
152+
detail="Watchonly extension returned an invalid network configuration.",
153+
)
154+
network = network_value
149155
wallets = await fetch_watchonly_wallets(wallet.inkey, network)
156+
except HTTPException:
157+
raise
150158
except Exception as exc:
151159
raise HTTPException(
152160
status_code=HTTPStatus.BAD_REQUEST,

0 commit comments

Comments
 (0)