Skip to content

Commit

Permalink
Merge branch 'mempool' into mononaut/bulk-outspends
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz authored Nov 13, 2023
2 parents c2fc64b + bc4ce16 commit 33d2a01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion start
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ esac
# which network?
case "${1}" in
mainnet)
THREADS=$((NPROC * 2))
THREADS=$((NPROC * 1))
;;
testnet)
NETWORK=testnet
Expand Down

0 comments on commit 33d2a01

Please sign in to comment.