Skip to content

Commit

Permalink
Merge pull request #556 from anandrgitnirman/channel-loc
Browse files Browse the repository at this point in the history
  • Loading branch information
anandrgitnirman committed Oct 8, 2021
2 parents 7ba1933 + d22d53f commit 73b1a11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions escrow/escrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (claim *claimImpl) Finish() (err error) {
func (h *lockingPaymentChannelService) StartClaim(key *PaymentChannelKey, update ChannelUpdate) (claim Claim, err error) {
lock, ok, err := h.locker.Lock(key.String())
if err != nil {
log.WithError(err)
log.WithError(err).WithField("PaymentChannelKey", key).Error("StartClaim, unable to get lock!")
return nil, fmt.Errorf("cannot get mutex for channel: %v because of %v", key, err)
}
if !ok {
Expand All @@ -110,7 +110,8 @@ func (h *lockingPaymentChannelService) StartClaim(key *PaymentChannelKey, update

channel, ok, err := h.storage.Get(key)
if err != nil {
log.WithError(err)
log.WithError(err).WithField("channelKey", key).Error("StartClaim, unable to get channel from Storage!")

return
}
if !ok {
Expand Down Expand Up @@ -189,7 +190,7 @@ func (h *lockingPaymentChannelService) StartPaymentTransaction(payment *Payment)

lock, ok, err := h.locker.Lock(channelKey.String())
if err != nil {
log.WithError(err)
log.WithError(err).WithField("channelKey", channelKey).Error("StartPaymentTransaction, unable to get lock!")
return nil, NewPaymentError(Internal, "cannot get mutex for channel: %v", channelKey)
}
if !ok {
Expand All @@ -206,7 +207,7 @@ func (h *lockingPaymentChannelService) StartPaymentTransaction(payment *Payment)

channel, ok, err := h.PaymentChannel(channelKey)
if err != nil {
log.WithError(err)
log.WithError(err).WithField("channelKey", channelKey).Error("StartPaymentTransaction, unable to get channel!")
return nil, NewPaymentError(Internal, "payment channel error:"+err.Error())
}
if !ok {
Expand Down

0 comments on commit 73b1a11

Please sign in to comment.