mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 08:51:08 +03:00
we want to avoid unwrap in get_server_stats (#3058)
This commit is contained in:
parent
ae556a8a2a
commit
b8946908ff
1 changed files with 3 additions and 3 deletions
|
@ -495,7 +495,7 @@ impl Server {
|
|||
stem_pool_size: self.tx_pool.read().stempool.entries.len(),
|
||||
};
|
||||
|
||||
let head = self.chain.head_header().unwrap();
|
||||
let head = self.chain.head_header()?;
|
||||
let head_stats = ChainStats {
|
||||
latest_timestamp: head.timestamp,
|
||||
height: head.height,
|
||||
|
@ -503,8 +503,8 @@ impl Server {
|
|||
total_difficulty: head.total_difficulty(),
|
||||
};
|
||||
|
||||
let header_tip = self.chain.header_head().unwrap();
|
||||
let header = self.chain.get_block_header(&header_tip.hash()).unwrap();
|
||||
let header_tip = self.chain.header_head()?;
|
||||
let header = self.chain.get_block_header(&header_tip.hash())?;
|
||||
let header_stats = ChainStats {
|
||||
latest_timestamp: header.timestamp,
|
||||
height: header.height,
|
||||
|
|
Loading…
Reference in a new issue