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:
1 parent
ef73062c14
commit
2d378b3280
13 files changed
+639
-212
No files matched your search
@@ -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