mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-08 17:48:14 -07:00
global: adding support for safe lengths
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user