htlcswitch/switch: clarify paymentID uniqueness
With the following commits, it'll become important to not resuse paymentIDs, since there is no way to tell whether the HTLC in question has already been forwarded and settled/failed. We clarify this in the SendHTLC comments, and alter the tests to not attempt to resend an HTLC with a duplicate payment ID.
This commit is contained in:
2 files changed
+3
-28
No files matched your search
@@ -348,7 +348,8 @@ func (s *Switch) ProcessContractResolution(msg contractcourt.ResolutionMsg) erro
|
||||
|
||||
// SendHTLC is used by other subsystems which aren't belong to htlc switch
|
||||
// package in order to send the htlc update. The paymentID used MUST be unique
|
||||
// for this HTLC, otherwise the switch might reject it.
|
||||
// for this HTLC, and MUST be used only once, otherwise the switch might reject
|
||||
// it.
|
||||
func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, paymentID uint64,
|
||||
htlc *lnwire.UpdateAddHTLC,
|
||||
deobfuscator ErrorDecrypter) ([sha256.Size]byte, error) {
|
||||
|
||||
Reference in new issue
Block a user