routing+htlcswitch: add new interface method HasAttemptResult
This commit is contained in:
1 parent
bbf58ab444
commit
b998ce11f1
3 files changed
+42
No files matched your search
@@ -431,6 +431,21 @@ func (s *Switch) ProcessContractResolution(msg contractcourt.ResolutionMsg) erro
|
||||
}
|
||||
}
|
||||
|
||||
// HasAttemptResult reads the network result store to fetch the specified
|
||||
// attempt. Returns true if the attempt result exists.
|
||||
func (s *Switch) HasAttemptResult(attemptID uint64) (bool, error) {
|
||||
_, err := s.networkResults.getResult(attemptID)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
if !errors.Is(err, ErrPaymentIDNotFound) {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// GetAttemptResult returns the result of the HTLC attempt with the given
|
||||
// attemptID. The paymentHash should be set to the payment's overall hash, or
|
||||
// in case of AMP payments the payment's unique identifier.
|
||||
|
||||
Reference in new issue
Block a user