Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 4f34271

Browse files
authored
fix error 'send on closed channel' after retry (#198)
Signed-off-by: Фёдор Партанский <[email protected]> Co-authored-by: Фёдор Партанский <[email protected]>
1 parent c848d11 commit 4f34271

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/gateway/transaction.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,18 @@ func (c *commitTxHandler) Handle(requestContext *invoke.RequestContext, clientCo
187187

188188
select {
189189
case txStatus := <-statusNotifier:
190-
if c.eventch != nil {
191-
c.eventch <- txStatus
192-
close(c.eventch)
193-
}
194190
requestContext.Response.TxValidationCode = txStatus.TxValidationCode
195191

196192
if txStatus.TxValidationCode != peer.TxValidationCode_VALID {
197193
requestContext.Error = status.New(status.EventServerStatus, int32(txStatus.TxValidationCode),
198194
"received invalid transaction", nil)
199195
return
200196
}
197+
198+
if c.eventch != nil {
199+
c.eventch <- txStatus
200+
close(c.eventch)
201+
}
201202
case <-requestContext.Ctx.Done():
202203
requestContext.Error = status.New(status.ClientStatus, status.Timeout.ToInt32(),
203204
"Execute didn't receive block event", nil)

0 commit comments

Comments
 (0)