From f1f0b331ac97929579f33b0994e97c6b8b320bed Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Wed, 9 Sep 2020 22:05:47 -0700 Subject: [PATCH] state: make Response::Tip return (height, hash) --- zebra-consensus/src/chain.rs | 2 +- zebra-state/src/response.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zebra-consensus/src/chain.rs b/zebra-consensus/src/chain.rs index 35735836..58bff8ac 100644 --- a/zebra-consensus/src/chain.rs +++ b/zebra-consensus/src/chain.rs @@ -134,7 +134,7 @@ where zs::Response::Tip(tip) => tip, _ => unreachable!("wrong response to Request::Tip"), }; - let tip = if let Some(hash) = tip_hash { + let tip = if let Some((_height, hash)) = tip_hash { match state_service .ready_and() .await diff --git a/zebra-state/src/response.rs b/zebra-state/src/response.rs index 4f526f8b..df7f9f69 100644 --- a/zebra-state/src/response.rs +++ b/zebra-state/src/response.rs @@ -17,10 +17,10 @@ pub enum Response { Committed(block::Hash), /// Response to [`Request::Depth`] with the depth of the specified block. - Depth(Option), + Depth(Option), /// Response to [`Request::Tip`] with the current best chain tip. - Tip(Option), + Tip(Option<(block::Height, block::Hash)>), /// Response to [`Request::BlockLocator`] with a block locator object. BlockLocator(Vec),