Documentation ¶
Index ¶
- func HandleHandshake(context HandleHandshakeContext, netConnection *netadapter.NetConnection, ...) (*peerpkg.Peer, error)
- func ReceiveVersion(context HandleHandshakeContext, incomingRoute *routerpkg.Route, ...) (*appmessage.NetAddress, error)
- func SendVersion(context HandleHandshakeContext, incomingRoute *routerpkg.Route, ...) error
- type HandleHandshakeContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleHandshake ¶
func HandleHandshake(context HandleHandshakeContext, netConnection *netadapter.NetConnection, receiveVersionRoute *routerpkg.Route, sendVersionRoute *routerpkg.Route, outgoingRoute *routerpkg.Route, ) (*peerpkg.Peer, error)
HandleHandshake sets up the new_handshake protocol - It sends a version message and waits for an incoming version message, as well as a verack for the sent version
func ReceiveVersion ¶
func ReceiveVersion(context HandleHandshakeContext, incomingRoute *routerpkg.Route, outgoingRoute *routerpkg.Route, peer *peerpkg.Peer) (*appmessage.NetAddress, error)
ReceiveVersion waits for the peer to send a version message, sends a verack in response, and updates its info accordingly.
func SendVersion ¶
func SendVersion(context HandleHandshakeContext, incomingRoute *routerpkg.Route, outgoingRoute *routerpkg.Route, peer *peerpkg.Peer) error
SendVersion sends a version to a peer and waits for verack.
Types ¶
type HandleHandshakeContext ¶
type HandleHandshakeContext interface { Config() *infraconfig.Config NetAdapter() *netadapter.NetAdapter Domain() domain.Domain AddressManager() *addressmanager.AddressManager AddToPeers(peer *peerpkg.Peer) error HandleError(err error, flowName string, isStopping *uint32, errChan chan<- error) }
HandleHandshakeContext is the interface for the context needed for the HandleHandshake flow.
Click to show internal directories.
Click to hide internal directories.