mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 06:34:27 +01:00
Htlcswitch: rename Deobfuscator and Obfuscator interfaces
This commit renames the Deobfuscator interface to ErrorDecrypter and the Obfuscator interface to ErrorEncrypter. With this rename, the purpose of these two interfaces are a bit clearer. Additionally, DecryptError (which was formerly Deobfuscate) now directly returns an ForwardingError type instead of the lnwire.FailureMessage.
This commit is contained in:
@@ -35,10 +35,7 @@ type htlcPacket struct {
|
||||
|
||||
// obfuscator contains the necessary state to allow the switch to wrap
|
||||
// any forwarded errors in an additional layer of encryption.
|
||||
//
|
||||
// TODO(andrew.shvv) revisit after refactoring the way of returning
|
||||
// errors inside the htlcswitch packet.
|
||||
obfuscator Obfuscator
|
||||
obfuscator ErrorEncrypter
|
||||
|
||||
// isObfuscated is set to true if an error occurs as soon as the switch
|
||||
// forwards a packet to the link. If so, and this is an error packet,
|
||||
@@ -61,13 +58,13 @@ func newInitPacket(destNode [33]byte, htlc *lnwire.UpdateAddHTLC) *htlcPacket {
|
||||
// newAddPacket creates htlc switch add packet which encapsulates the add htlc
|
||||
// request and additional information for proper forwarding over htlc switch.
|
||||
func newAddPacket(src, dest lnwire.ShortChannelID,
|
||||
htlc *lnwire.UpdateAddHTLC, obfuscator Obfuscator) *htlcPacket {
|
||||
htlc *lnwire.UpdateAddHTLC, e ErrorEncrypter) *htlcPacket {
|
||||
|
||||
return &htlcPacket{
|
||||
dest: dest,
|
||||
src: src,
|
||||
htlc: htlc,
|
||||
obfuscator: obfuscator,
|
||||
obfuscator: e,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user