From ae9fc9301f25ec3e7ac915d5324b7136cf9d036b Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 6 Sep 2023 08:34:42 +0900 Subject: [PATCH 1/2] Fix missing conf status & fix TTL for bulk block txs endpoint --- src/rest.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rest.rs b/src/rest.rs index 6bc8cc8f..4447cd36 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -731,15 +731,17 @@ fn handle_request( } (&Method::GET, Some(&INTERNAL_PREFIX), Some(&"block"), Some(hash), Some(&"txs"), None) => { let hash = BlockHash::from_hex(hash)?; + let block_id = query.chain().blockid_by_hash(&hash); let txs = query .chain() .get_block_txs(&hash) .ok_or_else(|| HttpError::not_found("Block not found".to_string()))? .into_iter() - .map(|tx| (tx, None)) + .map(|tx| (tx, block_id.clone())) .collect(); - json_response(prepare_txs(txs, query, config), TTL_SHORT) + let ttl = ttl_by_depth(block_id.map(|b| b.height), query); + json_response(prepare_txs(txs, query, config), ttl) } (&Method::GET, Some(&"block"), Some(hash), Some(&"header"), None, None) => { let hash = BlockHash::from_hex(hash)?; From bc4ce1632f8262d3a61c1ad0320531edd08eb278 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 13 Nov 2023 15:08:20 +0900 Subject: [PATCH 2/2] ops: Use less threads for mainnet electrs pre-cache --- start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start b/start index 1305a865..fe9844a9 100755 --- a/start +++ b/start @@ -37,7 +37,7 @@ esac # which network? case "${1}" in mainnet) - THREADS=$((NPROC * 2)) + THREADS=$((NPROC * 1)) ;; testnet) NETWORK=testnet