lnwire: create distinct type for UpdateFailHTLC failure reason

This commit creates a distint type for the opaque failure reason within
the UpdateFailHTLC message. This new type is needed as this is the only
variable length byte slice within the protocol and therefore requires a
length prefix in order to serialize/deserialize properly.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-02-21 01:43:36 -08:00
1 parent 4aa7de7f58
commit 8024fd72f8
3 files changed
+32 -18

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ func TestUpdateFailHTLC(t *testing.T) {
ChannelPoint: *outpoint1,
ID: 22,
}
copy(cancelMsg.Reason[:], bytes.Repeat([]byte{21}, 20))
cancelMsg.Reason = []byte{byte(UnknownDestination)}
// Next encode the UFH message into an empty bytes buffer.
var b bytes.Buffer