File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
mithril-aggregator/src/runtime Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ use crate::snapshotter::OngoingSnapshot;
21
21
use crate :: store:: SingleSignatureStorer ;
22
22
use crate :: CertificateCreator ;
23
23
use crate :: MithrilCertificateCreator ;
24
+ use crate :: RuntimeError ;
24
25
use crate :: { DependencyManager , ProtocolError , SnapshotError } ;
25
26
26
27
#[ cfg( test) ]
@@ -307,6 +308,29 @@ impl AggregatorRunnerTrait for AggregatorRunner {
307
308
new_beacon : & Beacon ,
308
309
) -> Result < ( ) , Box < dyn StdError + Sync + Send > > {
309
310
debug ! ( "RUNNER: update stake distribution" ; "beacon" => #?new_beacon) ;
311
+ let exists_stake_distribution = !self
312
+ . dependencies
313
+ . stake_store
314
+ . get_stakes (
315
+ self . dependencies
316
+ . multi_signer
317
+ . read ( )
318
+ . await
319
+ . get_current_beacon ( )
320
+ . await
321
+ . ok_or_else ( || {
322
+ RuntimeError :: keep_state ( "Current beacon is not available" , None )
323
+ } ) ?
324
+ . epoch
325
+ . offset_to_recording_epoch ( ) ,
326
+ )
327
+ . await ?
328
+ . unwrap_or_default ( )
329
+ . is_empty ( ) ;
330
+ if exists_stake_distribution {
331
+ return Ok ( ( ) ) ;
332
+ }
333
+
310
334
let stake_distribution = self
311
335
. dependencies
312
336
. chain_observer
You can’t perform that action at this time.
0 commit comments