From 058d2c98f02c01cf91b0812a36f2d6e474b5153b Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 4 May 2020 10:47:18 +0800 Subject: [PATCH] Problem (Fix #1527): app version not set on the first startup Solution: - Set version in info handler regardless of state --- chain-abci/src/app/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain-abci/src/app/mod.rs b/chain-abci/src/app/mod.rs index 863a71a4b..341dc17bd 100644 --- a/chain-abci/src/app/mod.rs +++ b/chain-abci/src/app/mod.rs @@ -47,11 +47,11 @@ impl abci::Application for ChainNodeApp { fn info(&mut self, _req: &RequestInfo) -> ResponseInfo { info!("received info request"); let mut resp = ResponseInfo::new(); + resp.app_version = chain_core::APP_VERSION; + resp.version = get_version(); if let Some(app_state) = &self.last_state { resp.last_block_app_hash = app_state.last_apphash.to_vec(); resp.last_block_height = app_state.last_block_height.value().try_into().unwrap(); - resp.app_version = chain_core::APP_VERSION; - resp.version = get_version(); resp.data = serde_json::to_string(&app_state).expect("serialize app state to json"); } else { resp.last_block_app_hash = self.genesis_app_hash.to_vec();