mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
htlcswitch: fix docs on LookupCircuit
This commit is contained in:
parent
c525c3d34e
commit
22848df07a
2 changed files with 6 additions and 6 deletions
|
@ -509,8 +509,8 @@ func (cm *circuitMap) TrimOpenCircuits(chanID lnwire.ShortChannelID,
|
||||||
}, func() {})
|
}, func() {})
|
||||||
}
|
}
|
||||||
|
|
||||||
// LookupByHTLC looks up the payment circuit by the outgoing channel and HTLC
|
// LookupCircuit queries the circuit map for the circuit identified by its
|
||||||
// IDs. Returns nil if there is no such circuit.
|
// incoming circuit key. Returns nil if there is no such circuit.
|
||||||
func (cm *circuitMap) LookupCircuit(inKey CircuitKey) *PaymentCircuit {
|
func (cm *circuitMap) LookupCircuit(inKey CircuitKey) *PaymentCircuit {
|
||||||
cm.mtx.RLock()
|
cm.mtx.RLock()
|
||||||
defer cm.mtx.RUnlock()
|
defer cm.mtx.RUnlock()
|
||||||
|
|
|
@ -375,9 +375,9 @@ func (s *Switch) GetPaymentResult(attemptID uint64, paymentHash lntypes.Hash,
|
||||||
deobfuscator ErrorDecrypter) (<-chan *PaymentResult, error) {
|
deobfuscator ErrorDecrypter) (<-chan *PaymentResult, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
nChan <-chan *networkResult
|
nChan <-chan *networkResult
|
||||||
err error
|
err error
|
||||||
outKey = CircuitKey{
|
inKey = CircuitKey{
|
||||||
ChanID: hop.Source,
|
ChanID: hop.Source,
|
||||||
HtlcID: attemptID,
|
HtlcID: attemptID,
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ func (s *Switch) GetPaymentResult(attemptID uint64, paymentHash lntypes.Hash,
|
||||||
// If the payment is not found in the circuit map, check whether a
|
// If the payment is not found in the circuit map, check whether a
|
||||||
// result is already available.
|
// result is already available.
|
||||||
// Assumption: no one will add this payment ID other than the caller.
|
// Assumption: no one will add this payment ID other than the caller.
|
||||||
if s.circuits.LookupCircuit(outKey) == nil {
|
if s.circuits.LookupCircuit(inKey) == nil {
|
||||||
res, err := s.networkResults.getResult(attemptID)
|
res, err := s.networkResults.getResult(attemptID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue