mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-01 23:45:50 +00:00
23f118a1a9
* treat connected/handshaked peers separately in the discoverer, save "original" address for connected ones, it can be a name instead of IP and it's important to keep it to avoid reconnections * store name->IP mapping for seeds if and when they're connected to avoid reconnections * block seed if it's detected to be our own node (which is often the case for small private networks) * add an event for handshaked peers in the server, connected but non-handshaked ones are not really helpful for MinPeers or GetAddr logic Fixes #2796.
13 lines
304 B
Go
13 lines
304 B
Go
package network
|
|
|
|
import "time"
|
|
|
|
// Transporter is an interface that allows us to abstract
|
|
// any form of communication between the server and its peers.
|
|
type Transporter interface {
|
|
Dial(addr string, timeout time.Duration) (AddressablePeer, error)
|
|
Accept()
|
|
Proto() string
|
|
Address() string
|
|
Close()
|
|
}
|