From f090d8312a56c689a1dacc0b3818a06e2ec2dbc0 Mon Sep 17 00:00:00 2001 From: Gregory Hill Date: Tue, 10 Nov 2020 14:59:03 +0000 Subject: [PATCH] fix blocks matching in rest.rs Signed-off-by: Gregory Hill --- src/rest.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rest.rs b/src/rest.rs index 00a971df8..fbce52bf2 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -639,10 +639,13 @@ fn handle_request( TTL_SHORT, ), - (&Method::GET, Some(&"blocks"), start_height, None, None, None) => { - let start_height = start_height.and_then(|height| height.parse::().ok()); - blocks(&query, &config, start_height) + (&Method::GET, Some(&"blocks"), Some(height), None, None, None) => { + blocks(&query, &config, height.parse::().ok()) } + (&Method::GET, Some(&"blocks"), None, None, None, None) => { + blocks(&query, &config, None) + } + (&Method::GET, Some(&"block-height"), Some(height), None, None, None) => { let height = height.parse::()?; let header = query