prysm-pulse/beacon-chain/p2p/handshake.go
Preston Van Loon 0b8cbd06b6
Add flag for testing new p2p (#3243)
* refactor a bit to select p2p

* lint

* fix build

* fix build

* fix build

* fix build

* fix build
2019-08-19 17:20:56 -04:00

24 lines
556 B
Go

package p2p
import (
"sync"
"github.com/libp2p/go-libp2p-core/peer"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
)
var handshakes = make(map[peer.ID]*pb.Hello)
var handshakeLock sync.Mutex
// AddHandshake to the local records for initial sync.
func (p *Service) AddHandshake(pid peer.ID, hello *pb.Hello) {
handshakeLock.Lock()
defer handshakeLock.Unlock()
handshakes[pid] = hello
}
// Handshakes has not been implemented yet and it may be moved to regular sync...
func (p *Service) Handshakes() map[peer.ID]*pb.Hello {
return nil
}