Skip to content

Commit

Permalink
htlcswitch: add debug logs for fetching network result
Browse files Browse the repository at this point in the history
  • Loading branch information
halseth committed Nov 24, 2020
1 parent 7f9f4a7 commit 4d645ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions htlcswitch/payment_result.go
Expand Up @@ -128,6 +128,8 @@ func (store *networkResultStore) storeResult(paymentID uint64,
store.paymentIDMtx.Lock(paymentID)
defer store.paymentIDMtx.Unlock(paymentID)

log.Debugf("Storing result for paymentID=%v", paymentID)

// Serialize the payment result.
var b bytes.Buffer
if err := serializeNetworkResult(&b, result); err != nil {
Expand Down Expand Up @@ -175,6 +177,8 @@ func (store *networkResultStore) subscribeResult(paymentID uint64) (
store.paymentIDMtx.Lock(paymentID)
defer store.paymentIDMtx.Unlock(paymentID)

log.Debugf("Subscribing to result for paymentID=%v", paymentID)

var (
result *networkResult
resultChan = make(chan *networkResult, 1)
Expand Down
3 changes: 3 additions & 0 deletions htlcswitch/switch.go
Expand Up @@ -420,6 +420,9 @@ func (s *Switch) GetPaymentResult(paymentID uint64, paymentHash lntypes.Hash,
return
}

log.Debugf("Received network result %T for paymentID=%v", n.msg,
paymentID)

// Extract the result and pass it to the result channel.
result, err := s.extractResult(
deobfuscator, n, paymentID, paymentHash,
Expand Down

0 comments on commit 4d645ef

Please sign in to comment.