File tree 1 file changed +18
-16
lines changed
1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -81,26 +81,28 @@ func connectToNonPrimaryNetworkPeers(
81
81
)
82
82
return err
83
83
}
84
- if ok , warpConfig , err := checkForSufficientConnectedStake (
84
+ ok , warpConfig , err := checkForSufficientConnectedStake (
85
85
logger ,
86
86
cfg ,
87
87
connectedValidators ,
88
- blockchainID ); ok {
88
+ blockchainID );
89
+ if err != nil {
89
90
return err
90
- } else {
91
- logger .Warn (
92
- "Failed to connect to a threshold of stake, retrying..." ,
93
- zap .String ("destinationBlockchainID" , blockchainID .String ()),
94
- zap .Uint64 ("connectedWeight" , connectedValidators .ConnectedWeight ),
95
- zap .Uint64 ("totalValidatorWeight" , connectedValidators .ValidatorSet .TotalWeight ),
96
- zap .Any ("WarpConfig" , warpConfig ),
97
- )
98
- select {
99
- case <- ctx .Done ():
100
- return ctx .Err ()
101
- default :
102
- time .Sleep (5 * time .Second ) // Retry after a short delay
103
- }
91
+ }
92
+ if ok {
93
+ break
94
+ }
95
+ logger .Warn (
96
+ "Failed to connect to a threshold of stake, retrying..." ,
97
+ zap .String ("destinationBlockchainID" , blockchainID .String ()),
98
+ zap .Uint64 ("connectedWeight" , connectedValidators .ConnectedWeight ),
99
+ zap .Uint64 ("totalValidatorWeight" , connectedValidators .ValidatorSet .TotalWeight ),
100
+ )
101
+ select {
102
+ case <- ctx .Done ():
103
+ return ctx .Err ()
104
+ default :
105
+ time .Sleep (5 * time .Second ) // Retry after a short delay
104
106
}
105
107
}
106
108
}
You can’t perform that action at this time.
0 commit comments