@@ -959,7 +959,7 @@ func (a *distributedAccount) thresholdSign(ctx context.Context, req *pb.SignRequ
959
959
errored := 0
960
960
ids := make ([]bls.ID , a .signingThreshold )
961
961
signatures := make ([]bls.Sign , a .signingThreshold )
962
- for signed != int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
962
+ for signed < int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
963
963
select {
964
964
case <- ctx .Done ():
965
965
return nil , errors .New ("context done" )
@@ -989,7 +989,7 @@ func (a *distributedAccount) thresholdSign(ctx context.Context, req *pb.SignRequ
989
989
attribute .Int ("failed" , failed ),
990
990
attribute .Int ("errored" , errored ),
991
991
))
992
- if signed != int (a .signingThreshold ) {
992
+ if signed < int (a .signingThreshold ) {
993
993
return nil , fmt .Errorf ("not enough signatures: %d signed, %d denied, %d failed, %d errored" , signed , denied , failed , errored )
994
994
}
995
995
@@ -1095,7 +1095,7 @@ func (a *distributedAccount) thresholdMultiSign(ctx context.Context, req *pb.Mul
1095
1095
// We could be done early if we have enough signatures.
1096
1096
done := true
1097
1097
for i := range ids {
1098
- if len (ids [i ]) != int (thresholds [i ]) {
1098
+ if len (ids [i ]) < int (thresholds [i ]) {
1099
1099
done = false
1100
1100
break
1101
1101
}
@@ -1116,8 +1116,8 @@ func (a *distributedAccount) thresholdMultiSign(ctx context.Context, req *pb.Mul
1116
1116
wg .Add (1 )
1117
1117
go func (_ context.Context , _ * semaphore.Weighted , wg * sync.WaitGroup , i int ) {
1118
1118
defer wg .Done ()
1119
- if signed [ i ] != int ( thresholds [ i ]) {
1120
- // Not enough components to make the composite signature.
1119
+
1120
+ if signed [ i ] < int ( thresholds [ i ]) {
1121
1121
return
1122
1122
}
1123
1123
@@ -1196,7 +1196,7 @@ func (a *distributedAccount) thresholdSignBeaconAttestation(ctx context.Context,
1196
1196
errored := 0
1197
1197
ids := make ([]bls.ID , a .signingThreshold )
1198
1198
signatures := make ([]bls.Sign , a .signingThreshold )
1199
- for signed != int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
1199
+ for signed < int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
1200
1200
select {
1201
1201
case <- ctx .Done ():
1202
1202
return nil , errors .New ("context done" )
@@ -1332,7 +1332,7 @@ func (a *distributedAccount) thresholdSignBeaconAttestations(ctx context.Context
1332
1332
// We could be done early if we have enough signatures.
1333
1333
done := true
1334
1334
for i := range ids {
1335
- if len (ids [i ]) != int (thresholds [i ]) {
1335
+ if len (ids [i ]) < int (thresholds [i ]) {
1336
1336
done = false
1337
1337
break
1338
1338
}
@@ -1353,8 +1353,7 @@ func (a *distributedAccount) thresholdSignBeaconAttestations(ctx context.Context
1353
1353
wg .Add (1 )
1354
1354
go func (_ context.Context , _ * semaphore.Weighted , wg * sync.WaitGroup , i int ) {
1355
1355
defer wg .Done ()
1356
- if signed [i ] != int (thresholds [i ]) {
1357
- // Not enough components to make the composite signature.
1356
+ if signed [i ] < int (thresholds [i ]) {
1358
1357
return
1359
1358
}
1360
1359
@@ -1433,7 +1432,7 @@ func (a *distributedAccount) thresholdSignBeaconProposal(ctx context.Context, re
1433
1432
errored := 0
1434
1433
ids := make ([]bls.ID , a .signingThreshold )
1435
1434
signatures := make ([]bls.Sign , a .signingThreshold )
1436
- for signed != int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
1435
+ for signed < int (a .signingThreshold ) && signed + denied + failed + errored != len (clients ) {
1437
1436
select {
1438
1437
case <- ctx .Done ():
1439
1438
return nil , errors .New ("context done" )
@@ -1463,7 +1462,7 @@ func (a *distributedAccount) thresholdSignBeaconProposal(ctx context.Context, re
1463
1462
attribute .Int ("failed" , failed ),
1464
1463
attribute .Int ("errored" , errored ),
1465
1464
))
1466
- if signed != int (a .signingThreshold ) {
1465
+ if signed < int (a .signingThreshold ) {
1467
1466
return nil , fmt .Errorf ("not enough signatures: %d signed, %d denied, %d failed, %d errored" , signed , denied , failed , errored )
1468
1467
}
1469
1468
0 commit comments