Skip to content

Commit 73a74df

Browse files
committed
fix(interchain):rollback when invoke 500
1 parent 3e2c46c commit 73a74df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,12 @@ func (c *Client) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) {
283283
} else {
284284
res, resp, err := c.InvokeInterchain(ibtp.From, ibtp.Index, content.DstContractId, ibtp.Category(), bizData)
285285
if err != nil {
286-
ret.Message = fmt.Sprintf("invoke interchain foribtp to call %s: %w", content.Func, err)
286+
res, _, err = c.InvokeIndexUpdate(ibtp.From, ibtp.Index, ibtp.Category())
287+
ret.Message = fmt.Sprintf("invoke interchain for ibtp to call %s: %w", content.Func, err)
287288
ret.Status = false
289+
if err != nil {
290+
return nil, err
291+
}
288292
}
289293

290294
if resp != nil {

0 commit comments

Comments
 (0)