mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 07:21:32 +02:00
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:
@@ -319,7 +319,12 @@ pub async fn height(
|
|||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
) -> Result<Json<GrinHeightResponse>, AppError> {
|
) -> Result<Json<GrinHeightResponse>, AppError> {
|
||||||
extract_user_id_from_token(&state, &headers).await?;
|
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 }))
|
Ok(Json(GrinHeightResponse { height }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user