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 @@ -19,6 +19,7 @@ use std::collections::{HashMap, HashSet};
1919use std:: fs;
2020use std:: sync:: Arc ;
2121use std:: time:: Duration ;
22+ use std:: mem:: discriminant;
2223
2324use ccore:: encoded:: Header as EncodedHeader ;
2425use ccore:: {
@@ -174,6 +175,10 @@ impl Extension {
174175 }
175176
176177 fn send_status ( & mut self , id : & NodeId ) {
178+ if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
179+ return
180+ }
181+
177182 let chain_info = self . client . chain_info ( ) ;
178183 self . api . send (
179184 id,
@@ -190,6 +195,10 @@ impl Extension {
190195 }
191196
192197 fn send_status_broadcast ( & mut self ) {
198+ if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
199+ return
200+ }
201+
193202 let chain_info = self . client . chain_info ( ) ;
194203 for id in self . connected_nodes . iter ( ) {
195204 self . api . send (
@@ -1057,6 +1066,7 @@ impl Extension {
10571066 downloader. update_pivot ( best_hash) ;
10581067 }
10591068 self . state = State :: Full ;
1069+ self . send_status_broadcast ( ) ;
10601070 }
10611071}
10621072
You can’t perform that action at this time.
0 commit comments