Skip to content

Commit

Permalink
added defer to outer func
Browse files Browse the repository at this point in the history
  • Loading branch information
avendauz committed Jul 31, 2021
1 parent 6a207c6 commit ccc7f51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/curium/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ func (k Keeper) NewMsgBroadcaster(keyringDir string, cdc *codec.Codec) MsgBroadc
return func(ctx sdk.Context, msgs []sdk.Msg, from string) chan *MsgBroadcasterResponse {
resp := make(chan *MsgBroadcasterResponse)

defer func () {
close(resp)
}()

go func() {

returnError := func(err error) {
resp <- &MsgBroadcasterResponse{
Error: err,
}
close(resp)
}

defer func () {
Expand Down Expand Up @@ -241,7 +244,7 @@ func (k Keeper) NewMsgBroadcaster(keyringDir string, cdc *codec.Codec) MsgBroadc
}
fmt.Println("Break 8")

close(resp)


}()

Expand Down

0 comments on commit ccc7f51

Please sign in to comment.