mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 08:41:42 +02:00
lnwire: store unknown address type as OpaqueAddrs
Instead of erroring out with encountering an address with an unknown type, we just store the remainder of the addrBytes as OpaqueAddrs so that we are able to rewrite them to the wire when we re-propagate the message.
This commit is contained in:
@@ -259,8 +259,11 @@ func TestDecodeUnknownAddressType(t *testing.T) {
|
||||
// Now we attempt to parse the bytes and assert that we get an error.
|
||||
var addrs []net.Addr
|
||||
err = ReadElement(buffer, &addrs)
|
||||
require.Error(t, err)
|
||||
require.IsType(t, err, &ErrUnknownAddrType{})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, addrs, 3)
|
||||
require.Equal(t, tcpAddr.String(), addrs[0].String())
|
||||
require.Equal(t, onionAddr.String(), addrs[1].String())
|
||||
require.Equal(t, hex.EncodeToString(data), addrs[2].String())
|
||||
}
|
||||
|
||||
func TestMaxOutPointIndex(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user