File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
use std:: collections:: hash_map:: Entry ;
18
18
use std:: collections:: { HashMap , HashSet } ;
19
19
use std:: fs;
20
+ use std:: mem:: discriminant;
20
21
use std:: sync:: Arc ;
21
22
use std:: time:: Duration ;
22
23
@@ -174,6 +175,10 @@ impl Extension {
174
175
}
175
176
176
177
fn send_status ( & mut self , id : & NodeId ) {
178
+ if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
179
+ return
180
+ }
181
+
177
182
let chain_info = self . client . chain_info ( ) ;
178
183
self . api . send (
179
184
id,
@@ -190,6 +195,10 @@ impl Extension {
190
195
}
191
196
192
197
fn send_status_broadcast ( & mut self ) {
198
+ if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
199
+ return
200
+ }
201
+
193
202
let chain_info = self . client . chain_info ( ) ;
194
203
for id in self . connected_nodes . iter ( ) {
195
204
self . api . send (
@@ -1053,6 +1062,7 @@ impl Extension {
1053
1062
downloader. update_pivot ( best_hash) ;
1054
1063
}
1055
1064
self . state = State :: Full ;
1065
+ self . send_status_broadcast ( ) ;
1056
1066
}
1057
1067
}
1058
1068
You can’t perform that action at this time.
0 commit comments