Moved chain/cache building into separate function, and made sure that all REST API endpoints are using this function to get the state.

This commit is contained in:
Luke Anderson
2019-09-09 12:10:41 +10:00
parent a2267dc4d3
commit 99c673045c
6 changed files with 26 additions and 42 deletions

View File

@@ -30,7 +30,7 @@ pub fn get_prometheus<T: BeaconChainTypes + 'static>(req: Request<Body>) -> ApiR
let mut buffer = vec![];
let encoder = TextEncoder::new();
let beacon_chain = get_beacon_chain_from_request::<T>(&req)?;
let (beacon_chain, _head_state) = get_beacon_chain_from_request::<T>(&req)?;
let db_path = req
.extensions()
.get::<DBPath>()