routing: Ensure to not fail a payment twice

This commit is contained in:
ziggie
2025-03-19 10:25:46 -05:00
parent 5d921723b1
commit 4bdd37534e
3 changed files with 35 additions and 44 deletions

View File

@@ -282,6 +282,9 @@ func (p *controlTower) FetchPayment(paymentHash lntypes.Hash) (
// reason the payment failed. After invoking this method, InitPayment should
// return nil on its next call for this payment hash, allowing the switch to
// make a subsequent payment.
//
// NOTE: This method will overwrite the failure reason if the payment is already
// failed.
func (p *controlTower) FailPayment(paymentHash lntypes.Hash,
reason channeldb.FailureReason) error {