fix(grin): serve the height endpoint through grin-lws like the rest

/wallet/grin/height called grin_client directly, skipping the grin_tip helper
declared immediately above it, which prefers grin-lws and falls back to
grin-wallet. It was the only Grin endpoint that could not be served by grin-lws
alone.

With GRIN_OWNER_API_URL empty, as it is in production, this failed while scan and
broadcast worked, so Grin read as half broken rather than as one path being
unwired. Scan already prefers grin-lws and broadcast goes to the node's foreign
API, so nothing else depended on the wallet.
This commit is contained in:
2026-09-12 19:32:14 -04:00
parent d04d1c789d
commit 1d7e1d5a78
+6 -1
View File
@@ -319,7 +319,12 @@ pub async fn height(
headers: HeaderMap,
) -> Result<Json<GrinHeightResponse>, AppError> {
extract_user_id_from_token(&state, &headers).await?;
let height = grin_client(&state)?.get_height().await?;
// Through grin_tip, which prefers grin-lws and falls back to grin-wallet.
// This called grin_client directly, so it was the one Grin endpoint that
// could not be served by grin-lws alone. With GRIN_OWNER_API_URL empty, as it
// is in production, it failed while scan and broadcast worked, which reads as
// Grin being half-broken rather than one path being unwired.
let height = grin_tip(&state).await?;
Ok(Json(GrinHeightResponse { height }))
}