invoices+htlcswitch+lnrpc: cancel invoice

This commit is contained in:
Joost Jager committed 2019-02-06 07:29:18 +01:00
1 parent 9cd88a04b7
commit 1b87fbfab2
13 files changed
+1020 -590

No files matched your search

+17
View File
@@ -2337,6 +2337,23 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
continue
}
// Reject htlcs for canceled invoices.
if invoice.Terms.State == channeldb.ContractCanceled {
l.errorf("Rejecting htlc due to canceled " +
"invoice")
failure := lnwire.NewFailUnknownPaymentHash(
pd.Amount,
)
l.sendHTLCError(
pd.HtlcIndex, failure, obfuscator,
pd.SourceRef,
)
needUpdate = true
continue
}
// If the invoice is already settled, we choose to
// accept the payment to simplify failure recovery.
//