1- use std:: { sync:: { Arc } , io:: { Result , Error , ErrorKind } } ;
1+ use std:: { sync:: { Arc } , io} ;
22
33use bitcoin:: { BlockHash , Block } ;
44use lightning_block_sync:: { rpc:: RpcClient , http:: { HttpEndpoint } , BlockSource , AsyncBlockSourceResult , BlockHeaderData } ;
@@ -44,7 +44,7 @@ impl BlockSource for &BitcoindClient {
4444}
4545
4646impl BitcoindClient {
47- pub async fn new ( host : String , port : u16 , rpc_user : String , rpc_password : String ) -> Result < Self > {
47+ pub async fn new ( host : String , port : u16 , rpc_user : String , rpc_password : String ) -> io :: Result < Self > {
4848 let http_endpoint = HttpEndpoint :: for_host ( host. clone ( ) ) . with_port ( port) ;
4949 let rpc_creditials =
5050 base64:: encode ( format ! ( "{}:{}" , rpc_user. clone( ) , rpc_password. clone( ) ) ) ;
@@ -53,7 +53,7 @@ impl BitcoindClient {
5353 . call_method :: < BlockchainInfoResponse > ( "getblockchaininfo" , & vec ! [ ] )
5454 . await
5555 . map_err ( |_| {
56- Error :: new ( ErrorKind :: PermissionDenied ,
56+ io :: Error :: new ( io :: ErrorKind :: PermissionDenied ,
5757 "Failed to make initial call to bitcoind - please check your RPC user/password and access settings" )
5858 } ) ?;
5959
@@ -68,7 +68,7 @@ impl BitcoindClient {
6868 Ok ( client)
6969 }
7070
71- pub fn get_new_rpc_client ( & self ) -> Result < RpcClient > {
71+ pub fn get_new_rpc_client ( & self ) -> io :: Result < RpcClient > {
7272 let http_endpoint = HttpEndpoint :: for_host ( self . host . clone ( ) ) . with_port ( self . port ) ;
7373 let rpc_credentials =
7474 base64:: encode ( format ! ( "{}:{}" , self . rpc_user. clone( ) , self . rpc_password. clone( ) ) ) ;
0 commit comments