@@ -143,13 +143,15 @@ func (k Keeper) HandleCreateSigning(
143
143
if err != nil {
144
144
return 0 , err
145
145
}
146
+ if currentGroup .Status != tsstypes .GROUP_STATUS_ACTIVE {
147
+ return 0 , types .ErrNoActiveGroup
148
+ }
146
149
147
150
// charged fee if necessary; If found any coins that exceed limit then return error
148
151
feePerSigner := sdk .NewCoins ()
149
- totalFee := sdk .NewCoins ()
150
152
if sender .String () != k .authority {
151
153
feePerSigner = k .GetParams (ctx ).Fee
152
- totalFee = feePerSigner .MulInt (sdk .NewInt (int64 (currentGroup .Threshold )))
154
+ totalFee : = feePerSigner .MulInt (sdk .NewInt (int64 (currentGroup .Threshold )))
153
155
for _ , fc := range totalFee {
154
156
limitAmt := feeLimit .AmountOf (fc .Denom )
155
157
if fc .Amount .GT (limitAmt ) {
@@ -161,6 +163,12 @@ func (k Keeper) HandleCreateSigning(
161
163
)
162
164
}
163
165
}
166
+
167
+ // transfer fee to module account.
168
+ err = k .bankKeeper .SendCoinsFromAccountToModule (ctx , sender , types .ModuleName , totalFee )
169
+ if err != nil {
170
+ return 0 , err
171
+ }
164
172
}
165
173
166
174
currentGroupSigning , err := k .tssKeeper .CreateSigning (ctx , currentGroup , content )
@@ -183,14 +191,6 @@ func (k Keeper) HandleCreateSigning(
183
191
replacingGroupSigningID = replacingGroupSigning .ID
184
192
}
185
193
186
- // transfer fee to module account.
187
- if ! totalFee .IsZero () {
188
- err = k .bankKeeper .SendCoinsFromAccountToModule (ctx , sender , types .ModuleName , totalFee )
189
- if err != nil {
190
- return 0 , err
191
- }
192
- }
193
-
194
194
// save signing info
195
195
bandtssSigningID := k .AddSigning (ctx , types.Signing {
196
196
Fee : feePerSigner ,
0 commit comments