peer+lnwire: add LinkUpdater iface and impl on relevant msgs

Removes longstanding TODO to simplify parsing of target chanid.
This commit is contained in:
Conner Fromknecht
2019-09-25 12:00:59 -07:00
parent 9b1ecbd3fa
commit 2df5a36048
8 changed files with 84 additions and 30 deletions

View File

@@ -1,6 +1,8 @@
package lnwire
import "io"
import (
"io"
)
// OpaqueReason is an opaque encrypted byte slice that encodes the exact
// failure reason and additional some supplemental data. The contents of this
@@ -83,3 +85,11 @@ func (c *UpdateFailHTLC) MaxPayloadLength(uint32) uint32 {
return length
}
// TargetChanID returns the channel id of the link for which this message is
// intended.
//
// NOTE: Part of lnd.LinkUpdater interface.
func (c *UpdateFailHTLC) TargetChanID() ChannelID {
return c.ChanID
}