@@ -108,7 +108,7 @@ impl Informant {
108
108
109
109
info ! ( target: "import" , "{} {} {}" ,
110
110
match importing {
111
- true => format!( "{} {} {} {}+{} Qed" ,
111
+ true => format!( "Syncing {} {} {} {}+{} Qed" ,
112
112
paint( White . bold( ) , format!( "{:>8}" , format!( "#{}" , chain_info. best_block_number) ) ) ,
113
113
paint( White . bold( ) , format!( "{}" , chain_info. best_block_hash) ) ,
114
114
{
@@ -156,28 +156,26 @@ impl Informant {
156
156
impl ChainNotify for Informant {
157
157
fn new_blocks ( & self , _imported : Vec < H256 > , _invalid : Vec < H256 > , enacted : Vec < H256 > , _retracted : Vec < H256 > , _sealed : Vec < H256 > , duration : u64 ) {
158
158
let mut last_import = self . last_import . lock ( ) ;
159
- if Instant :: now ( ) > * last_import + Duration :: from_secs ( 1 ) {
160
- let queue_info = self . client . queue_info ( ) ;
161
- let importing = queue_info. unverified_queue_size + queue_info. verified_queue_size > 3
162
- || self . sync . as_ref ( ) . map_or ( false , |s| s. status ( ) . is_major_syncing ( ) ) ;
163
- if !importing {
164
- if let Some ( block) = enacted. last ( ) . and_then ( |h| self . client . block ( BlockID :: Hash ( h. clone ( ) ) ) ) {
165
- let view = BlockView :: new ( & block) ;
166
- let header = view. header ( ) ;
167
- let tx_count = view. transactions_count ( ) ;
168
- let size = block. len ( ) ;
169
- let skipped = self . skipped . load ( AtomicOrdering :: Relaxed ) ;
170
- info ! ( target: "import" , "Imported {} {} ({} txs, {} Mgas, {} ms, {} KiB){}" ,
159
+ let queue_info = self . client . queue_info ( ) ;
160
+ let importing = queue_info. unverified_queue_size + queue_info. verified_queue_size > 3
161
+ || self . sync . as_ref ( ) . map_or ( false , |s| s. status ( ) . is_major_syncing ( ) ) ;
162
+ if Instant :: now ( ) > * last_import + Duration :: from_secs ( 1 ) && !importing {
163
+ if let Some ( block) = enacted. last ( ) . and_then ( |h| self . client . block ( BlockID :: Hash ( h. clone ( ) ) ) ) {
164
+ let view = BlockView :: new ( & block) ;
165
+ let header = view. header ( ) ;
166
+ let tx_count = view. transactions_count ( ) ;
167
+ let size = block. len ( ) ;
168
+ let skipped = self . skipped . load ( AtomicOrdering :: Relaxed ) ;
169
+ info ! ( target: "import" , "Imported {} {} ({} txs, {} Mgas, {} ms, {} KiB){}" ,
171
170
Colour :: White . bold( ) . paint( format!( "#{}" , header. number( ) ) ) ,
172
171
Colour :: White . bold( ) . paint( format!( "{}" , header. hash( ) ) ) ,
173
172
Colour :: Yellow . bold( ) . paint( format!( "{}" , tx_count) ) ,
174
173
Colour :: Yellow . bold( ) . paint( format!( "{:.2}" , header. gas_used. low_u64( ) as f32 / 1000000f32 ) ) ,
175
174
Colour :: Purple . bold( ) . paint( format!( "{:.2}" , duration as f32 / 1000000f32 ) ) ,
176
175
Colour :: Blue . bold( ) . paint( format!( "{:.2}" , size as f32 / 1024f32 ) ) ,
177
176
if skipped > 0 { format!( " + another {} block(s)" , Colour :: Red . bold( ) . paint( format!( "{}" , skipped) ) ) } else { String :: new( ) }
178
- ) ;
179
- * last_import = Instant :: now ( ) ;
180
- }
177
+ ) ;
178
+ * last_import = Instant :: now ( ) ;
181
179
}
182
180
self . skipped . store ( 0 , AtomicOrdering :: Relaxed ) ;
183
181
} else {
0 commit comments