Skip to content

Commit

Permalink
Switch to write lock
Browse files Browse the repository at this point in the history
Resolves #74
  • Loading branch information
enobufs committed Jul 15, 2019
1 parent 2c92c03 commit f95fbce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ func (c *Client) handleChannelData(data []byte) error {
return fmt.Errorf("binding with channel %d not found", int(chData.Number))
}

c.log.Tracef("channel data received from %s (ch=%d)", addr.String(), int(chData.Number))

relayedConn.HandleInbound(chData.Data, addr)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/client/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func (t *Transaction) StartRtxTimer(onTimeout func(trKey string, nRtx int32)) {

// StopRtxTimer stop the transaction timer
func (t *Transaction) StopRtxTimer() {
t.mutex.RLock()
defer t.mutex.RUnlock()
t.mutex.Lock()
defer t.mutex.Unlock()

if t != nil {
t.timer.Stop()
Expand Down

0 comments on commit f95fbce

Please sign in to comment.