aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/handshake_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-04-10 19:25:35 +0800
committerFelix Lange <fjl@twurst.com>2015-04-10 22:57:56 +0800
commitb3c058a9e4e9296583ba516c537768b96a2fb8a0 (patch)
tree031181c2a7691a063808d567c8e53d4d491d0e27 /p2p/handshake_test.go
parent99a1db2d4076861d19e2bd704732ff91d509f34b (diff)
downloaddexon-b3c058a9e4e9296583ba516c537768b96a2fb8a0.tar.gz
dexon-b3c058a9e4e9296583ba516c537768b96a2fb8a0.tar.zst
dexon-b3c058a9e4e9296583ba516c537768b96a2fb8a0.zip
p2p: improve disconnect signaling at handshake time
As of this commit, p2p will disconnect nodes directly after the encryption handshake if too many peer connections are active. Errors in the protocol handshake packet are now handled more politely by sending a disconnect packet before closing the connection.
Diffstat (limited to 'p2p/handshake_test.go')
-rw-r--r--p2p/handshake_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/handshake_test.go b/p2p/handshake_test.go
index 19423bb82..c22af7a9c 100644
--- a/p2p/handshake_test.go
+++ b/p2p/handshake_test.go
@@ -143,7 +143,7 @@ func TestSetupConn(t *testing.T) {
done := make(chan struct{})
go func() {
defer close(done)
- conn0, err := setupConn(fd0, prv0, hs0, node1)
+ conn0, err := setupConn(fd0, prv0, hs0, node1, false)
if err != nil {
t.Errorf("outbound side error: %v", err)
return
@@ -156,7 +156,7 @@ func TestSetupConn(t *testing.T) {
}
}()
- conn1, err := setupConn(fd1, prv1, hs1, nil)
+ conn1, err := setupConn(fd1, prv1, hs1, nil, false)
if err != nil {
t.Fatalf("inbound side error: %v", err)
}