You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds the option to report a remote IP address back to a connecting
peer using the `init` message. A node can decide to use that information
to discover a potential update to its public IP address (NAT) and use
that for a `node_announcement` update message containing the new address.
See lightning/bolts#917
goto(INITIALIZING) using InitializingData(chainHash, d.pendingAuth, d.remoteNodeId, d.transport, peer, localInit, doSync, d.isPersistent)
@@ -117,6 +120,7 @@ class PeerConnection(keyPair: KeyPair, conf: PeerConnection.Conf, switchboard: A
117
120
d.transport !TransportHandler.ReadAck(remoteInit)
118
121
119
122
log.info(s"peer is using features=${remoteInit.features}, networks=${remoteInit.networks.mkString(",")}")
123
+
remoteInit.remoteAddress_opt.foreach(address => log.info("peer reports that our IP address is {} (public={})", address.socketAddress.toString, NodeAddress.isPublicIPAddress(address)))
TestCase(hex"0000 0002088a 0120010101010101010101010101010101010101010101010101010101010101010103012a", hex"088a", List(chainHash1), valid =true), // network and unknown odd records
69
-
TestCase(hex"0000 0002088a 0120010101010101010101010101010101010101010101010101010101010101010102012a", hex"088a", Nil, valid =false) // network and unknown even records
58
+
TestCase(hex"0000 0000", hex"", Nil, None, valid =true), // no features
59
+
TestCase(hex"0000 0002088a", hex"088a", Nil, None, valid =true), // no global features
60
+
TestCase(hex"00020200 0000", hex"0200", Nil, None, valid =true, Some(hex"0000 00020200")), // no local features
61
+
TestCase(hex"00020200 0002088a", hex"0a8a", Nil, None, valid =true, Some(hex"0000 00020a8a")), // local and global - no conflict - same size
62
+
TestCase(hex"00020200 0003020002", hex"020202", Nil, None, valid =true, Some(hex"0000 0003020202")), // local and global - no conflict - different sizes
63
+
TestCase(hex"00020a02 0002088a", hex"0a8a", Nil, None, valid =true, Some(hex"0000 00020a8a")), // local and global - conflict - same size
64
+
TestCase(hex"00022200 000302aaa2", hex"02aaa2", Nil, None, valid =true, Some(hex"0000 000302aaa2")), // local and global - conflict - different sizes
TestCase(hex"0000 0002088a 01200101010101010101010101010101010101010101010101010101010101010101 c9012a", hex"088a", List(chainHash1), None, valid =true), // network and unknown odd records
73
+
TestCase(hex"0000 0002088a 01200101010101010101010101010101010101010101010101010101010101010101 02012a", hex"088a", Nil, None, valid =false) // network and unknown even records
0 commit comments