Skip to content

Commit

Permalink
wip fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguida committed Nov 11, 2023
1 parent 2380612 commit db2d980
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::fs::File;
use std::io::{BufRead, BufReader};
use std::iter::FromIterator;
use std::path::PathBuf;
use std::time::Duration;
use std::{fmt, result};

use crate::{bitcoin, deserialize_hex};
Expand Down Expand Up @@ -1288,7 +1289,16 @@ impl Client {
/// Can only return [Err] when using cookie authentication.
pub fn new(url: &str, auth: Auth) -> Result<Self> {
let (user, pass) = auth.get_user_pass()?;
jsonrpc::client::Client::simple_http(url, user, pass)
jsonrpc::client::Client::simple_http(url, user, pass, None)
.map(|client| Client {
client,
})
.map_err(|e| super::error::Error::JsonRpc(e.into()))
}

pub fn new_with_timeout(url: &str, auth: Auth, timeout: Duration) -> Result<Self> {
let (user, pass) = auth.get_user_pass()?;
jsonrpc::client::Client::simple_http(url, user, pass, Some(timeout))
.map(|client| Client {
client,
})
Expand Down

0 comments on commit db2d980

Please sign in to comment.