@@ -321,6 +321,21 @@ func (vc *ValidationCeremony) restoreState() {
321
321
if stopFlipKeysStopTime .Before (time .Now ().UTC ()) {
322
322
vc .stopFlipKeysSync ()
323
323
}
324
+ go vc .shortSessionAnswersBroadcastLoop ()
325
+ }
326
+
327
+ func (vc * ValidationCeremony ) shortSessionAnswersBroadcastLoop () {
328
+ for {
329
+ time .Sleep (time .Second * 5 )
330
+ if vc .appState .State .ValidationPeriod () != state .NonePeriod {
331
+ if ! vc .shortAnswersSent && vc .appState .EvidenceMap .IsCompleted () {
332
+ if vc .shouldInteractWithNetwork () {
333
+ time .Sleep (time .Duration (rand .Intn (MaxShortAnswersBroadcastDelaySec )) * time .Second )
334
+ vc .broadcastShortAnswersTx ()
335
+ }
336
+ }
337
+ }
338
+ }
324
339
}
325
340
326
341
func (vc * ValidationCeremony ) startValidationShortSessionTimer () {
@@ -473,7 +488,6 @@ func (vc *ValidationCeremony) startShortSession(appState *appstate.AppState) {
473
488
func (vc * ValidationCeremony ) handleLongSessionPeriod (block * types.Block ) {
474
489
if block .Header .Flags ().HasFlag (types .LongSessionStarted ) {
475
490
vc .logInfoWithInteraction ("Long session started" )
476
- go vc .delayedShortAnswersTxBroadcast ()
477
491
}
478
492
479
493
vc .processCeremonyTxs (block )
@@ -759,13 +773,6 @@ func (vc *ValidationCeremony) processCeremonyTxs(block *types.Block) {
759
773
}
760
774
}
761
775
762
- func (vc * ValidationCeremony ) delayedShortAnswersTxBroadcast () {
763
- if vc .shouldInteractWithNetwork () {
764
- time .Sleep (time .Duration (rand .Intn (MaxShortAnswersBroadcastDelaySec )) * time .Second )
765
- vc .broadcastShortAnswersTx ()
766
- }
767
- }
768
-
769
776
func (vc * ValidationCeremony ) broadcastShortAnswersTx () {
770
777
if vc .shortAnswersSent || ! vc .shouldInteractWithNetwork () || ! vc .isParticipant () {
771
778
return
0 commit comments