channeldb: store hold invoice

This commit is contained in:
Joost Jager committed 2019-03-15 10:08:55 +01:00
1 parent 8392f6d28f
commit 19f79613df
7 files changed
+111 -43

No files matched your search

+13
View File
@@ -2569,6 +2569,19 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
return true, nil
}
// Reject invoices with unknown preimages.
if invoice.Terms.PaymentPreimage == channeldb.UnknownPreimage {
log.Errorf("rejecting htlc because preimage is unknown")
failure := lnwire.NewFailUnknownPaymentHash(pd.Amount)
l.sendHTLCError(
pd.HtlcIndex, failure, obfuscator,
pd.SourceRef,
)
return true, nil
}
// If the invoice is already settled, we choose to accept the payment to
// simplify failure recovery.
//