Skip to content

Commit 9664b50

Browse files
anandrgitnirmananandrgitnirman
anandrgitnirman
authored and
anandrgitnirman
committed
added better logging on to debug the channel lock issue
1 parent 36e2776 commit 9664b50

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

escrow/escrow.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ func (claim *claimImpl) Finish() (err error) {
9595
func (h *lockingPaymentChannelService) StartClaim(key *PaymentChannelKey, update ChannelUpdate) (claim Claim, err error) {
9696
lock, ok, err := h.locker.Lock(key.String())
9797
if err != nil {
98-
return nil, fmt.Errorf("cannot get mutex for channel: %v", key)
98+
log.WithError(err)
99+
return nil, fmt.Errorf("cannot get mutex for channel: %v because of %v", key, err)
99100
}
100101
if !ok {
101102
return nil, fmt.Errorf("another transaction on channel: %v is in progress", key)
@@ -109,6 +110,7 @@ func (h *lockingPaymentChannelService) StartClaim(key *PaymentChannelKey, update
109110

110111
channel, ok, err := h.storage.Get(key)
111112
if err != nil {
113+
log.WithError(err)
112114
return
113115
}
114116
if !ok {
@@ -127,6 +129,7 @@ func (h *lockingPaymentChannelService) StartClaim(key *PaymentChannelKey, update
127129

128130
err = h.paymentStorage.Put(payment)
129131
if err != nil {
132+
log.WithError(err)
130133
log.WithField("payment", payment).Error("Cannot write payment into payment storage. Channel storage is already updated. Payment should be handled manually.")
131134
return
132135
}

0 commit comments

Comments
 (0)