mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
lnwire: update onion error encoding/decoding to match BOLT-0004
This commit updates the encoding/decoding for the onion errors to properly match BOLT-0004. This commit does to major things: we increase the max message size to 256 bytes to account for recent modifications to the ChannelUpdate message, and also fold in the error code into the failure message encapsulation itself.
This commit is contained in:
@@ -12,8 +12,8 @@ type OpaqueReason []byte
|
||||
// next commitment transaction, with the UpdateFailHTLC propagated backwards in
|
||||
// the route to fully undo the HTLC.
|
||||
type UpdateFailHTLC struct {
|
||||
// ChanIDPoint is the particular active channel that this UpdateFailHTLC
|
||||
// is bound to.
|
||||
// ChanIDPoint is the particular active channel that this
|
||||
// UpdateFailHTLC is bound to.
|
||||
ChanID ChannelID
|
||||
|
||||
// ID references which HTLC on the remote node's commitment transaction
|
||||
@@ -79,7 +79,7 @@ func (c *UpdateFailHTLC) MaxPayloadLength(uint32) uint32 {
|
||||
length += 2
|
||||
|
||||
// Length of the Reason
|
||||
length += 166
|
||||
length += 292
|
||||
|
||||
return length
|
||||
}
|
||||
|
Reference in New Issue
Block a user