File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ use spaces_wallet::bdk_wallet::{KeychainKind, Update};
11
11
use spaces_wallet:: bitcoin:: bip158:: BlockFilter ;
12
12
use spaces_wallet:: bitcoin:: ScriptBuf ;
13
13
use spaces_wallet:: SpacesWallet ;
14
- use crate :: calc_progress;
15
14
use crate :: client:: { BlockSource , BlockchainInfo } ;
16
15
use crate :: source:: BitcoinBlockSource ;
17
16
use crate :: wallets:: { WalletStatus , WalletProgressUpdate } ;
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ pub struct BlockchainInfo {
68
68
pub checkpoint : Option < ChainAnchor > ,
69
69
#[ serde( rename = "filtersprogress" , skip_serializing_if = "Option::is_none" ) ]
70
70
pub filters_progress : Option < f32 > ,
71
+ #[ serde( rename = "headerssynced" , skip_serializing_if = "Option::is_none" ) ]
72
+ pub headers_synced : Option < bool > ,
71
73
}
72
74
73
75
Original file line number Diff line number Diff line change @@ -255,7 +255,10 @@ impl BitcoinRpc {
255
255
retry_count += 1 ;
256
256
}
257
257
258
- Err ( last_error. expect ( "an error" ) )
258
+ Err ( last_error. unwrap_or ( BitcoinRpcError :: Rpc ( JsonRpcError {
259
+ code : -1 ,
260
+ message : "Tx broadcast timed out" . to_string ( ) ,
261
+ } ) ) )
259
262
}
260
263
261
264
async fn send_request (
@@ -323,7 +326,7 @@ impl BitcoinRpc {
323
326
}
324
327
}
325
328
326
- Err ( last_error. expect ( "an error" ) )
329
+ Err ( last_error. unwrap ( ) )
327
330
}
328
331
329
332
pub async fn clean_rpc_response (
Original file line number Diff line number Diff line change @@ -544,7 +544,8 @@ impl RpcWallet {
544
544
}
545
545
} ;
546
546
547
- if info. headers == 0 ||
547
+ if info. headers_synced . is_some_and ( |synced| !synced) ||
548
+ info. headers == 0 ||
548
549
info. prune_height . is_some_and ( |p| p > info. headers ) ||
549
550
protocol_tip. height > info. headers {
550
551
if let Some ( p) = progress {
@@ -1286,6 +1287,8 @@ impl RpcWallet {
1286
1287
}
1287
1288
}
1288
1289
1290
+ info ! ( "Ok got result: {}" , serde_json:: to_string_pretty( & result_set) ?) ;
1291
+
1289
1292
Ok ( WalletResponse { result : result_set } )
1290
1293
}
1291
1294
You can’t perform that action at this time.
0 commit comments