mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-07 14:00:08 +02:00
htlcswitch+router: add onion error obfuscation
Within the network, it's important that when an HTLC forwarding failure occurs, the recipient is notified in a timely manner in order to ensure that errors are graceful and not unknown. For that reason with accordance to BOLT №4 onion failure obfuscation have been added.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
ef73062c14
commit
2d378b3280
@ -38,17 +38,23 @@ type paymentCircuit struct {
|
||||
// request back.
|
||||
Dest lnwire.ShortChannelID
|
||||
|
||||
// Obfuscator is used to obfuscate the onion failure before sending it
|
||||
// back to the originator of the payment.
|
||||
Obfuscator Obfuscator
|
||||
|
||||
// RefCount is used to count the circuits with the same circuit key.
|
||||
RefCount int
|
||||
}
|
||||
|
||||
// newPaymentCircuit creates new payment circuit instance.
|
||||
func newPaymentCircuit(src, dest lnwire.ShortChannelID, key circuitKey) *paymentCircuit {
|
||||
func newPaymentCircuit(src, dest lnwire.ShortChannelID, key circuitKey,
|
||||
obfuscator Obfuscator) *paymentCircuit {
|
||||
return &paymentCircuit{
|
||||
Src: src,
|
||||
Dest: dest,
|
||||
PaymentHash: key,
|
||||
RefCount: 1,
|
||||
Obfuscator: obfuscator,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user