global: adding support for safe lengths

This commit is contained in:
nym21
2026-05-06 15:33:07 +02:00
parent da7671744f
commit 086bfd9938
177 changed files with 2445 additions and 2049 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ impl BlockRoutes for ApiRouter<AppState> {
"/api/blocks/tip/height",
get_with(
async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State<AppState>| {
state.respond_text(&headers, CacheStrategy::Tip, &uri, |q| Ok(q.indexed_height().to_string())).await
state.respond_text(&headers, CacheStrategy::Tip, &uri, |q| Ok(q.height().to_string())).await
},
|op| {
op.id("get_block_tip_height")
+1 -2
View File
@@ -42,8 +42,7 @@ pub async fn handler(
Query(params): Query<SeriesSelection>,
State(state): State<AppState>,
) -> Result<Response> {
let mut response =
super::series::serve(state, uri, headers, params, legacy_bytes).await?;
let mut response = super::series::serve(state, uri, headers, params, legacy_bytes).await?;
if response.status() == StatusCode::OK {
response.headers_mut().insert_deprecation(SUNSET);
}
+1 -1
View File
@@ -33,7 +33,7 @@ impl ServerRoutes for ApiRouter<AppState> {
let tip_height = q
.client()
.get_last_height()
.unwrap_or(q.indexed_height());
.unwrap_or(q.height());
q.sync_status(tip_height)
})
.await