Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Feb 17, 2025
1 parent f7490e7 commit 602f508
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions zebra-rpc/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,12 @@ where
AddressBook: AddressBookPeers + Clone + Send + Sync + 'static,
{
async fn get_info(&self) -> Result<GetInfo> {
let version = GetInfo::version(&self.build_version).ok_or(ErrorObject::owned(
server::error::LegacyCode::Misc.into(),
"invalid version string",
None::<()>,
))?;
let version = GetInfo::version(&self.build_version).expect("invalid version string");

let connections = self.address_book.recently_live_peers(Utc::now()).len();

let last_error_recorded = self.last_warn_error_log_rx.borrow().clone();
let (last_event, _last_event_level, last_event_time) = last_error_recorded.unwrap_or((
let (last_error_log, _level, last_error_log_time) = last_error_recorded.unwrap_or((
GetInfo::default().errors,
tracing::Level::INFO,
Utc::now(),
Expand Down Expand Up @@ -613,8 +609,8 @@ where
testnet,
pay_tx_fee,
relay_fee,
errors: last_event,
errors_timestamp: last_event_time.to_string(),
errors: last_error_log,
errors_timestamp: last_error_log_time.to_string(),
};

Ok(response)
Expand Down

0 comments on commit 602f508

Please sign in to comment.