@@ -35,7 +35,7 @@ use io::{TimerToken, IoContext, IoHandler};
35
35
use light:: Cache as LightDataCache ;
36
36
use light:: client:: { LightChainClient , LightChainNotify } ;
37
37
use number_prefix:: { binary_prefix, Standalone , Prefixed } ;
38
- use parity_rpc:: { is_major_importing } ;
38
+ use parity_rpc:: is_major_importing_or_waiting ;
39
39
use parity_rpc:: informant:: RpcStats ;
40
40
use ethereum_types:: H256 ;
41
41
use bytes:: Bytes ;
@@ -128,7 +128,7 @@ impl InformantData for FullNodeInformantData {
128
128
129
129
fn is_major_importing ( & self ) -> bool {
130
130
let state = self . sync . as_ref ( ) . map ( |sync| sync. status ( ) . state ) ;
131
- is_major_importing ( state, self . client . queue_info ( ) )
131
+ is_major_importing_or_waiting ( state, self . client . queue_info ( ) , false )
132
132
}
133
133
134
134
fn report ( & self ) -> Report {
@@ -142,24 +142,24 @@ impl InformantData for FullNodeInformantData {
142
142
cache_sizes. insert ( "queue" , queue_info. mem_used ) ;
143
143
cache_sizes. insert ( "chain" , blockchain_cache_info. total ( ) ) ;
144
144
145
- let ( importing, sync_info) = match ( self . sync . as_ref ( ) , self . net . as_ref ( ) ) {
145
+ let importing = self . is_major_importing ( ) ;
146
+ let sync_info = match ( self . sync . as_ref ( ) , self . net . as_ref ( ) ) {
146
147
( Some ( sync) , Some ( net) ) => {
147
148
let status = sync. status ( ) ;
148
149
let num_peers_range = net. num_peers_range ( ) ;
149
150
debug_assert ! ( num_peers_range. end > num_peers_range. start) ;
150
151
151
152
cache_sizes. insert ( "sync" , status. mem_used ) ;
152
153
153
- let importing = is_major_importing ( Some ( status. state ) , queue_info. clone ( ) ) ;
154
- ( importing, Some ( SyncInfo {
154
+ Some ( SyncInfo {
155
155
last_imported_block_number : status. last_imported_block_number . unwrap_or ( chain_info. best_block_number ) ,
156
156
last_imported_old_block_number : status. last_imported_old_block_number ,
157
157
num_peers : status. num_peers ,
158
158
max_peers : status. current_max_peers ( num_peers_range. start , num_peers_range. end - 1 ) ,
159
159
snapshot_sync : status. is_snapshot_syncing ( ) ,
160
- } ) )
160
+ } )
161
161
}
162
- _ => ( is_major_importing ( self . sync . as_ref ( ) . map ( |s| s . status ( ) . state ) , queue_info . clone ( ) ) , None ) ,
162
+ _ => None
163
163
} ;
164
164
165
165
Report {
0 commit comments