diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index 95d505bb3..a7682d00b 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -105,6 +105,8 @@ proposed channel type is used. allows external tools to hook into `lnd`'s RPC server and intercept any requests made with custom macaroons (and also the responses to those requests). + +* [Adds NOT_FOUND status code for LookupInvoice](https://github.com/lightningnetwork/lnd/pull/5768) ### Batched channel funding @@ -393,6 +395,7 @@ change](https://github.com/lightningnetwork/lnd/pull/5613). * Martin Habovstiak * Naveen Srinivasan * Oliver Gugger +* Priyansh Rastogi * Wilmer Paulino * xanoni * Yong Yu diff --git a/rpcserver.go b/rpcserver.go index 7c114a9de..0e2770421 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -5101,7 +5101,10 @@ func (r *rpcServer) LookupInvoice(ctx context.Context, rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:]) invoice, err := r.server.invoices.LookupInvoice(payHash) - if err != nil { + switch { + case err == channeldb.ErrInvoiceNotFound: + return nil, status.Error(codes.NotFound, err.Error()) + case err != nil: return nil, err }