mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 00:54:20 +01:00
gossipd: give more distinct errors.
At least say whether we failed to connect at all, or failed cryptographic handshake, or failed reading/writing init messages. The errno can be "Operation now in progress" if the other end closes the socket on us: this happens when we handshake with the wrong key and it hangs up on us. Fixing this would require work on ccan/io though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -623,6 +623,16 @@ class LightningDTests(BaseLightningDTests):
|
||||
"No address known",
|
||||
l1.rpc.connect, '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e')
|
||||
|
||||
# Should get reasonable error if connection refuse.
|
||||
self.assertRaisesRegex(ValueError,
|
||||
"Connection establishment: Connection refused",
|
||||
l1.rpc.connect, '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'localhost', 1)
|
||||
|
||||
# Should get reasonable error if wrong key for peer.
|
||||
self.assertRaisesRegex(ValueError,
|
||||
"Cryptographic handshake: ",
|
||||
l1.rpc.connect, '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'localhost', l2.info['port'])
|
||||
|
||||
def test_connect_standard_addr(self):
|
||||
"""Test standard node@host:port address
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user