Commit ef1b28f 1 parent ab67f34 commit ef1b28f Copy full SHA for ef1b28f
File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ func (s *SBFT) Request(req []byte) {
24
24
}
25
25
26
26
func (s * SBFT ) handleRequest (req * Request , src uint64 ) {
27
- if s .isPrimary () {
27
+ if s .isPrimary () && s . activeView {
28
28
s .batch = append (s .batch , req )
29
29
if s .batchSize () >= s .config .BatchSizeBytes {
30
30
s .maybeSendNextBatch ()
@@ -56,7 +56,7 @@ func (s *SBFT) maybeSendNextBatch() {
56
56
s .batchTimer = nil
57
57
}
58
58
59
- if ! s .isPrimary () {
59
+ if ! s .isPrimary () || ! s . activeView {
60
60
return
61
61
}
62
62
Original file line number Diff line number Diff line change @@ -352,6 +352,7 @@ func TestRestart(t *testing.T) {
352
352
for _ , r := range repls {
353
353
r .sendViewChange ()
354
354
}
355
+ sys .Run ()
355
356
356
357
r1 := []byte {1 , 2 , 3 }
357
358
repls [0 ].Request (r1 )
@@ -429,6 +430,7 @@ func TestRestartAfterPrepare(t *testing.T) {
429
430
for _ , r := range repls {
430
431
r .sendViewChange ()
431
432
}
433
+ sys .Run ()
432
434
433
435
r1 := []byte {1 , 2 , 3 }
434
436
repls [0 ].Request (r1 )
@@ -497,6 +499,7 @@ func TestRestartAfterCommit(t *testing.T) {
497
499
for _ , r := range repls {
498
500
r .sendViewChange ()
499
501
}
502
+ sys .Run ()
500
503
501
504
r1 := []byte {1 , 2 , 3 }
502
505
repls [0 ].Request (r1 )
@@ -565,6 +568,7 @@ func TestRestartAfterCheckpoint(t *testing.T) {
565
568
for _ , r := range repls {
566
569
r .sendViewChange ()
567
570
}
571
+ sys .Run ()
568
572
569
573
r1 := []byte {1 , 2 , 3 }
570
574
repls [0 ].Request (r1 )
@@ -653,6 +657,7 @@ func TestErroneousViewChange(t *testing.T) {
653
657
for _ , r := range repls {
654
658
r .sendViewChange ()
655
659
}
660
+ sys .Run ()
656
661
657
662
r1 := []byte {1 , 2 , 3 }
658
663
repls [0 ].Request (r1 )
@@ -717,6 +722,7 @@ func TestRestartMissedViewChange(t *testing.T) {
717
722
r .sendViewChange ()
718
723
}
719
724
}
725
+ sys .Run ()
720
726
721
727
r2 := []byte {3 , 1 , 2 }
722
728
repls [1 ].Request (r2 )
You can’t perform that action at this time.
0 commit comments