mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
connectd: give user a hint when wrong key is used.
When the wrong key is used, the remote end simply hangs up. We used to get a random errno, which tends to be "Operation now in progress." Now it's defined to be 0, detect and provide a better error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -41,7 +41,7 @@ def test_connect(node_factory):
|
||||
l1.rpc.connect('032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'localhost', 1)
|
||||
|
||||
# Should get reasonable error if wrong key for peer.
|
||||
with pytest.raises(RpcError, match=r'Cryptographic handshake: '):
|
||||
with pytest.raises(RpcError, match=r'Cryptographic handshake: peer closed connection \(wrong key\?\)'):
|
||||
l1.rpc.connect('032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'localhost', l2.port)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user